White paper: Google Analytics 12 steps to advanced setup for developers
We at Core work with a range of companies who come to us to advises them and manage their search and social requirements. Dr Jess Spate, our Head of Search and Social, has written this white paper to share some of her own superlative knowledge of search engine optimisation with you, and to show how a carefully thought out and structured approach to Google Analytics can help you get the most from your website. We hope you find this white paper useful get in touch with us if we can help you with any aspect of search optimisation and web analytics. Our full contact details are available at the end of this document.
Google Analytics: 12 steps to advanced setup for developers Without any doubt whatsoever, Google Analytics is the most popular web analytics platform out there. Probably by at least one order of magnitude. Not only is it one of the deepest tag based solutions, it's also free and (to a degree) easy to install. To get better data you usually have to sign over significant sums of a client's hard earned cash and unless they have huge traffic or are involved in some fairly niche activities, they're probably better off with GA. This is not intended as a general introduction to Google Analytics. Here we're just talking about getting GA installed with all the right features, setting up custom variables and events, and generally making sure the all the right data is being collected. Actually analysing it is another question entirely, but often the developer's role ends with robust and thoughtful setup. 1. Installing the Google Analytics snippet cleanly Sign up for a GA account and you'll get a unique UA code. Stick this in the asynchronous code snippet (also provided) and insert it into your code just before the close of the head. Placing it elsewhere usually doesn't cause any problems but it has been known to happen so unless you have a good reason not to, at the end of the head it goes. If you're using WordPress or another popular package there's no shortage of add ons that will place the code automatically. So far, so good. You should be getting basic data in the near future. If you're installing GA, cleaning up a botched install, or moving from the old code snippet to the shiny new asynchronous one, be sure to get rid of the old code. If it's still there you may see symptoms of Common Problem #1: Bounce rates unrealistically low Pageview counts artificially inflated The code snippet has to be on every page, not just the few that really interest you. Otherwise the trail will be broken and fragmented and you'll miss anyone who bounces from an untracked page. Note that we're assuming usage of the asynch snippet here, but you can also use the newer Universal Snippet which is handy for app tracking and other advanced features. However, debugging the universal snippet is not always as easy as it is for the older asynch code, for which a wealth of off Google documentation exists. For very large and complex sites, it's sometimes useful to use a tag manager to install and update tracking, remarketing, and ad platform tags. Google's own Tag Manager has a number of advantages, especially in those cases where a client will be managing their own code in the long
term (it's possible to define events with HTML access for example), or tags from a large number of sources will have to be installed. 2. ecommerce tracking If you want to actually see sales figures on an ecommerce site you'll have to go a little further. GA needs to know what a product is worth. Enable ecommerce tracking under Admin options for the account, and then add the tracking code (https://developers.google.com/analytics/devguides/collection/gajs/gatrackingecommerce) to the cart and checkout. Should your site be on Magento or a similar well supported ecommerce package, all you'll have to do is click a few buttons to install the additional code. Once you've done this and allowed time for a few purchases to be made, check data is flowing properly by looking under Conversions => Ecommerce => Product Performance or Overview. 3. Cross domain tracking A good few sites have external shopping cart software or external booking engines. If so, there is another level of difficulty involved. Let's say the user starts on domain A, finds a product they like, and goes to check out. They'll actually be leaving domain A and going onto domain B (even if they don't realise that). Once the process is finished, they're usually popped back out onto domain A. Because of that session cookie, visitors returning within half an hour will only have one session counted (in theory). But unless both domain A and domain B are sharing cookie information, things are going to get messy. This often leads to Common Problem #2: All my sales are coming from the 'Direct' source Source = Direct could mean the user has a page bookmarked or they've typed in the URL. It could also mean that the visitor isn't being tracked properly or their source info has gotten lost along the way. To fix this, you'll need to set some extra code (https://developers.google.com/analytics/devguides/collection/gajs/gatrackingsite) where visitors are leaving and entering the two domains. The same might apply if you've gotten funky with subdomains or iframes. The easiest way through simple cross domain or subdomain setup is to use the handy
tool at gaconfig.com brought to you by the good people at Raven Tools. 4. Filtering out your own footprints You might want to exclude traffic from your business IP (and/or your client's), especially when traffic is low and it'll have a significant statistical impact. The easiest way to do this is to set up a filter. Go to your Admin tab, then Filters. Add a new one and it'll give you a template to enter your IP address. Very simple. 5. Setting up goals Let's say your ultimate goal to get visitors through to a thank you page at the end of a checkout. Simple enough, but it's also worth defining the steps along the way (the goal funnel). This can provide handy conversion optimisation info if there is a sticking point where lots of people abandon their shopping cart, you need to know about it. Common problem #3: My goal has no data! Although goals don't require code changes (beyond the setup of the events that may define them) it's worth defining your goals early. Unlike Advanced Segments, goals and filters can't be applied retrospectively so you'll only get data from the point you set them up. Nothing will show up straight away. To get started, go to Admin, then the Goals tab. You can either use a page as the finishing line or use a usage metric like time on site. Goals can be verified after setup. This is always a good idea. 6. Tracking clicks out, downloads, and other events With a basic GA install, clicks out to external sites won't be recorded. The same goes for file
downloads and most other events. You'll need to track these explicitly. There are various ways to do it. These days Google recommends the track event method (https://developers.google.com/analytics/devguides/collection/gajs/eventtrackerguide). An older (and pleasingly simple) alternative is to generate a dummy pageview as below: <a href="/downloads/exampledoc.pdf" target="_blank" onclick= _gaq.push(['_trackpageview', '/downloads/exampledoc.pdf']); >Download Example</a> But this is no longer recommended best to use the new method unless there is a pressing reason not to. Consider setting up the following as events if they apply to your new site: Signup or registration Add an item to shopping cart Download a brochure Complete a contact form Open a contact form (the discrepancy between this and the previous one can be very informative) Click out to an affiliate Watch a video Log in Take care when naming events. It should be clear where the action was, and what happened. You can check your event data in Behaviour => Events after setup. 7. Fun with social media Clicks out to social hubs can be tracked as events. This is the simplest way to go but if your client is really interested in social media it's possible to go further. Take a look at the Acquisitions => Social section. This provides heaps of very useful data that can help quantify the real value of social media, but you will have to get some extra tracking (https://developers.google.com/analytics/devguides/collection/gajs/gatrackingsocial) in place.
Except for Google + and other Google properties. That's set up as standard. 8. Custom variables Google Analytics does allow an additional cookie to be set for the creation of a custom variable. This is commonly used to distinguish users with a paid account from those with free access to a particular service. The cookie is associated with a page only paid users see, and from that point the user is persistently identified with that characteristic. To get that cookie set, you'll have to add a line of code to the page in question, using the _setcustomvar method (https://developers.google.com/analytics/devguides/collection/gajs/gatrackingcustomvariables and the excellent Lunametrics post '20 ways to use custom variables' (http://www.lunametrics.com/blog/2012/08/28/20 ways use custom variables/). 9. Linking accounts Letting GA talk to other Google services is also a good idea. The two you most want to link with Google Analytics are AdWords (if relevant) and Webmaster Tools. Linking with AdWords lets you see paid keyword, cost, and CTR data within Google Analytics, where detailed analysis is much easier, and linking with WMT brings in a whole host of potentially useful data on SERP impressions, CTR, and rankings. This is no substitute for your own rank tracking but it can provide some insight. You will need Admin level access to both accounts. For AdWords, start off inside the AdWords interface then go to My Account => Linked Accounts. You can link AdWords and WMT from there as well, to see organic and paid keyword data side by side. To link WMT and Google Analytics, open up the WMT interface and click Manage Site => Google Analytics property.
10. Dealing with (not provided) keywords As of late September 2013, Google signalled their intent to phase out organic keyword data. This means that the quantity of organic search traffic will still be given but the breakdown will not, for Google searches. It must be noted that Google has a market share in excess of 90% in the UK, so for many this will result in 90 100% of keyword data appearing as (not provided). However, some data can be retained. The easiest way to extract meaningful information from (not provided) data is to replace the hidden keyword with the landing page, from which it is often possible to infer a theme if not a precise keyword. The filter should be set up as follows: It does need to be applied at profile level, but only has to be built once for each account. Use the Add Existing Profile method for subsequent profiles. Note also that this filter will break ecommerce tracking, so for retailers it may be better left off or applied on a secondary profile. As a general rule, all filters should be tested on a new profile first anyway, to prevent loss or corrupted data. Organic keyword data is available through Google Webmaster Tools. Unfortunately, this is more of a snapshot of the recent past and current conditions. WMT does not allow for the long term
collection or comparison of organic keyword data. 11. Internal site search Tracking internal site searches can be really informative. It might highlight navigational problems or simply flag up something users want that isn't currently available on site, for example. To set this up, navigate to the appropriate profile and click Settings. Then you'll need to switch on site search, and specify the query parameter. You can find this by performing an internal search and examining the resulting URL. Making a search for 'searchterm' from the main Cardiff University site takes us to: http://www.cardiff.ac.uk/search/index.html?cx=004497668956212682542%3altvwfafuryg&cof=f ORID%3A9&ie=ISO 8859 1&q=searchterm&optionsRadios=option1&siteurl=www.cardiff.ac.uk %2F&ref=www.google.co.uk%2Furl%3Fsa%3Dt%26rct%3Dj%26q%3D%26esrc%3Ds%26sour ce%3dweb%26cd%3d1%26ved%3d0cdaqfjaa%26url%3dhttp%253a%252f%252fwww.car diff.ac.uk%252f%26ei%3dur5tuo ZI8iY0QWgsYC4Dw%26usg%3DAFQjCNFs9DT_PWCCyJ_ WcmyBB7iOgGLxbw%26sig2%3DHCcha1kS5LHI7MSFyt5viA%26bvm%3Dbv.53537100%2Cd. d2k&ss=2203j953981j10 There's the search term in purple, and the query term in red. This may vary from site to site. If you want to go a little further, you can set up search categories too. To view internal site search queries, go to Behaviour => Site Search => Overview.
12. Cleaning up default URL data If you've got / and /index.html with the same content, both will appear in Google Analytics page reports. This is a common setup issue and one that is easily solved. Select the appropriate profile from the Admin menu and then View Settings. Find the Default page box as below and enter the desired URL suffix. 13. Summary There is a lot a developer can do to extend and optimise a client's Google Analytics data. After ensuring that the base data is clean and tidy, the process should always start with considering what's really important. What does the site do is it intended to generate sales or leads, to deliver information or drive advertising revenue? What are the key performance indicators that should be measured is it all about revenue or downloads or signups or contacts? Answering those questions will tell you what you need to track, and hopefully the 12 possibilities above will have given you some ideas about how to get that data flowing into your client's GA account.
Web. Apps. Mobile. Social networking. Digital media is changing the world. We can get it working for you too. Can we help promote your business using search engine optimisation and digital marketing? Do you need training or advice on Google Analytics? If so, get in touch here: Contact us: Tel: +44 (0)29 2070 4700 Email: hello@wearecore.co.uk Web: http://wearecore.co.uk Twitter: @weare_core LinkedIn: Core Digital Everything