What am I going to get from this guide?
- trust the data you are gathering
- setup Google Analytics (GA) according to Best Practices
- identify typical mistakes of a faulty GA installation
- understand the underlying principles of setting up Google Analytics correctly
What is the target audience?
- Web Professionals who set up Google Analytics Accounts often
- Web Designers, Web Agencies, Web Developers, Internet Marketers
Introduction
What is web analytics?
Web Analytics is the measurement, collection, analysis, and reporting of internet data for purposes of understanding and optimizing web usage.
A dimension is a characteristic of an object that can be given different values → a dimension describes data
A metric is an individual element of a size which can be measured as a
sum or ratio → a metric measures data
Why installing GA correctly is essential?
You probably think you can install GA just by slapping the code on and it will all work.
Well, Google Analytics is really about installing it correctly and measuring the right data, and there are a lot of things you can do wrong.
And it’s really important to install it correctly because Google Analytics is not retroactive. You can’t go back and change it and then go back into the data that you have already gathered and see the results that you just implemented.
The configuration is not retroactive which means you can’t go back and apply your changes to the data set that has already been recorded.
That’s why is important to set it up correctly once and don’t go back.
Same thing with cleaning the data. We don’t have access to the raw data within Google Analytics. We need to measure it correctly at the beginning to make sure the right data is going in GA so we can analyze it and get the right insights out of it. So data cleaning is not possible.
In web analytics is all about trust. Many companies who have web analytics installed don’t trust the data. Now, trust is all about making the right decisions from the data you have. If you don’t have the right databases and you don’t trust the data coming in then you’re not very confident in making any data-driven decisions.
Google Analytics Account and Best Practices
1. Structure
Accounts:
- Limit: 100 accounts per Login
- Central Management
- (Company)
Properties:
- Limit: 50 per account
- Different Tracking Code
- (Websites)
Views:
- Limit: 50 per account
- Perspective on Data: Config & Filter
- (Views)
2. Installation
Here is a simple setup guide that will help you out. It covers the basics.
Simplest of the steps here is to sign up! Head over to Google Analytics.
At this point either sign in with your existing Google account (Have you signed up for Google Apps for Business, perhaps? or do you currently use Google Adwords, YouTube?) or click ‘Create an Account’ in the upper right.
Once you’ve signed up for a new account (if you need it), come back to Google Analytics and click “Access Google Analytics” if you’re not already redirected to the setup screen.
Once you’ve signed up, you’ll come to the setup screen:
(after some scrolling…)
For the purposes of this post, we are only setting up Google Analytics for Websites. Should you be interested in setting up Google Analytics for your app instead, I’ll direct you to Google’s guidelines on the subject.
For Website Name, you can just use your URL if you wish.
For Website URL — just type in your website address! Only as Google tells you — https://www.yourwebsiteaddress.com (they’ve already taken care of the https://).
Industry — this one is optional but will let Google Analytics tailor some suggestions for your account for you. I’ve found most of these don’t apply to the clients I most often work with — if you’re having trouble picking one, I recommend “Online Communities.”
Pick your time zone. This is key for making sure the way Google Analytics counts days lines up with your own business day.
For Account Name — feel free to use your company name. You can have/monitor multiple websites in one Analytics Account, so make sure this name will be appropriate if you plan on adding multiple websites.
Data Sharing Settings — completely optional. Select and deselect as you feel comfortable.
Click the blue Get Tracking ID button, agree to the pop-up Terms of Service (after reading fully of course) and you’re all set!
This part can SEEM a little intimidating (I know it’s easy to go deer-in-headlights when anyone starts typing code-like characters) but I PROMISE it’s actually really simple.
If you’re using WordPress to manage your site, just install the Google Analytics for WordPress Plugin and under Settings, manually enter your UA code (just copy and paste everything after “Tracking ID” from your Google Analytics screen).
If you’re NOT using WordPress, installing the code is still pretty easy:
- Copy the code Google displays for you (it includes your unique UA code).
- Paste EXACTLY THAT before the ending head tag in your HTML code.QUICK TIP: Just do a search within the system to find this tag — “Ctrl+F” on a PC or “Command+F” on a Mac. In the Find box, type “</head>” (minus quotes)
- Save. As Google says, Most websites re-use one file for common content, so it’s likely that you won’t have to place the code snippet on every single page of your website.
- And Done! Wait for Google to recognize the installed code (can take a few hours to one day). When everything is installed correctly — the phrase “Status: Receiving Data” will appear next to “Tracking ID.”
Your Google Analytics account is actually now set up and will start tracking data in the next 24 hours — this last step is just a bonus recommendation. By default, the address you signed up for is an admin user for Google Analytics (you have access to do everything in the account). I recommend setting up a second admin user with an unrelated Gmail address (free to sign up).
Why? Because as you may have experienced, Google is excellent with help forums but not so great at one-on-one customer service. You can’t really call anyone at Google if you lose access to your Analytics email account or something else goes funky. The data won’t be lost but you won’t be able to log in and see it [googling “can’t access google analytics” will show you how many people have had this dreaded problem]. Having a second unrelated email address signed up with your account means having a backup plan.
You can actually add users either at the Account level or Property level in Google Analytics. For our purposes, we’ll add someone at the account level.
So here’s how (super easy):
- When signed into Google Analytics, click Admin at the top of your screen.
- Select User Management under the left-hand Account menu.
- In the “Add permission for:” field, fill out the email address (remember an unrelated Gmail address works)
- Check all boxes under the drop-down menu to the right. This mostly makes the second user an administrative user with full access.
- Check ‘notify this user by email.’
- Click the Add button.
- Log out of Analytics and try logging in with your second-user address. Did it work? Great! You’re done. If not — log in with your first account info again and make sure the email address was entered correctly.
And done! You now have a Google Analytics Account set up and backup administrative access in place.
Google Analytics Best Practices
1. Be sure your code is set up correctly. Especially with e-commerce site, this is something that can be easily overlooked. You want to track every SKU and the revenues that each visit/referral is bringing you. Since the data you get from GA are not retroactive, make sure everything is ok
2. Create goals and funnels to measure the efficiency of every step of your conversion path. Google Analytics is not that flexible on creating and measuring the conversion funnel though. You might want to try a tool such as Kissmetrics
3. Do not focus on overrated mainstream metrics such as visits and pageviews. Focus on data that brings concrete benefits to your bottom line ($$$). Increasing your traffic by 30% and having an equivalent increase of your bounce rate, for example, gives you 0 benefits. Always ask yourself how much money/value am I getting from this visit/user and how can I increase it?
4- Segment like crazy. Average metrics and KPIs are almost useless. Segment your data by traffic sources and user behavior
5. Always look for actionable data. You can easily get lost in the noise and quantity of data. Always ask yourself if the data you are collecting can drive action. If not, don’t focus on it
What are some of the best practices for data cleaning?
Miscellaneous tips:
- Sort the data by different attributes. Negative numbers, strings that start with obscure symbols, and other outliers will often appear at the top of your dataset after a sort.
- Look at summary statistics (mean, standard deviation, number of missing values, etc.) for each column. These can be used to quickly zero in on the most common problems.
- Keep track of every cleaning operation you do so that you can modify, repeat, or remove services as necessary. Ideally, use a tool that keeps track of your actions.
- For large, messy datasets, reaching 100% cleanliness is next to impossible. Make sure you have realistic goals set as you’re starting to work on a problem. Otherwise you’ll be fighting Parkinson’s law. If you have a list of cleanliness issues, sort them by estimated frequency and attack the most common problems until your dataset is good enough.
- For large datasets, do most of your work on a small, random sample. Working with fewer data will improve your iteration speed. Eventually, once you’ve cleaned the small sample, replay your cleaning steps on the entire dataset.
- You can also use sampling to test data quality. For example, the acceptance test for your dataset could be something like, “If you pick 250 random rows, no more than 5 of them should have formatting issues.”
- Tools like OpenRefine (formerly Google Refine) can save you a lot of time by performing a lot of simple cleanings (e.g., string canonicalizations) with very little user input.
- Become an expert at using regular expressions.
- Create a set of utility functions/scripts/tools to handle everyday cleaning tasks. These might include: regex search-and-replace, remapping values based on a SQL database or CSV file, blanking out all values that don’t match a regex or an allowed list of values, deleting rows that do/don’t match some filter, and so on. If you find yourself repeating several steps over and over, write a script to handle all of the steps at once.
[Fun Trivia] Does Google Analytics have a data collection limit?
There are many GA properties with hits considerably > 10M. If your website has tens of millions of hits, Google will currently just warn you with:
“Your data volume (xM hits) exceeds the limit of 10M hits per month as outlined in our Terms of Service. If you continue to exceed the limit, you may lose access to future data.”
Though there is no account to lose access to data. On the other hand, Google’s account managers might contact you to pitch the Analytics 360:
“If you go over this limit, the Google Analytics team might contact you and ask you upgrade to Analytics 360 or implement client sampling to reduce the amount of data being sent to Google Analytics.” (source)
Read this Lunametrics’ article for more information regarding the 10M hit limit.
On the other hand, if your visitor generates more than 500 hits per session the data collection really stops for that session.
A good overview of all the GA limits by Brian Clifton: Google Analytics Limits — a reference guide.
Analytics Audit
source: https://northcutt.com/wr/google-analytics-audit-checklist/
1.What analytics tools are installed?
First, let’s get an understanding of what tools are already installed.
Don’t just take someone’s word.
Usually, you’ll find tools that were once tried and later forgotten. This slows down sites and leads to conflicts.
2. What has BuiltWith found?
Document any analytics shown in BuiltWith to the right.
3. What scripts are in the source code?
- Go to your homepage.
- Right click > View Source
- CTRL+F and search for .js
Itemize the names of script files that you see. Note any libraries that don’t serve a clear purpose as issues to the right. Learning the purpose of each library may require a developer.
It’s best practice to leave a comment beside each script file describing its purpose.
4. Were there unused scripts/tools?
Remove all unused tools/scripts identified using the methods above.
5. Is Google Analytics configured?
In the next section, we’ll set Google Analytics’ native features.
Create a free Google Analytics account if none exists.
6. Is there a designated, non-contaminated View?
There are two ways to slice up Analytics data: Advanced Segments and Views. Advanced Segments are temporary and apply to the past. Views are permanent and only apply to the future.
Always have one default View containing only raw data, titled something like All Data.
To create a View:
- Navigate to the Admin link at the top of Analytics page.
- Then, in the Views column (right), click Filters.
7. Is the tracking code in the site header?
This gives better data vs. the site footer.
View Source on a page that has the tracking code and verify that it appears in the HEAD section, just before </head>. You can find the code using CTRL+Fand searching for analytics.js.
Because this code is asynchronous, it shouldn’t slow anything down.
If there’s no code yet, we’ll show you where to get it in the next step.
8. Is the tracking code 100% correct?
To get the current tracking code from Google Analytics:
- Choose Admin on Google Analytics’ top menu.
- Go to: Property > Tracking Info > Tracking Code
Then, in a new browser tab:
- Visit any page of the site, right-click, and View Source.
- CTRL+F for analytics.js
- Compare this to the correct code in the other tab.
The format should exactly match, with exception to a handful of extra lines being OK. We’ll address that topic later in the audit.
9. Is the tracking code on every page?
Set Screaming Frog, or another crawler like SEO PowerSuite or Linkdex, to verify this site-wide.
10. Screaming Frog instructions:
- Go to Configuration > Spider.
- Set to “ignore robots.txt”
- Go to Configuration > Custom > Search
- Set to “Does Not Contain”
- Paste in your Universal Analytics ID from Google Analytics (ex. UA-25483095). It can be found in parenthesis next to your domain name on the GA homepage, or the drop-down in the top-left corner.
Don’t run it yet. We’ll tackle the next four checks with a single crawl.
11. Is Google Tag Manager causing issues?
Google Tag Manager is an acceptable alternative to directly adding the code. But if it is used, make sure the analytics code isn’t added twice (such as once in the code directly, once in Tag Manager).
Configure Screaming Frog:
- Go to Configuration > Custom > Search
- Enter: “Do Not Contain” and “google tag manager”
If found, check Google Tag Manager to verify what is added (correct code, not duplicate).
12. Is the site free of legacy (Classic Analytics) code?
Configure Screaming Frog:
- Go to Configuration > Custom > Search
- Enter “Contains” and each of these values:
ga.js _trackEvent _addItem _addTrans _trackTrans _gaq. _ga.
Zero results will confirm that the site has 100% upgraded to Universal Analytics.
Classic Analytics is obsolete. If found, a developer will need to upgrade.
13. Are there Campaign URLs on internal links?
Configure Screaming Frog:
- Configuration > Custom > Search — “Contain” and “utm_source”
Links with “utm_source” in them are used for Google Analytics Campaigns. These are for linking to external websites only.
Using Campaign Tags internally can confuse (internal) Behavior reports with (external) Acquisition reports.
So, if you find this, get rid of it. Campaign Tags on external links are fine.
14. Is there invalid JavaScript?
Open the JavaScript debug console.
In Chrome, it’s under View > Developer > JavaScript Console
Now refresh the page and note any red error messages. Any errors can break all JavaScript (like Google Analytics). Google Analytics Debugger is useful if the errors are from Google Analytics.
15. Are time zone and bot blocking set?
In Google Analytics:
- Navigate to Admin (top)
- Under View (right) — click View Settings
- Set the correct time zone.
- Enable bot filtering. It won’t block all junk traffic, but it helps.
Don’t hit save yet. There’s one more step (next).
16. Should Site Search tracking be used?
On the same screen as the last step, consider enabling Site Search reporting.
Do this only if the site has an internal search tool. Look in the site header, footer, the blog, and at any eCommerce tools for a search feature.
If you find one, enable Site Search.
Then, set the query parameters. These appear in the URL after you search.
For example, when you search Google it looks like:
https://google.com?q=yoursearch
In this situation, the query parameter would be just the letter q.
17. Have you filtered out yourself and others?
You’re not the market you want to track. For starters, you probably surf weird, like refreshing a page 500 times a day. Fix this:
- Navigate to Admin (top) in Google Analytics.
- Under a custom View (right column), select Filters.
- Click “Add Filter.” Remember: don’t compromise your “Raw Data” View.
- Use the options: “Pre-defined,” “Exclude,” “traffic from the IP address,” “equal to.”
- Find your IP address here, enter it, and click “Save.”
Also, consider this for the company’s office and any developers.
18. Are you excluding self-referrals?
Referrals to your site, from your site, seem to be an issue that would be obvious. But it’s a common problem. You can partially fix it by:
- Navigate to Admin (top)
- Navigate to Property (middle) > Tracking Info > Referral Exclusion List.
- Add your own domain, as well as any subdomains (i.e. northcutt.com, www.northcutt.com, userarea.northcutt.com, blog.northcutt.com).
- If there are international versions of the site (i.e. site.co.uk, site.net.au), add those too
19. reports include full hostnames?
If your site has more than one subdomain (i.e. something.site.com), or multiple domains (i.e. site.co.uk and site.com.au), you’ll want full hostnames to appear in your reports.
If you don’t do this, all pages look like “/page.html” instead of “section.site.com/page.html,” and you won’t be able to tell hostnames apart. This is useful practice regardless: you can’t predict the future.
Do this by adding a View Filter that looks just like like this. More on this topic.
20. Is cross-domain tracking needed?
Does this single site stretch across multiple domains? This is especially relevant with internationalization, where various ccTLDs are used (i.e. site.co.uk, site.net.au).
If so, a few code modifications are necessary for addition to the Hostname in Reports and Referral Exclusion instructions above. Full instructions.
21. Is attribution optimized?
Google Analytics does some amazing things by default.
It won’t show sales, leads, prospects, or other key metrics until we make it.
Next steps focus on that.
22. Are annotations used?
These should track major events concerning the site, audience, and marketing channels.
Create and view annotations under the timeline graphs.
Timeline graphs appear directly under any default report in Google Analytics. For example, under Audience > Overview.
23. Are goals used in all forms?
Are there contact forms, download forms, or other non-monetary actions?
Each needs Google Analytics Goals. Use Events if each does not have its own submission URL.
Have a lot of events and need to troubleshoot? Try the Event Tracking Tracker.
24. Is ECommerce Tracking configured?
If any transactions are made over the web, Google Analytics will be more useful with ECommerce tracking.
Activate E-commerce Tracking on the left menu under Conversions > Ecommerce > Overview.
25. Is ECommerce Tracking code setup right?
ECommerce Tracking requires a code adjustment.
Most ordering/billing systems have a simple setting for this that doesn’t require code changes.
If you’re using a 3rd party integration, repeat the check above that checks for “Classic Analytics” to make sure this was done right. Documentation.
26. Do some actions lack their own URLs?
Browse the site: can you find essential actions that don’t render unique browser URLs?
Examples:
- Playing a video
- Clicking a slideshow
- Navigating “tabs”
Track these by inventing a fake URL for the purpose of Analytics, called a Virtual Pageview.
27. Do newsletter emails use Campaign URLs?
E-mail marketing is rarely tracked correctly. Each email requires Google Analytics Campaign URLs.
To use Campaign tracking, add variables to all URLs that you use to link to your site using the URL Builder.
?utm_source=newsletter&utm_medium=email&utm_content=copyexperiment1&utm_campaign=monthly_unqualified
Otherwise, E-mail traffic will show as “Direct” in Google Analytics
28. Are Campaign URLs used for account emails?
Add Campaign URLs to automated account e-mail templates (invoices, support tickets, reminders, etc.).
Suggested Campaign URL string to add to all links:
?utm_source=accountcenter&utm_medium=email&utm_content=copyexperiment1&utm_campaign=goldtierclients
29. Are Campaign URLs used on social media?
Social media will usually show as “Direct” without Campaign URLs too.
Look at the brand’s posts. Do you see links without “utm_source” in them? Campaign URLs should be added to both:
- Documented in the brand’s social media guidelines.
- Configured with the social media management software or URL shortener.
Suggested Campaign URL string:
?utm_source=twitter&utm_medium=social&utm_content=postmixstrategy1&utm_campaign=dailysocialcontent
30. Is Campaign tracking used with AdWords?
AdWords has a closer integration with Analytics with “auto-tagging.” Instead of “utm” campaign tags, AdWords will add a “gclid” variable — short for “Google click ID.”
By default, that’s turned off.
31. Is AdWords linked to Analytics?
If AdWords is used, link it to Google Analytics.
This makes AdWords data available to Custom Reports, Dashboards, and Segments.
To do an AdWords + Analytics integration, navigate to Acquisition > AdWords > Campaigns in Analytics.
Then follow the instructions.