Personally Identifiable Information (PII), hashing and Google Analytics

Google has a strict policy prohibiting sending Personally Identifiable Information (PII) to Google Analytics. This is necessary to provide GA reports around the world, yet comply with country regulations about storing personal information.  Even if you send personal information accidentally, Google may be forced to delete all of your analytics data for the time range affected. This policy has recently tightened to state: You may not upload any data that allows Google to personally identify an individual (such as names and email addresses), even in hashed form. A number of our clients are using a hashed email as the unique identifier for logged in users, or those coming from email campaigns.  If so, this needs be a minimum of SHA256 hashing (not MD5 hashing), with a 'salt' to improve the security - check your implementation meets the required standard. If you want to check if personal information affects your analytics, we now include checking for PII in our complete Google Analytics audit. Google's best practice for avoiding this issue is to remove the PII at the source - on the page, before it is sent to Google Analytics.  But it may be hard to hunt down all the situations where you accidentally send personal data; for example, a form which sends the user's email in the postback URL, or a marketing campaign which add the postcode as a campaign tag. We have developed a tag manager variable that does this removal for you, to avoid having to change any forms or marketing campaigns which are currency breaking the rules. Steps to setup 1. Copy the script below into a new custom Javascript variable in GTM [code language="javascript"]function() { // Modify the object below to add additional regular expressions var piiRegex = { //matches emails, postcodes and phone numbers where they start or end with a space //or a comma, ampersand, backslash or equals "email": /[\s&\/,=]([a-zA-Z0-9_.+-]+\@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+)($|[\s&\/,])/, "postcode": /[\s&\/,=]([A-Z]{1,2}[0-9][0-9A-Z]?(\s|%20)[0-9][A-Z]{2})($|[\s&\/,])/, "phone number": /[\s&\/,=](0[0-9]{3,5}(\s|%20)?[0-9]{5,8}|[0-9]{3}-[0-9]{4}-[0-9]{4})($|[\s&\/,])/ }; // Ensure that {{Page URL}} is updated to match the Variable in your // GTM container to retrieve the full URL var dl = {{Page URL}} var dlRemoved = dl; for (key in piiRegex) { dlRemoved = dlRemoved.replace(piiRegex[key], 'REMOVED'); } return dlRemoved; }[/code]   2.Check {{Page URL}} is set up in your GTM container This is a built-in variable, but you'll need to check it under the variables tab.   3. Change the pageview tag to override the standard document location, and use the variable with PII removed   By default, Google Analytics takes the location to be whatever is in the URL bar (document.location in Javascript).  You will over-ride that with the PII-safe variable.  

2016-08-03

Why do you need cross-domain tracking?

What is cross-domain tracking and why do you need to implement in your Google Analytics account? Cross-domain tracking makes it possible for Analytics to see sessions on two related sites (such as an ecommerce site and a separate shopping cart site) as a single session. This is sometimes called site linking. Cross-domain literally means that you are able to see a user in a single Google Analytics account in his journey across multiple domains that you control (e.g. mysite.com and myshoppingcart.com). In the standard configuration of the Google Analytics script, every time a customer loads a page on a different domain a new session is generated, even if the branding looks seamless to the user and, unfortunately, the previous session has ended and this is even if the customer is still active and generates events and page views. Until you have implemented the cross-domain setting on your website you will not be able to have an accurate customer journey. Why? Let’s take, for example, a standard website, www.siteA.com, and it's blog, www.blogB.com. To track sessions, Analytics collects a client ID value in every hit. Client ID values are stored in 1st party cookies, and these cookies are only available to web pages on the same domain. When tracking sessions across multiple domains, the client ID value has to be transferred from one domain to the other. To do this, the Analytics tracking code has linking features that allow the source domain to place the client ID in the link URL, where the destination domain can access it. Fortunately, with the release of Universal Analytics cross-domain tracking, it is easier to implement, and especially so with Google Tag Manager. Setting up cross-domain tracking using Google Tag Manager Add (or edit your existing) a basic page tracking tag (i.e. Tag Type = Universal Analytics; Track Type = Page View). If you are using the same container for siteA.com and blogB.com, under More Settings → Fields to Set, enter the following: Field Name: allowLinker Value: true Under More settings → Cross-Domain Tracking → Auto Link Domains enter "blogB.com" (without the quotes). If you have multiple domains, separate them by commas: blogB.com, siteC.com Leave the 'Use hash as delimiter' and 'Decorate forms' unless you have an unusual web setup. Set the trigger to "All Pages". Save a version of the container and publish it. If you are using a separate container for blogB.com, repeat the steps above but in the Auto Link Domains field add: siteA.com Add both domains to the Referral Exclusion List When a user journey crosses from your first domain to your second domain, it will still appear as a new session in Google Analytics by default. If you want to be able to track a single session across multiple domains, you need to add your domains to the referral exclusion list. Here’s an example Tag Assistant Recordings report that shows what it looks like when cross-domain tracking is not setup properly. Setting up cross-domain tracking by directly modifying the tracking code To set up cross-domain tracking for multiple top-level domains, you need to modify the Google Analytics tracking code on each domain. You should have basic knowledge of HTML and JavaScript or work with a developer to set up cross-domain tracking. The examples in this article use the Universal Analytics tracking code snippet (analytics.js). Editing the tracking code for the primary domain ga('create', 'UA-XXXXXXX-Y', 'auto', {'allowLinker': true}); ga('require', 'linker'); ga('linker:autoLink', ['siteB.com'] ); Remember to replace the example tracking ID (UA-XXXXXX-Y) with your own tracking ID, and replace the example autoLink domain (siteB.com) with your own secondary domain name. Editing the tracking code on the secondary domain ga('create', 'UA-XXXXXXX-Y', 'auto', {'allowLinker': true}); ga('require', 'linker'); ga('linker:autoLink', ['siteA.com'] ); Remember to replace the example tracking ID (UA-XXXXXX-Y) with your own tracking ID, and replace the example autoLink domain (siteA.com) with your own primary domain name. Adding the domain to page URLs using filters By default, Google Analytics only includes the page path and page title in page reports - not the domains name. For example, you might see one page appear in the Site Content report like this: /contactUs.html Because the domain names aren’t listed, it might be hard to tell whether this is www.siteA.com/contactUs.html or www.blogB.com/contactUs.html. To get the domain names to appear in your reports you need to do two things: Create a copy of your reporting view that includes data from all your domains in it Add an advanced filter to that new view. The filter will tell Google Analytics to display domain names in your reports. Follow this example to set up a view filter that displays domain names in your reports when you have cross-domain tracking set up. For some fields, you need to select an item from the dropdown menu. For others, you need to input the characters here: Filter Type: Custom filter > Advanced Field A: Hostname Extract A: (.*) Field B: Request URI Extract: (.*) Output To: Request URI Constructor: $A1$B1 Click Save to create the filter. You can validate that filters are working as you expect using Google Tag Assistant Recordings. Tag Assistant Recordings can show you exactly how your filters change your traffic.   Get Social! Follow us on LinkedIn, Twitter, and Facebook and keep up-to-date with our Google Analytics insights.

2016-08-02

How to trust your Google Analytics data setup

Google Analytics is a powerful tool… when implemented correctly. I can’t even count the number of times we've had enquiries from and spoken to companies who don’t trust the data in their reports because it's incorrect or incomplete. And it all comes down to wrong configuration and setup. Checking and amending correctly the very basics of your analytics setup will provide you with data you can rely on and an accurate foundation for further more advanced configurations, like Enhanced Ecommerce tracking. So here's a list of questions you should be asking whilst checking your Google Analytics (GA) property and view settings. This is assuming you're on Universal Analytics (analytics.js) so not all setup options may apply if your site is on Classic analytics (ga.js). I'll also cover a few common setup issues at the end. GA property settings Go to Admin > Property > Property Settings. Is your default URL set up correctly? The default URL is used in Content and in-Page Analytics reports to display page previews. Do you have a correct default view picked? By default, this will be the first view created at the time of initial GA setup. If you're using AdWords Express or Google Play, then you want to check the view here is the one you want to connect to either of the services. The default view will also show you all the custom and advanced segments you've created in other views. Have you set your industry category? Pick whatever matches your property most closely if you want to be included in the benchmark reports. Have you enabled demographics reports? Demographics and interests reports give you additional insight into your users. Recently I explained how to set this up in Google Analytics and Google Tag Manager V2. Do you need enhanced link attribution? Enable this if you have pages with multiple links that take people to the same destination or a page element that has multiple destinations, eg internal search. This will help with identifying which particular elements or links were clicked. In addition to enabling this in the property settings, you also need to add a line of code to your GA tracking code, or, if using GTM, toggle Enhanced Link Attribution to true in your pageview tag under Advanced Configuration settings. Should you link with your Search Console? Link your Search Console site with your Google Analytics property to see Search Console data in your GA reports, and access GA reports directly from the Links to your site and Sitelinks sections in Search Console. GA view settings Property settings sorted? Great, now go to View > View Settings. Is your view name descriptive? Use easy to understand naming to describe what the view is for, eg excluding admin, domains included, ecommerce data only. Have you set your default URL? Similarly to the property settings, make sure you use the correct default URL here to improve your Content and in-Page Analytics reports. Have you set a correct time zone? The beginning and end of each day for your reports is calculated based on the time zone you have set. If you need to update this, you may see a flat spike in your data caused by the time shift. Do you need a default page? Setting a default page is useful when you have two separate URLs loading the same homepage. Here you can configure those pages to be considered as the same URL. This will affect your reports so make sure you do this correctly Should you exclude URL query parameters? Specify any parameters you don’t want to see in your reports. I've found a blog post from Lunametrics useful for understanding when and how to exclude URL query parameters. Is your currency correct? Especially relevant for sites with ecommerce tracking for making sure that the reports show your order values and revenues in the currency you operate in, and not in $ that it converts to by default. Have you ticked bot filtering option? Whilst this option doesn't help with eliminating all of the spam referrals, ticking this box will exclude at least a few of them. To get rid of all of your fake referrals, here's a thorough guide on how to exclude them with two filters. Get yourself a cuppa if you're going to clean up your data. Does your website have a search function? Enabling the site search is useful for understanding what your website visitors are looking for. It should be pretty painless to set up if you have a query included in the URL, and we've covered the steps to set up internal site search tracking in one of our blogs. Other common setup issues Here are also a few very common setup problems that I keep coming across again and again. Have you got an unfiltered view? It's good practice to have an unfiltered view that you keep clean from any filters and customisation. This way you can always double-check your data if anything goes wrong in another view. Is your bounce rate less than 10% whilst your pageviews have doubled? This may be happening due to pageviews firing multiple times. You can use Tag Assistant plugin for Chrome to check if that's true. Are you getting referrals from your own domain and your payment gateway? This is skewing your data so checkpoints 3 and 4 on how to exclude referrals from your domain and payment provider. Tracking multiple subdomains in the same view? By default, you see only request URI in your reports without a domain, which isn't very helpful if you are tracking more than one domain in the same GA view. You can improve this by adding a hostname to URLs with a custom filter. Check Google's guidance for how to do it. Are you filtering out internal traffic? To minimise your data being skewed by internal colleagues or partner companies you may be working with, exclude their IPs with the help of filters. Are you on top of website traffic changes? OK, so this one isn't quite about the problem with the setup but if data has an important role in your business, you can make your analysis more efficient. Google provides you with the ability to set up alerts for important changes in your data, but our software does the work for you. Instead of trawling your data for hours or spending further time on configurations, you can set up alerts and personalised reports within minutes.   Have you experienced other setup problems that aren't covered above? Let me know and I'll include them. Image Credit: Images courtesy of vectorolie and ratch0013 at FreeDigitalPhotos.net

2016-02-18

Know who converts on your site with Google Analytics goals

Wouldn't you want to know how well people convert on your site? Setting up basic conversion goals will enable you to measure site engagement – based on time on site, destination page or particular events - and what drives that. Below I’ll cover the reasons why you should set up goal tracking in your Google Analytics, different types of goals available, goal value, and then explain how to set them up. So why should you track goals? Goals are great for tracking important actions that are crucial for your business and understanding how people convert on your site. Once you set up goals, you will be able to analyse conversion rates in the Goals reports. Conversion data will also appear in other Google Analytics reports, like the Attribution and Acquisition reports. This will help you identify which marketing campaigns and channels get users to complete the goals you have previously defined. The destination goal also allows you to set up a funnel to visualise the path people take through your site towards completing a purchase, signing up or another conversion. Seeing how people navigate through your site in a visual way makes it easier to identify where they drop off. If you see a lot of exits on particular pages, then review those pages to see if you can improve them to minimise the exits and guide more people towards converting. If you see a lot of people skipping certain pages, then your path to conversion might be too long or contain unnecessary steps. For more info on flow visualisation reports, check Google’s help pages. What kind of goals can you set up? You can set up a destination goal to track how many users reached a certain page, eg thank you, purchase confirmation or pre-order request pages. Then there’s a duration goal that tracks how many users stayed for a specific amount of time, eg for at least 15 minutes. You can also set up a pages/screens per session goal to see how many users view a specific number of pages during a session. An event goal is for when a user triggered certain events on the site that you have already set up, eg clicked on an ad, submitted a form or saved a product. What else should you know about goals? Goals have a few limitations in Google Analytics: You can set up only 20 goals per view. If you need more, you can either create another view or repurpose existing goals. Goals apply to the data after you’ve created them. Goals can’t be deleted; but you can turn them off if you don’t need them. Use names that make sense so that anyone using your Google Analytics data can understand what the goals are for. Keep track of when you changed the goal by adding annotations to your reports. Do you need the goal value? Setting up a goal value is optional. You should set a monetary value for your goal when you want to track how much you earned from converting users and you’re able to calculate the worth of each lead. If you know that 5% of people who sign up on your site end up buying your service, and the average value of your service is £1000, then you can set £50 as your goal value (5% of 1000). When setting up a goal value, make sure the currency corresponds to what you use on the site or are familiar with. You can do this in Admin > View > View Settings. Are you an ecommerce site? If you’re an online retailer, then instead of using goal values you should be using Ecommerce or Enhanced Ecommerce tracking for Google Analytics. These reports will be much more insightful for tracking your store performance. So how do you set up goals? You need to set these up at the view level. Go to Admin > View > Goals, and click New Goal. Google has added some goal templates that you can choose from if you’re happy to use their naming. Alternatively, select 'Custom' at the end of the list and click ‘Continue’ to the goal description. For your goal name use something that is easily understood by others using your Google Analytics account, and the goal details will depend on the type of goal you're setting up. Setting up destination goal You can follow the blog I've previously written on setting up the destination goal and funnel. Setting up duration goal Click ‘Continue’ and specify the minimum amount of time you want to track. Setting up pages/screens per session goal Here you specify the number of pages someone viewed per session. Setting up event goal Set the event you want to track as a goal by using exactly the same category, action, label and value as in the event. If you want to use a goal value here, you have the option to use the event value you’ve already set. Verify your goal - click ‘Verify’ to check if it works. If the goal has been set up correctly, you should see an estimation of the conversion rate your goal would get. If you’re not getting anything, check each step carefully and Google's help pages on why your conversion tracking might not be working. Once you’re happy with the setup, click ‘Create goal’ and check the results in your analytics reports after a few days or weeks, depending on the amount of traffic you get.   If you need help with the setup above or have another way of using goals, I’d love to hear about it in the comments below.

2016-01-28

Why should you tag your campaigns for Google Analytics?

Google Analytics custom campaign tracking is essential for measuring the effectiveness of your marketing efforts. Let's say you were promoting your new ebook across social media and emails, how would you know which social post or email blast was the most effective? That’s where Google campaign parameters come in (also referred to as UTM). You simply add them to your URLs, which are then used in your web-based, email or ad promotions. When someone clicks on them, the custom information linked to these URLs via parameters is sent to your Google Analytics reports. If you don’t tell Google the specifics of your campaigns, then they will be rolled into existing buckets without the ability to identify them. This most commonly happens with emails and social posts that by default get classified as referrals. But once you start tagging your campaigns, you will see those social initiatives and email newsletters separated by campaign names and other information you provided. Tagged up links can also be used in email signatures, listings on other sites and social media profiles. By using campaign tagging you will understand better which URLs have been most effective in attracting users to your site or content, for example you'll see which: Email newsletter brought you the most traffic Ad was best at bringing you converting visitors Facebook post engaged the most users If you have goals set up, then you will also see how visitors from individual campaigns convert on your website. Using custom campaign data in reports You can access custom campaign data in Acquisition > Campaigns > All Campaigns report, where you will see your various campaigns based on the parameters used in URLs. You can also switch between viewing your campaigns by source and medium tags that you’ve used. Another report you can use is the Assisted Conversions (under Conversion > Multi-Channel Funnels) that summarises how your channels, or campaigns, contribute to your conversions. To see the campaigns, you need to click on 'Other', find 'Campaign' and select it. Now you will see data related to your campaigns only. Check Google's guidance on understanding the Assisted Conversions report. Be consistent Consistency is very important in campaign tagging so make sure that the parameters you use in your campaigns are exact. For example, if you use email, Email and E-mail, Google Analytics will record them as three different mediums in your reports. So, set your naming conventions and if you have a bigger team, then agree on what they are and make sure everyone is aware of them. What tags can you use in your campaigns? There are five types of information you can pass on with the tags/URLs. Three of them should always be used: Campaign source (utm_source) - identifies where the traffic comes from, eg newsletter, google. Campaign medium (utm_medium) – advertising or marketing medium, eg cpc, email. Campaign name (utm_campaign) – what the campaign is called whether it's a promo code or specific promotion, eg winter sale. The other two, whilst not required by Google, are useful for tracking additional information: Campaign term (utm_term) - identifies paid search keywords if you’re manually tagging your paid keyword campaigns, eg red shoes. Campaign content (utm_content) – helps differentiate between same type of content or links, useful when doing AB testing or using multiple calls to action, eg logo or text link. How to tag your campaigns? It’s easier than you might think. You can do it manually if you know how, but the available URL builder tools online make it super simple to tag your links correctly. But if you're using Adwords or Bing then you can enable auto-tagging so you don't have to worry about tagging them. For websites use the Google URL builder tool to append URL parameters. For Android, use the Google Play URL builder tool to append URL parameters. You also must have Google Play Campaign Attribution set up in your Android SDK. For iOS, use the iOS Campaign Tracking URL Builder to append URL parameters. You must use Google Analytics iOS SDK v3 or higher for this to work. For manual tagging, you need to enter a question mark after the URL and before adding your parameters. Then pair up the parameters with their values, eg utm_source=newsletter, and separate campaign parameters with an ampersand. After the question mark, parameters can be placed in any order. You'll end up with a link that'll look something like this: http://www.littledata.io/?utm_source=newsletter&utm_medium=email&utm_campaign=welcome, which is ready for use in your promo activities. Auto-tag your campaigns To make campaign tracking and tagging simpler, we have created a tool in Google Sheets that automatically creates a tagged up link. You'll need to fill the values for parameters and the formula will do the rest for you. To use it, you'll need to make a copy to store in your own Drive (via File option). Get campaign tracking sheet with URL builder   Got questions? Comment below or get in touch!

2016-01-06

How to set up demographics and interests reports in Google Analytics

Demographics and interests reports in Google Analytics give you additional insight about your users, allowing you to do analysis based on age, gender and interest categories. You get a much better idea of who your users are and the setup is so quick to do, there's no reason not to. To get this information, you need to do minor tweaks to your Google Analytics and Google Tag Manager. Those changes will allow Google to share anonymised data about your site or app visitors, and once set up, you can use this information to understand the behaviour patterns of your users by different profiles. You will be able to see: If a particular age group converts more Whether you get more visits from males or females from a particular country or city If your users are more into travelling, movies or social media You'll also be able to: Build remarketing lists Build segments for more detailed information about your users Target your ads to specific users What reports will you get? Demographics Overview: snapshot view of your users by age and gender Age: Acquisition, Behaviour and Conversions metrics by age group (below 18 are not included) Gender: Acquisition, Behavior and Conversions metrics by gender Interests Overview: top 10 interests of your users in 3 areas: Affinity Categories, In-Market Segments and Other Categories Affinity Categories (reach): view of users by their lifestyle with Acquisition, Behaviour and Conversions metrics broken down by Affinity Categories In-Market Segments: view of users by their product-purchasing interests with Acquisition, Behaviour and Conversions metrics broken down by In-Market Segments Other Categories: more specific view of users with Acquisition, Behaviour and Conversions metrics broken down by Other Categories How does Google get this data? Google collects demographics and interests data from the third-party DoubleClick cookie for web traffic and anonymous identifiers for mobile app activity, like the Android Advertising ID and the iOS Identifier for Advertisers. But Google is unable to collect this data if the cookie or anonymous identifier isn't present, or if there's no profile information available. As a result, this data may only be available for a subset of your users. This will be shown on the report as a % of traffic the report represents. When is threshold applied? There are occasions when data is withheld from your reports to ensure the anonymity of users. For example, this might happen when you don’t have enough data for a particular age range or gender. When the threshold has been applied, you will see a notification below the report title. 3 simple steps to set this up 1. Enable the feature in Google Analytics Go to Admin > Property > Property Settings. Scroll down to Advertising Features, and set the option to Enable Demographics and Interests Reports to ON. Now save. 2. Enable the feature in Google Tag Manager Go to edit your GA pageview tag > Configure Tag. Under the tracking ID, tick the Enable Display Advertising Features box. Save the tag, and you've got one last step to do. 3. Enable the report in Google Analytics For this go to Audience > Demographics > Overview report. Click Enable, and you're all set. You should see your demographics and interests data within 24 hours of enabling the feature. We also provide consultancy services if you need help with more advanced setup.   Further reading: Tracking registered users with Google Analytics and GTM V2 How to use demographic targeting in AdWords  

2015-12-18

7 quick wins to speed up your site analysis techniques in Google Analytics

Analysis and reporting are the most time-consuming aspects of site or app performance tracking in Google Analytics. If you ever wished or thought if only it was quicker, then this post is for you. There are a number of techniques you can implement to speed up your data analysis and number crunching. Here I’ll cover 6 of them. Schedule email reports Google Analytics dashboards are a great way to monitor metrics that are important for your business. But instead of logging in every day or week, or however often you tend to check them, schedule automated email reports instead. At Littledata, we have a select few metrics that we keep track of on a weekly and monthly basis. The whole team gets an email report on a specified day, allowing everyone to get the latest stats without someone on the team having to get those numbers manually every time. To set this up, go to the dashboard that you want emailed to others (or yourself), click ‘Email’ and fill in the details. If you're scheduling the email to go to your team on a regular basis, why not add a nice message in the email body. To edit the scheduled emails you've set up previously, go to Admin > View > Scheduled Emails (towards the bottom of the list). Access your reports quickly Shortcuts in Google Analytics allow you to quickly view the reports you use most often. Even better, they remember the settings you applied to any report. So if you apply an advanced segment or another customisation to the report, saving it as a shortcut will remember your preferences. Except for the date range - that won't be remembered. You can find the shortcut option just below the report title, and once added, you'll find your shortcut reports at the top of the reports list in the left panel. Search for reports you can’t find If you find yourself wondering where a particular report is, use the search found at the very top. Instead of having to go through an extensive report list trying to find something you vaguely remember seeing last month, you get suggestions of what you might be looking for as you type. So you only need to remember or guess part of the report title that you're looking for. Use keyboard shortcuts Did you know Google Analytics has keyboard shortcuts? They allow you to move around the report much quicker and the date range keyboards make a big difference to a workflow. Picking date ranges can be tedious and annoying so I've found these to be the best. If you're already using keyboard shortcuts on your devices, you won't need convincing of their usefulness. To view this complete list of shortcuts in Google Analytics at any time, use a shortcut: ? Set up goals to understand your website visitors Goals are valuable in understanding how well your site or app helps you achieve your objectives. Unfortunately, we see a lot of businesses who either find it too complicated to set up or have done it incorrectly. Speaking from personal experience, it only takes a little practice to get the hang of it, and once setup, you get essential conversion data in your reports. You'll be able to evaluate your marketing efforts and campaigns much more effectively. Check out Google's guidance on goals and my guide on how to set up a destination goal funnel. See trends quickly with Littledata reports We have a clever tool that looks through all of your Google Analytics data and finds the most interesting changes to report on. There are over hundred of GA reports so getting automated summaries that you can act upon will save you hours of work. Littledata tool doesn't require installation and it's quick to set up - all you need is an existing Google Analytics account to sign up with for free. The reports you'll get are also great for presenting to colleagues in meetings, as other users have said. To get your reports, go to Littledata homepage, enter your website into the box and click 'Get started.' We're also working on bringing you benchmarking information, customised tips on how to improve your Analytics setup and what you should be tracking. Pro tip: Manage complex data with query explorer tool Whilst, not the quickest to get used to, Google's query explorer tool can be powerful for those working with large and complex datasets. Some of our biggest clients' websites get millions of hits a month, which can cause discrepancies in data analysis (especially when data is sampled). So I use the query explorer tool to verify the data that clients ask for. To use this tool, you will need to know your metrics from dimensions and learn more about how to use segments, filters and query building.   If you've got questions on any of the above, don't hesitate to comment below or get in touch!  

2015-10-15

How to track registered users with Google Analytics and Google Tag Manager V2

Wondering if Samsung Galaxy is more popular than iPhone when engaging with your content? Then set up the User-ID view to see your logged in users’ activity and evaluate behaviour by the device. With the activity data you collect in the registered users view, you can improve the analysis of your customers' behaviour by seeing which devices are used to sign up and access your website. To summarise the benefits: You get access to the Cross-Device reports, which allow you to analyse which devices your users use to engage with your content. See what the Cross-Device reports look like. You improve your understanding of logged in users who often engage with the site's content differently than those who aren't registered. You get a more accurate user count. In your standard analytics view, a new user is counted every time your site visitor switches to a new device or starts a new session. With the registered user view, you give each user a unique ID, which helps to stitch together various activities carried out by the user. You can find out which devices users prefer for different engagement activities across multiple sessions. This helps with tailoring your campaign and content to different devices and activities. To set this up, you need to have the user ID stored in the data layer. If you don't have it set up, scroll to the bottom for an advanced hack. Now let’s look at how to set up the tracking by using Google Analytics and Google Tag Manager V2. Looking to implement the User-ID in your tracking code? Check Google’s guidance. Enable the feature in Google Analytics Firstly, enable the User-ID feature by going to  Admin > Property > Tracking info > User-ID. Read through the short policy on what you’re allowed to track and not. Google is very strict about tracking personally identifiable information so you are not allowed to send any personally identifiable information, such as names and email addresses. But numbered IDs or hashed emails are fine to use. To agree to the terms, follow the steps and click ‘create.’ Create the variable in Google Tag Manager Now go to GTM variables and click 'new'. Select Data Layer Variable type and use the name stored in your data layer, e.g. uid or user ID Add the variable to your pageview tag Go to edit your pageview tag and click on More settings > Fields to set. Click Add field, enter the field name as &uid and select the variable you’ve just created - eg {{uid}} or {{userID}}. Test you're seeing activity in the newly created registered users view with your login, or a test one if you have it. Don't forget to publish your GTM container for tracking to work. Advanced hack If for some reason you can't get your developer to store a user ID in the data layer, there is a way around it. We've created a javascript variable to get a username off the page and hash it prior to sending it to GA. For this, you need to pick a custom Javascript type variable and enter the script below into the custom javascript field. This javascript requires either your developer or you to customise it to work on your page (see the notes in the second and third lines). function() { //dependent on using Jquery selectors //replace '.menuTitle small a' with the selector for your username var name = $('.menuTitle small a').text(); var hash = 0, i, chr, len; if (name.length == 0) return hash; for (i = 0, len = name.length; i < len; i++) { chr = name.charCodeAt(i); hash = ((hash << 5) - hash) + chr; hash |= 0; // Convert to 32bit integer } return hash; }; If you need help with any of the above, don't hesitate to comment below or get in touch!

2015-08-19

Get the app

See for yourself why Littledata is the smartest ecommerce analytics app

Free trial