How to set up Google Analytics to allow keyword cleaning and referring domain analysis

Avatar

Paul C


Technical SEO

Introduction

This document outlines the method used to set up Google Analytics so that you can analyse the search phrase and domain that traffic has come through while your account is linked to Google Adwords using auto tagging. Currently using auto-tagging hides the actual search phrase and referrer domain behind the SE keyword and the source ‘Google’.

It involves setting up a separate profile that filters the same data to display it slightly differently. I strongly recommend leaving the main profile untouched as applying filters may permanently adjust the information in the profile and you will not be able to get this back. It is always a good idea to have the main profile as an unfiltered ‘control’ profile.

Steps Overview

  1. Set up a profile to track the search phrase in the user defined field
  2. Set up a profile to track the referrer domain in the user defined field and referrer URL in the content field.
  3. Remove all manual tagging from Google campaigns (GKW, utm_xxx)
  4. Ensure analytics and adwords accounts are linked
  5. Ensure analytics imports cost data
  6. Turn on auto tagging
  7. Audit and verify it is working correctly

1. Set up a profile to track the search phrase in the user defined field

Within Google Analytics there is a manually set ‘User Defined’ field that you can segment and view sets of traffic on. This allows you to view a parameter that you set in the same manner as you can view the top keyword or campaign reports. To do this in separate profile follows the following steps.
Add a website profile using the same domain.

Add a filter to the new profile as follows from the profile settings page.

Add a filter to the new profile as follows from the profile settings page.

The referral field above holds the value: (?|&)(q|p|query|kw|searchfor|wd)=([^&]*)

This filter is effectively stripping out the keyword where the referrer URL contains a parameter called ‘q’ or ‘p’ or ‘query’ or ‘kw’ or ‘searchfor’ or ‘wd’. Each search engine has it’s own parameter although ‘q’ is the most popular. If you discover a search partner that uses a different parameter other than those above then you can add it to the settings above.

This profile should now start to collect information but will not have access to old data.

You can view adwords and normal campaign traffic correctly in the regular screens and then drill down into the actual search phrase.

OR view the search phrases directly in the Visitors>User-Defined Menu.

2. Set up a profile to track the referrer domain in the user defined field and referrer URL in the content field

Repeat all the steps above to set up another profile. The only difference is the filters that should be set. Set the following filters:

1. Filter to put the referrer domain in the User-Defined field.

The referral field above contains the following text (so you can paste in): (//)([^/]*)

2. Filter to put the actual referrer URL in the content field. (this will overwrite the content value that auto tagging puts in to give you access to the actual web page that referred the traffic.

3. Remove all manual tagging from Google campaigns (GKW, utm)

When auto tagging is switched on it will cause problems if you also manually tag your URLs. For all adwords traffic only you should therefore remove all of the utm_ and GKW parameters from all of you destination URLs. This will also make setting up campaigns a lot easier.

Please note that for non Google campaigns you should still manually tag the utm_ parameters. I would recommend that you also tag the utm_term parameter with the actual search engine keyword so you can analyse the SE keyword in the ‘Keyword’ reports and actual search phrase in the ‘user defined’ reports consistently across all search engines. In yahoo this involves adding ‘utm_term={OVKEY}’ and in MSN this involves adding ‘utm_term={keyword}’

4. Ensure analytics and adwords accounts are linked

An analytics account is linked to an adwords account if you can access it via the ‘Analytics’ tab of the adwords interface. If you can not access it via this route then you need to link it by following these instructions https://support.google.com/google-ads/#topic=10286612

Warning – it is quite common to find an Adwords account that is linked to an old and obsolete analytics account (usually created out of curiosity by someone who never set it up properly and then forgot about it). If this is the case then you need to email or phone Google with the analytics and AdWords account ids so they can unlink them before you re-link the correct analytics profile.

5. Ensure analytics imports cost data

In the profile settings of the analytics account ensure the ‘Import cost data’ option is checked. This will allow you to see AdWords click and cost data in analytics against that profile. Please note that you will only see this option if you are accessing the analytics account via through the AdWords interface and not through the stand-alone analytics interface.
More info here. https://support.google.com/analytics/answer/1033961?hl=en&visit_id=637940019325131254-2943581705&rd=1#zippy=%2Cin-this-article

6. Turn on Auto Tagging

In Adwords ensure that auto tagging is switched on. You can change this setting in Adwords>MyAccount>Account Preferences.

7. Audit and verify it is working correctly

On the following day ensure that the stats in the account are as expected. These checks should include the following:

  • Check that the number of visits etc matched the main profile. The visitor’s data should be exactly the same on the new profiles as only the underlying fields have changed.
  • Check that the goals are tracking correctly as in the other profile.
  • Ensure that the adwords data is being pulled through correctly

Possible Issues

Some of the user defined fields are showing as (not set) The analytics software can only place data in the various fields if it has access to the referrer URL. This is the last page that someone visited and clicked a link/ad to your site. It is possible that the web server that holds the previous website visited is set up to block this information being passed and so Google would be unable to use this data. If this is the case it is always worth being suspicious of fraudulent search partners as they would not want you seeing where a load of bad traffic was coming from.

Further Reading & Help

Google Analytics Help Home:
https://support.google.com/analytics/#topic=10737980

Google Analytics Filters:
https://support.google.com/analytics/answer/1034823?hl=en#zippy=%2Cin-this-article
https://support.google.com/analytics/answer/10104470?hl=en

Google Analytics Tagging Links
https://support.google.com/analytics/answer/1033867

The Google documentation is quite poor when it comes to the more advanced things like filters. I found the following blog very helpful. You can search by category on the right for your chosen topic. https://www.bounteous.com/ . It’s also got some other good stuff in there.

If you would like to find out more about us or our clients, please contact us.