Simple Steps to Setting up Cross-Domain Tracking

Header-Trianlges-Left
Header-Trianlges-Right

Want a clearer insight into your Google Analytics data?

Need to know the journey your customers take on your website?

If you have multiple websites, then there’s a good chance that cross-domain tracking with be a major asset to your analytics setup.

Ensure that you get the most accurate results possible by setting up Cross Domain Tracking using the Google Tag Manager method – a process we’ll outline step-by-step below.

 

Table of Contents
    Add a header to begin generating the table of contents

    Benefits of Cross-Domain Tracking

    • It can allow you merge multiple sessions which occur under several of your domains – this means that you are able to clearly see the path a prospect has taken, as well as the amount of time that they have spent on your site overall.
    • Without implementing this, you will find that Google Analytics will log user activity as different sessions when they click on certain links. 

    This tutorial is tailored for a certain route of process – if you are:

    • Using redirects between domains 
    • Using code that is removing URL parameters 
    • Using iframes 

    Then this blog may not be suitable for you. 

    If you are planning on using this blog as a guide, then it is important to be aware that has been written based on the assumption that you have set up both domains with the same Google Analytics property. 

     

    Cross-domain Tracking

      1. Sign into: http://tagmanager.google.com
      2. Choose the container used on your website 
        1. If you are not using the same container for both domains, then you will need to repeat these steps for each individual container. 
      3. Select “Variables” and then click “New” – you will now need to rename the variable.
      4. Now select “Choose a variable type to begin set-up…”, you will now need to click “Constant”
      5. You need to type the domains you want to link – ensure you separate them using commas. 
        1. If you are looking to implement cross-domain tracking for all of your website domains as well as subdomains, then you only have to enter your main domain. 
        2. If you only want to use cross-domain tracking on a select amount of subdomains, then you need to enter the subdomains.
      6. Now click “Save”
      7. Click your Google Analytics settings variable: 
        1. In the event that you are unable to find the variable, you will need to make sure that you are actually using it, if not, then you will need to if you intend to follow this blog’s steps correctly. 
      8. Select “More Settings” and then “Cross Domain Tracking” – when you see the “Auto Link Domains” field, make sure to click the “+” icon – you can now choose the variable you have created.
      9. “Decorate Forms” field – needs to be set to “True” 
      10. Under the “More Settings” category, make sure to select “Fields to Set” – you now need to “Add Field”.
        • Alter your settings to look like this:
          • Field Name: “allowLinker”
          • Value: “true”
      1. In the top right corner, you will see “Save” – click it.
      2. When you are happy with your GTM dashboard, ensure that you click “Submit” 
      3. When the “Submission Configuration” panel appears, there is the option to add a name and description – once done, click “Publish”. 
      4. You will now be able to see an overview of the changes that you have made. 

     

    Referral Exclusion List – New Domain 

    Open Google Analytics – you will need to enter your account settings, you can do this by clicking “Admin” (it will be in the sidebar). 

    Once you’ve selected the account and property that you want to use, you will need to click “Tracking Info” and then “Referral Exclusion List”. 

    The root domain should be visible on the list, if it is, then select “+Add Referral Exclusion” and type in the new domain. 

    Once you’ve clicked “Create”, you will now be able to see the other domain – it will be visible in the Referral Exclusion list.

     

    Cross-domain Tracking – Analysing Efficiency

    1. Start on your website (you will need to be using Chrome) – you will then need to go to one of your pages in your first domain where you have a link directing the user to your second domain.
    2. You will now need to click the Google Tag Assistant Chrome extension and then select “Record”, before refreshing the page. 
    3. Now you need to select a link that points to the second domain.
      • It is important to make sure that the link you have selected opens in the same tab – this is so that the Google Tag Assistant records the entire session. 
      • If everything is working correctly, you will see a “_ga” parameter added onto the URL.
    4. After the page has loaded, you need to click on the Google Tag Assistant Chrome extension, before selecting “Stop Recording” and then “Show Full Report”. 
    5. Click on “Google Analytics Report” and then choose which view you want to test, then select “Ok.”
    6. You will now need to click the “Alerts” section – you have to ensure you don’t see a Cross-Domain implementation alert.
      • This message is likely to appear due to incorrect tracking code being utilised.
    7. Scroll down until you find the “Flow” section, you should be able to see a minimum of 2-page loads. If you select “Page load 1” then you should see your first domain URL, in the same way, if you select “Page load 2” then you should see the second domain URL.
    8. You have now successfully completed this section of the tutorial – if you have done everything correctly, then data will be collected from the selected domains. 

     

    Including Your Subdomain Data

    This isn’t a direct part of the tutorial, you don’t have to do it, and depending on your Google Analytics setup, it may have an effect on configurations that you currently have in place (i.e. goals and custom reports). 

    If you do want to do this, then you will be adding a hostname filter, which will then allow you to include your subdomain information. 

    1. Access your Google Analytics account 
    2. First of all, you need to see if you already have a filter in place: 
      • Look under filters

    OR

      • Check under the “Behaviour” section 
        1. You then need to select “Site Content”
        2. Click “All Pages”
    1. The page path will be visible in reports if you have a standard set-up in place. 

     

    And… you’re done! 

    You have now successfully carried out cross-domain tracking using GTM. 

    If you found this blog helpful, then make sure to keep an eye out for our next blog post. 

    In the meantime, check us out on social media, so you can keep updated!