AdWords is now Google Ads. Our new name reflects the full range of advertising options we offer across Search, Display, YouTube, and more. Learn more

Analytics
1.9K members online now
1.9K members online now
Learn how to set up goals and Ecommerce tracking, verify accuracy of attribution traffic sources, and discuss funnel visualization, Multi-Channel Funnels, the Goal Flow Report, and Enhanced Ecommerce
 
Guide Me
star_border
Reply

Custom Ecommerce/AdWords/Linker Setup - Shopify (Nightmare)

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

As the title suggests, this has been a 2 week nightmare of trying to get Shopify, AdWords, and Analytics to play nicely together for a client that uses domain aliases for their PPC campaigns. I've spoken with Shopify multiple times, lived in forums for hours, and been told "lolsry" by an AdWords rep who offered to put me in touch with Support then promptly fell off the map. 

 

If anyone has any insights they can share, both my client and I would greatly appreciate it.

 

Background

 - Client previously ran their store through a proprietary ecommerce platform and recently migrated to Shopify.

- Their PPC campaigns have always been running on multiple domain aliases setup through CNAME records. DomainA.com, DomainB.com, and DomainC.com all serve the same site. This is not a redirect.

 

Problem

Upon migrating to Shopify, AdWords stopped attributing conversions to the correct campaigns. The campaign manager reported that AdWords was correctly tracking conversions on the aliases, but not the main domain. 

 

Fast forward a bit, and I've discovered a PHP script on the old site that was dynamically generating linker code before inserting the GA script. Since Shopify doesn't allow you to alter the GA init call through the admin panel, I got in touch and confirmed that I could remove GA from the admin panel and manually insert my own GA snippet into both theme.liquid and checkout.liquid (lucky this client is a Plus subscriber, or they'd really have been w/o a paddle here). 

 

I replicated their old linker code in JS and manually included the following in the two theme files:

<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

  var currHost = window.location.host;
  var linkList = [];
  switch(currHost) {
    case 'www.domainD.com':
        linkList.push('www.domainA.com','www.domainB.com','www.domainC.com');
        break;
    
    case 'www.domainA.com':
        linkList.push('www.domainD.com','www.domainB.com','www.domainC.com');
        break;
    
    case 'www.domainB.com':
        linkList.push('www.domainA.com','www.domainC.com','www.domainD.com');
        break;

    case 'www.domainC.com':
        linkList.push('www.domainA.com','www.domainB.com','www.domainD.com',);
        break;
  }

  ga('create', 'UA-CODEHERE-1', 'auto', {'allowLinker': true});
  ga('require', 'linker');
  ga('require', 'displayfeatures');
  ga('linker:autoLink', linkList );
  ga('send', 'pageview');
</script>

This seems to be correctly tracking source/medium on Sessions, but Ecommerce is no longer being tracked in GA. I assume that's because when a Shopify user opts to track ecommerce via their admin panel, Shopify inserts the ecommerce plugin and subsequent calls wherever necessary in the template. I've asked for confirmation. 

 

In addition to this frustration, AdWords isn't collecting any transaction values. One is definitely being sent in the AdWords conversion script call (confirmed by checking query params on the successful call), but nothing comes through. 

 

Again, if anyone has ANY insights, please let me know.