Jun 01, 2017 38

Google Analytics: How to set-up cross domain tracking with Shopify

1. Sign in to your Shopify admin account 

Click Online Store and then Preferences. Scroll down to the Google Analytics section and click the add custom JavaScript link in the textbox. 

2. Enter the following into the JavaScript field:

ga('linker:autoLink', ['']);

3. Select the 'Enhanced Ecommerce' box. 

Enter this script in the Additional Google Analytics Javascript box:

ga('linker:autoLink', [''] );

4. Give Maker your Tracking ID

Send your Maker representative the 9-digit GA Tracking ID starting with UA shown in the same box.

5. Set up reporting views and add filter

Google Analytics only includes the page path and name, not the domains in their reports. For example, you might see pages appear in the Site Content report like this:




Because the domain names aren’t listed, it might be hard to tell which domain the traffic is coming from.

To get the domain names to appear in your reports you need to: 

  1. Create a copy of your reporting view that includes data from all your domains in it, and 
  2. Add an advanced filter to that new view. The filter will tell Google 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 can select an item from the dropdown menu. For others, you'll need to enter the characters here:

Filter Type: Custom filter > Advanced

Field A: Hostname Extract A: (.*)

Field B: Request URI Extract: (.*)

Output To: Request URI Constructor: $A1$B1

Click Save to create the filter.

You can validate that filters are working as you expect using Google Tag Assistant Recordings, which shows  you exactly how your filters change your traffic.

6. Add Maker as a referral traffic source in your Google Analytics account

Make sure you're still signed-in to your Google Analytics account. Click on the Admin icon again in the menu bar at the bottom of any page.

In the ACCOUNT column, use the dropdown menu to select the account of the site you're linking with Maker.

In the PROPERTY column, use the dropdown to select a property. Once your property is selected, click Tracking Info, then Referral Exclusion List:

To add Maker as a domain, click +ADD REFERRAL EXCLUSION.

Enter Maker's Domain name: and click Create to save:

This referral exclusion list uses contains matching, which means that when you enter as a referral exclusion domain, the traffic from is also excluded (because the domain name contains

7. Test it out

Visit our page, How to test your cross domain tracking, to ensure that your tracking is set-up and working properly.