Do I need the Google Analytics tracking code on every page?

The script which triggers the tracking events to Google must be loaded once (and only once) on every page of your site. To set up Google Analytics tracking, you’ll usually need either your Analytics tracking ID or the entire Javascript tracking code snippet. This corresponds to your Analytics property. To find the tracking ID and code snippet: Sign in to your Analytics account. Select the Admin tab. Select an account from the drop-down menu in the ACCOUNT column. Select a property from the drop-down menu in the PROPERTY column. Under PROPERTY, click Tracking Info > Tracking Code. The snippet provided here must be implemented on every page, even the pages you are not interested in. If you chose to not include the code on every page then: you will not be able to see the full flow of a client on your website you will have inaccurate data about the time spent on site and actions taken visits to untracked pages will appear as 'referrals' and so will skew the volume of sessions marketing campaigns to the untracked pages will be lost The easy way for an established website to see if the tracking is complete is to go in Google Analytics -> Acquisition -> Referrals and search in the report after the name of your website, as shown below, or you can use Littledata's audit tool. Choose how to set up tracking There are several ways to collect data in Analytics, depending on whether you want to track a website, an app, or other Internet-connected devices. Select the best installation method for what you wish to track. Here is the complete guide from Google. Once you have successfully installed Analytics tracking, it may take up to 24 hours for data such as traffic referral information, user characteristics, and browsing information to appear in your reports. However, you can check your web tracking code setup immediately. If you don’t think it's working correctly Check your Real-Time reports or use Use Google Tag Assistant to verify your setup.   Get Social! Follow us on LinkedIn, Twitter, and Facebook and keep up-to-date with our Google Analytics insights.

2016-08-04

Attributing goals and conversions to marketing channels

On most websites, the conversion journey involves many different routes and across many sessions: few customers buy from the first advert. You may have heard of the ‘rule of 7’. In reality, it varies from maybe 2 or 3 touches for a $20 purchase and definitely more than 10 for an enterprise business service. Your company is buying prospects (or traffic) from a number of online channels, and in many cases, it will be the same potential customer coming from different sources. To be able to report on this in Google Analytics, we need to get the basic setup correct. Tagging campaigns for attribution The first step is to make sure that the different traffic sources can be compared in a multi-channel report are consistent and have complete inbound link tagging. Be sure to tag your campaign correct with our URL Builder. Some tools (such as Bing or Mailchimp) have options to turn on link tagging for GA - although it's buried in the settings. With many others, you will have to add the necessary ‘UTM’ parameters onto the link. Without this tagging, many sources will be misattributed. For example, affiliate networks could send referrals from any of thousands of websites which will appear under the ‘referrals’ channel by default. Facebook ads, since the majority come from the Facebook’s app, will appear under the ‘direct’ (or ‘unknown’) channel. From when full tagging is in effect, the channels report will start to reflect your genuine traffic acquisition source. But don’t expect a 100% match with other tracking tools – see our article on Facebook – GA discrepancies. Importing cost data The cost for any Google AdWords campaigns can be imported automatically, by linking the accounts, but for any third party campaigns, you will need to upload a spreadsheet with your costs on. The benefit is that now you can see the return on investment calculation update in real-time in the multi-channel reports. Model attribution The final step is to decide how you will attribute the value of a campaign if it forms part of a longer conversion pathway. The default for Google Analytics (and most others) is ‘last non-direct click’. That means that the most recent TAGGED campaign gets all the credit for the sale. If the user clicks on 5 Facebook ads, and then eventually buys after an abandoned basket email reminder, that email reminder will get all the sales (not Facebook). This attribution is what you’ll see in all the standard campaign and acquisition reports. You may feel that it is unfair on all the work done by the earlier campaigns, so ‘linear’ (sale equally credited to all tagged campaigns) or ‘time decay’ (more recent campaigns get more credit) may be a better fit with your businesses’ goals. Conclusion Multi-channel marketing performance attribution is not a luxury for the largest companies. It’s available to you now, with the free version of Google Analytics. It will require some setup effort to get meaningful reports (as with any measurement tool) but it has the power to transform how you allocate budget across a range of online marketing platforms. But if this still is not working for you then you may have a problem with cross domain tracking. Need a bit more advice or have any questions? Get in touch with our experts or leave a comment below!   Get Social! Follow us on LinkedIn, Twitter, and Facebook and keep up-to-date with our Google Analytics insights.

2016-08-04

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

Tips to optimise your ecommerce landing pages

Are your ecommerce landing pages suffering from poor conversion rate because people aren't engaging? First impressions are everything, and more so online, so your task is to figure out which on-site improvements will help you towards your goals. Once you start optimising, it's a continuous process of reviewing, changing, testing and refining - aiming to find out what is most appealing to your customers, what they like and care about, what makes them trust you, what encourages them to purchase. There is always room for refinements so here are some tips on what you should consider when reviewing your pages. What are you trying to achieve? Before starting testing and implementing the changes on your landing pages, you have to be clear about what you want to accomplish. Whilst the end goal for an online store is to increase sales, at times you might also want to get more sign ups, or improve views of or engagement with product pages. Think about what success will look like as that will help with planning your optimisation tests. How are you going to measure it? If you are clear about what you are trying to achieve, it will be easier to set measurable targets. Are you looking to increase your sales by 10% or pageviews of products by 15%? Or maybe you want your potential customers to browse further and spend more time reading content? Further engagement can also be demonstrated by the site visitor scrolling down the page if you have long product or category pages. In which case you'll want to track how far down the page they get to. I believe in keeping reporting straightforward so when testing focus on tracking important metrics only. Ideally just one if you can, or a few if you have to, but that will help focus on measuring what is most important for your business at the time. Assuming you are using Google Analytics, like most of people looking after digital performance, set up goals to monitor how customers are converting. Our web-based software also makes it easy to keep track of on-site changes are by reporting on changes in trends, goals, pages. Who are you targeting? User-focussed content is more effective at engaging your customers and improving your conversion rates. So you should write up your customer personas to be clear about who you are targeting with landing pages. This also applies to general look and feel of your ecommerce site. Most importantly, include with personas what problems your customers are trying to solve or what they are trying to achieve.  Once your team knows who your ideal or typical customers are, then it will be easier to focus on creating more relevant and engaging content on those pages. Do you have a clear value proposition? Value proposition explains why you’re better than or different from your competitors, and what you can deliver that they can’t. When writing it up, focus on benefits not features. It’s not always about the product looking top notch (unless you’re the industry or company where that matters of course) so it is more about how you can alleviate their problem. Check out how to write your value proposition by following Geoffrey Moore’s model. Does your copy reflect your value proposition? Once you have your customer personas and value proposition, review existing content on the site against how you describe what your clients are looking for. Check if it fits with what they are looking for, explains how you can solve their problems or fulfill their desires. The copy on your site has to reflect how you can improve your potential customers lives through what you offer. A great copy informs, compels, captivates, reflects what people search for and promotes key benefits. Econsultancy have compiled a great set of advice from experts on writing copy for product pages. Also, check out Copyblogger Demian Farnworth’s articles for superb advice on writing copy. Have you found your winning call to action? This is very important – test your call to action until you find the best performing one. Your call to action is like a visual sign that guides the buyer towards a specific action you want them to complete. Different things work for different sites. Start off with trying simple changes like different text, colour, shape, size or placement of the button to figure out what is most effective for your page. If small changes aren’t helping, then try a more drastic change of the button or page. Do your pages load fast? This is pretty self-explanatory. Slow page loading speed might drive your potential customers away from your online shop, so you should regularly check whether they can view your products within 3 seconds (Source: Radware). If you’re using Google Analytics, you can use Site Speed reports to check how you’re performing and get advice on where to improve. If you don’t have Google Analytics, you can use their online tool PageSpeed Insights. Other tool worth checking out is GTMetrix where you can grade your site's speed performance and get a list of recommendations. Do you need to optimise for mobile? It’s a very common fact that more and more people are using mobile devices to browse and buy online. But unless you have unlimited budget for ensuring that your ecommerce site is optimised for mobile, it is best to check in Google Analytics first whether you need to do it now. If you go to Google Analytics > Audience > Mobile > Overview report, you will get a breakdown of device categories that buyers are using to visit your online store. Here you can see that the majority of customers, almost 93% are using desktop so in this case (assuming you have a limited budget) you might want to make sure you have a responsive site at the very minimum, and leave a full optimisation for mobile device for later when there is a sufficient need. Now, if results were different and let’s say you had 60% of people visiting your site via mobile devices, then you would want to ensure that they’re getting the best experience on their device and don’t leave the site to buy from a competitor instead. Are your test results statistically significant? Evaluating your AB test results isn't quite as simple as looking at the highest conversion rate for each test, which would be an incorrect way to interpret the outcome. You want to be confident that results are conclusive and changes you tested will indeed improve your conversion rates (or not, depending on the outcome of testing). That's where statistical significance comes in. It gives you assurance about the results of your tests whilst taking into consideration your sample size and how confident you want to be about the importance of the results. By reaching over 95% statistical confidence in testing results, you can be sure that the winning variation performed better due to actually being an improved version, and not simply due to change. You can easily find a calculator online that tells you if your AB testing results were statistically significant and you should conclude the test or not - for example, try the calculator by Kissmetrics or Peakconversion. There is no one winning formula for how to make your pages more effective, but you have to be pro-active to figure out what they are  - so keep testing until you do. Have any questions? Leave a comment below or get in touch with our experts!   Image Credit: Stocksnap.io

2016-07-27

9 tips for marketers using Google Analytics

Setting up Google Analytics to collect data on your website visitors’ behaviour is step one. But are you getting the insights you need? Web analytics tools like Google Analytics can provide a wealth of information about what people do on your site, but it becomes powerful when you do more than just look at trends going up or down. It’s about measuring and improving. Here are some tips on how to use your data for informed marketing decisions for your company. Make analysis a regular habit Checking analytics to evaluate website and marketing performance varies from business to business. Some do it multiple times a day or only when it’s time to do their monthly reporting or end up getting hooked on real-time analytics. Make it a regular habit to analyse your Google Analytics metrics and before you know it, you won’t need the constant reminders to do so and it'll feel less like a chore. You can start off with doing it a few times a week and if you find that there aren’t enough changes to come to any conclusions, then do it less frequently. Whilst for smaller businesses the results won’t change much hour to hour or even day to day, for the bigger businesses changes can be significant on a daily basis. Form your questions Before sifting through your Google Analytics reports, come up with a set of questions that you are looking to answer with your data. You might want to know: What are users searching for? (requires site search to be set up) Which pages are they spending the most time on? Which pages have the highest bounce rate and might need further tweaking? How are my marketing campaigns performing? Is my spending on Adwords justified? Which traffic sources bring the best converting traffic and are worth investing into? Are my call to actions working? (this is where goals come in handy) Know where to measure Think about which reports and metrics will be most suitable to answer your questions. Knowing what you're looking for will minimise the amount you spend wandering aimlessly through numerous reports hoping that you'll find something interesting. It’s said that there are over 100 standard reports available in Google Analytics, so it’s handy to know where to look. The reports are split into 4 main categories: Audience is about the users – where are they, what devices are they using, Acquisition is about how users get to your site – how are your campaigns performing, where do they come from Behaviour is about user interaction with your site – which landing pages get the highest traffic, which pages have the highest bounce rate Conversions is about users completing certain actions (requires further setup to get the most out the reports) – which goals did they complete, what is their shopping and checkout behaviour Pages with high page views and bounces / exit rate Check how your individual pages are performing in All Pages and Landing Pages reports (under Behaviour > Site Content). If your page is getting a lot of page views and has a high bounce / exit rate, then whilst it might be a valuable or attractive piece of content it’s not doing a great job at getting your users to another page. Can you provide some other relevant content on that page? Link to them where appropriate. This will help improve the visitor journey through the site and reduce the bounce rate. Know your user journeys You can use Google Analytics flow reports to view which paths users take through your site and where they drop off. Evaluate the pages with the biggest drop offs  - can you improve these pages to encourage users continue their journey? You've put a lot of work into the pages that are meant to convert your site visitors, but it's a waste of all that effort if your journey to the converting page doesn't work. Goal flow report is especially handy for seeing users' paths towards the goals you have set up. Not sure how to set up a goal funnel? Here's how. Segment your users Use Google Analytics segments to view and analyse a separate subset of user data. You could view your reports for users from a specific location, eg Spain, or with a specific device, eg Apple iPad, or by certain behaviour, eg made a purchase. Check out Google's guidance on using segments. Evaluate your tagged campaigns Custom campaign tracking is important for organising your campaigns so you can review the performance effectively. If you're not tagging your campaigns yet, check out our blog post on how to tag your campaigns. Share findings with the team It’s great if you get into the habit of reviewing Google Analytics data on a regular basis to inform your actions. What's even better is if you create a team culture where you share findings with each other. You can email around individual reports, share insight at team meetings, set up custom alerts or sign up to our web-based tool to do that for you. For those less geeky or knowledgeable about data, make sure you translate the findings into plain English statements (PS. our tool already does that too). Continuos improvement When Dave Brailsford became the head of British Cycling, he implemented the concept of marginal gains within cycling. He believed that by breaking up the process of competing and improving every step by 1%, they would see a big improvement in their team. And he was right. All the small changes accumulated into a massive performance boost, and Team GB surpassed everyone’s expectations by going on to some big wins at Olympics and Tour de France.  This can apply to many other areas as well - customer satisfaction, improving service quality, doing minor updates to marketing campaigns. Rather than focussing on one big improvement and spending weeks or months on it, before even knowing if it'll work, look at the potential small changes you could make. You will spot much more quickly which of these changes are of benefit and which are not. There's a lot of information stored in your Google Analytics, when used correctly and regularly you will start getting the insight you need to guide your marketing efforts. Suggestions above will help you do just that. Something else on your mind? Let us know in the comments below or get in touch!   Images: Courtesy of Suriya Kankliang, pannawat at FreeDigitalPhotos.net

2016-03-17

How to use the lookup table variable in Google Tag Manager

A lookup table in Google Tag Manager makes it much simpler to manage lots of values in your tracking setup. It can drastically reduce the number of tags required and turn your messy GTM into a neat environment. It's especially useful with larger setups where you have multiple tracking requirements and flexible to accommodate new tracking needs as they arise. You can easily add or remove values from your lookup tables, and not worry about having to change any codes. The lookup table variable allows you to define a set of key-value pairs where the output variable (the value that you are sending to Google Analytics) is linked to the identifier (the key). It works like this: When [input variable] equals to  _______, set [this output variable] to_______. For example, you could use the lookup table for: Assigning different Google Analytics property IDs for various domains/hostnames, eg. when [website hostname] equals to littledata.co.uk, set [property ID] to UA-010101 (see example below) Setting different pixel or conversions IDs for different country websites, eg when [website country code] equals to 2, set [pixel ID] to 88779 (requires having website country code variable defined) Defining your event categories, actions and labels (see example below) Remember! There’s no limit to how many values you can have in the lookup table, but the fields are case sensitive. So if you have multiple capitalisations of some input, then include all of them in the lookup table and assign the same output for each. I have previously explained setting up the tracking of user actions as events in GTM, but when you need to track multiple events, one tag just doesn't cut it anymore. And instead of creating several tags to cover each event or action, here's how you would create the lookup table to cover multiple values in one place. Creating lookup table variable for event parameters In the Littledata software interface, you get an option to switch between different report types or view them all. I want to track when people click on different report types, so instead of creating 5 different tags for each user action, I will set up a lookup table to cover all of them in one place. But firstly I need to know which variable to use as the input. You can only have one type of input variable per the lookup table so you want to pick a variable type that applies to each (ideally). For this, I will check how each report type option has been set up in the code by inspecting the element (inspect/inspect element depending on the browser you're using and usually accessible via right click). Here's how each report type has been set up: <a href="/report-list/m2i4MnmXcewDSzZ3c/all" class="current" id="ga-all">All <span class="count">120</span></a> <a href="/report-list/m2i4MnmXcewDSzZ3c/trends" class="" id="ga-trends">Trends <span class="count">80</span></a> <a href="/report-list/m2i4MnmXcewDSzZ3c/pages" class="" id="ga-pages">Pages <span class="count">37</span></a> <a href="/report-list/m2i4MnmXcewDSzZ3c/tips" class="" id="ga-tips">Tips <span class="count">3</span></a> <a href="/report-list/m2i4MnmXcewDSzZ3c/benchmark" class="" id="ga-benchmark">Benchmark <span class="count">0</span></a> Looking at the above, I can see that each report type has a unique ID - here that's the best one to use. Now to set this up, go to Variables, click ‘New’ and select 'Lookup Table' as your variable type. For the input variable, I will use {{Click ID}} as explained above, but you, of course, use whatever unique identifier you have available. For your output, you want to define the event action you are going to send to the Events report in Google Analytics. Should you set the default value? You can set a default value for the output when there is no match found in your table. With the event tracking, I sometimes find it useful to enable to identify if I set up my tag correctly. If my trigger ends up being too broad, the default value option will pick up additional values not defined in the table. I will then see these values in Google Analytics reports and this way I can tidy up the trigger to be more accurate. So this is what your variable should look like now. Click ‘Create Variable’ and there you have it. In your GA event tag, the newly created variable would look like this. Other uses Multiple Google Analytics properties If you have a single GTM container installed on multiple domains but you're tracking them across different Google Analytics properties, you want to ensure that you're sending the data to the correct one. Instead of having multiple variables to store different property IDs, you can have them all neatly in the same table defined by the hostname. This way any tracking activity on each site will go to its own dedicated property. Excluding test or other data If you want to make sure that any data outside of your main site goes to a test or other Google Analytics property, you can do so by setting the default value. The default value is the output that is not found in the table. With this setup, any activity tracked on www.mainsite.com goes to property ID UA-121212. If the activity wasn't on www.mainsite.com, then it sent to property ID UA-121212-2. Use lookup tables for something else? Confused? Get in touch or comment below!

2016-03-09

How to set up event tracking in Google Tag Manager

Events in Google Analytics are important for understanding how people interact with your website. They give you additional insight into their behaviour and how effective your pages are for leading users towards a conversion. With event tracking you could see how many users clicked on a button or played a video, scrolled down a page or clicked on your contact and social media icons. I mostly use Google Tag Manager (GTM) for analytics setup so I will show how to set up event tracking for clicks on buttons with GTM. Instead of hard coding events in the code, GTM allows you to create, test and amend tags within its interface. Before you go ahead creating your event tags, make sure your built-in pages and clicks variables are enabled. This will avoid you having to go back and forth between different sections. The setup below covers only one action - a click on a specific button - but if you have multiple actions to track, then look into implementing a lookup table variable. Tracking button clicks Here's my scenario. I want to track our BENCHMARK YOUR SITE button that allows users to sign up to our free software plan and get benchmarked against competitors.   And here's how to set it up. 1. Create a tag It will be a Universal Analytics tag type where tracking ID is a constant string variable (you need to create this variable before using it) and track type 'Event'. Think of your event tracking parameters as a way to organise the events into a hierarchy: Category – the main aim of the button or its placement Action – what the user clicked or the action Label – provides additional information like on what page the button was clicked or the outbound link they clicked on Value – if you have a numerical value to set for your click (not in my case tho) In my example, the category is ‘Get started’ because we have a number of similar buttons across the site with the same purpose to get the user started with the signup, so all of them have the same event category. For action, I specify the type of button that was clicked on so I can compare how these different buttons perform - 'Benchmark your site' in this case. My event label is the {{Page Path}} where they clicked on the button. The buttons take the user to the same place so I’m more interested in which pages these buttons were clicked on. Alternatively, if you have buttons that take people to different URLs you might want to track that instead. Is it a non-interaction hit? This is an important one to keep in mind. By default this is set to False. If you don’t want this event to impact your bounce rate, then change it to True, which you would do if the click or action didn’t take the user to the new page, or if you didn't want it to be included in your bounce rate calculations. Now click 'Continue' to go to the trigger setup. 2. Create a trigger Trigger is like a rule that allows you to tell the tag, ie specify the conditions, when it should fire. Under 'Fire On' select ‘Click’ as your trigger type and then ‘New’. For configuring the trigger, you have a choice between two types: Just Links – use this when the target is a link or anchor tag <a> All Elements – use this when the target is any other element that’s not a link To determine what’s best for your purposes you need to have a look at how your button is set up. You can do this by selecting ‘inspect element’ or simply ‘inspect’ depending on what browser you’re using. It’s usually available when you right click on the button or element.   Our button has been set up the following way: <a href="https://littledata.uk/signup" class="btn btn-ltd btn-green">benchmark your site</a> It has a link so I will use 'Just Links' for targets and I have a choice between three elements to use in further configuration: https://littledata.uk/signup as click url btn btn-ltd btn-green as click class benchmark your site as click text It is best to use a unique condition if you can. This way, if similar class or click url gets reused in other parts of the website you don't have to go back to this trigger to update it. With 'Just Links' you will get additional configuration options: Wait for tags - delays opening of links until all other tags have fired or the wait time has lapsed, whichever happens first Check validation - fires the tag only when opening the link was a valid action, without the tag will fire whenever the user clicks on the button/link Enable when - this options is shown only when either of the above is ticked so you can be specific about where you want the trigger to be active If you want the trigger to listen to the interactions on all pages, then set that section to be  URL or Page Path matches regex .*. (without that very last full stop - that one's for the sentence) In my case, I only want it to work on benchmark pages and all of them start with /benchmark/. The very last step in trigger setup is specifying on which actions or clicks the tag should fire. As said above, I'm using the button's click class here. All done? This is what your tag should now look like. Click 'Create Tag'. 3. Test Test your tag in GTM's preview mode by checking two things: the tag fires in the preview interface, and the tag is seen in Google Analytics real time view under 'Events' with the event parameters you specified   I hope you got on with the setup above just fine, but if you have questions or clarifications, feel free to ask below.   Further reading: Know who converts on your site with Google Analytics goals Using lookup table variable in Google Tag Manager Intro to Google Tag Manager's key concepts and terminology Image: Courtesy of suphakit73 at FreeDigitalPhotos.net  

2016-03-02

Get the app

See for yourself why Littledata is the smartest ecommerce analytics app

Free trial