Setup Cross-Domain tracking with Google Analytics

Brushfire event tracking helps you track Google Analytics traffic to and from Brushfire in a few simple steps. First, you'll need to set up your events to include your unique Google tracking ID and domain name. Second, you'll modify the Google Analytics tracking code on your own site. Third, you'll set up reporting filters, and Last, you'll add brushfire.com to your referral exclusions list.

 

Setting up Google Analytics for your event

On your event dashboard for each event you'd like to connect, navigate to the tracking tab. In the Google Analytics section below, add a row for each Google Analytics property you'd like to track, with the first column set to the Google tracking ID and the second set to the domain of your website you use for that tracking ID.

Screen_Shot_2018-10-16_at_4.27.44_PM.png

 

Once you've added all the tracking codes and domains you need, be sure to save the tracking settings at the bottom of the page.

That's it on the Brushfire side of things! If you're interested in setting up Ecommerce Tracking, you can learn more here.

 

Setting up Google Analytics on your site

On your own website there are two different ways to modify your Google Analytics settings to make sure your Brushfire traffic gets logged correctly. If you use Google Tag Manager, you'll need to follow these instructions (if not, skip below):  

  1. In Tag Manager, open your Google Analytics Settings variable or Universal Analytics tag for editing.
    • To find your Google Analytics Settings variable, click Variables and then click the appropriate variable in the list.
    • To find your Universal Analytics tag, click Tags and then select the appropriate tag in the list.
  2. Navigate to More Settings > Cross Domain Tracking.
  3. In the Auto Link Domains field, enter "brushfire.com".
  4. To receive incoming links from other domains, navigate to More Settings > Fields to Set and add a field with a Field Name of allowLinker and a Value of true.
  5. Save your changes and publish the container.

 

If you do not use Google's Tag Manager you'll need to modify the code on your website, as follows:

  1. Find all instances in your code where you create a Google Analytics object. They'll look something like this:
    ga('create', 'UA-XXXXXXX-Y', 'example-1.com');
  2. Make the following changes to the code (the changes you need to make are in bold red text):

    ga('create', 'UA-XXXXXXX-Y', 'auto', {'allowLinker': true});
    ga('require', 'linker');
    ga('linker:autoLink', ['brushfire.com']);

Setting up Reporting Filters

Now that you've set up the tracking on Brushfire and your own site we need to make sure Google Analytics reports everything in a nice readable way.  By default Google Analytics reports don't include the domain name for page views, so we need to add filters so it's easy to distinguish between Brushfire traffic and your own website traffic.

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 and add an advanced filter to that new view. The filter will tell 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 --> Extract A: Hostname = (.*)
  • Field B --> Extract B: Request URI = (.*)
  • Output To --> Constructor: Request URI = $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.

 

Add Domains to your Referrals Exclusions list

When a user journey crosses from your first domain to your second domain, Analytics interprets that as the user having been referred by your first domain to your second domain, and Analytics creates a new session. 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:

  1. In Google Analytics, click Admin
  2. In the ACCOUNT column, use the dropdown to select the Analytics account that contains the property you want to work with
  3. In the PROPERTY column, use the dropdown to select a property
  4. Click Tracking Info
  5. Click Referral Exclusion List
  6. To add a domain, click +ADD REFERRAL EXCLUSION
  7. Enter "brushfire.com"
  8. Click Create to save

 

Testing your setup

The best way to validate that cross-domain tracking is set up correctly is to use Google Tag Assistant Recordings. When you make a session that crosses domains, it can tell you instantly whether it worked or not.

Here’s an example Tag Assistant Recordings report that shows what it looks like when cross-domain tracking is not setup properly.

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Article is closed for comments.