0
votes

Disclaimer: I was brought on a few weeks ago, and do not know all of the client's decisions for prior development. I was not part of the original site development team. Admittedly I have not had any experience with handling off/on transactions, and this is where I could use your assistance.

Overview: A couple months ago, a client had an offshore developer set up Google Tag Manager. Since then, the client has been seeing a significant difference in Google Analytics metrics and internal metrics. They found that the e-commerce transactions/conversions for Paid Search and Social channels only pick up a small handful of actual transactions, and somewhere in the chain of events a majority of the transactions are not reported to the GA dashboard and are being lost in the ether.

First Glance: The client is running a Drupal 7 site with the GA script hard-coded into the theme. I found this strange since there is a module for GA available and looked to be running on the site at one point, but the module being disabled is likely due to the decision of the offshore dev and their integration of Google Tag Manager.

The code also looked shoddy. GA code was running from inside of the body tags, GTM was right alongside it (it is still currently in the body tag), and there were a lot of other questionable pieces of code. I made some updates and moved the code around where necessary, but the transactions still did not show appropriately within the Google Analytics dashboard.

Checking the GA dashboard, I found that the standard channels were system defined, and it didn't look like anything was done that could show improper results (if you have any advice on checking for modifications that may throw off results within the GA dashboard, I am open to that).

The client also has integrated with a third party shopping cart, and after noticing that cross-domain tracking on the client's site was not properly implemented, I updated the script. The third-party cart does seem to be implemented properly.

Code (current):

GA (identifiers removed, placed in head):

<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', '//www.google-analytics.com/analytics.js', 'ga');

ga('create', 'UA-xxxxx-1', 'auto', {'allowLinker': true});
ga('require', 'linker');
ga('linker:autoLink', ['third-party-shopping-cart-example.com'] );
ga('send', 'pageview');
</script>

GTM (identifiers removed, placed in body):

<noscript>
<iframe src="//www.googletagmanager.com/ns.html?id=GTM-XXXX"
        height="0" width="0" style="display:none;visibility:hidden">       
</iframe>
</noscript>
<script>(function (w, d, s, l, i) {
    w[l] = w[l] || [];
    w[l].push({
        'gtm.start': new Date().getTime(), event: 'gtm.js'
    });
    var f = d.getElementsByTagName(s)[0],
        j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : '';
    j.async = true;
    j.src =
        '//www.googletagmanager.com/gtm.js?id=' + i + dl;
    f.parentNode.insertBefore(j, f);
})(window, document, 'script', 'dataLayer', 'GTM-XXXX');
</script>

Summary: Google Tag Manager was shoddily implemented alongside Google Analytics, and e-commerce transactions for the "Paid Search" and "Social" channels are rarely reporting. If you have any thoughts or solutions for this issue, I am all ears.

Thank you for your time, I really appreciate it.

1
Do the transactions do not show at all, or are they attributed to the wrong channel ? If the latter, is the _ga parameter added to the url when the user changes domains (else a new session starts, campaign info is lost and the transaction is attributed to the referring url) ?Eike Pierstorff
There are transactions on the Paid/Social Channels that do show (very few), however in all honesty I'm not sure I'd be able to know if there are transactions attributed to an incorrect channel. Is there a way to check for that?Demir Oral
@EikePerstorff After taking a look at various 30 day increments through a year or so, it does look like the client's ecommerce metrics shift around right when GTM was implemented. Should the ga parameter look something similar to this (numbers are replaced with '#')? &_ga=#.#######.######.##### Thank you for your time.Demir Oral
@EikePierstorff (Sorry I did not tag you correctly the first time).Demir Oral
Parameter is looking good. Is your client per chance mixing hard coded GA tags with GA tags deployed via GTM and the same property id (UAID) ? Since GTM uses a randomly named trackers this would break the sessions. An easy check would be to set source/medium as secondary dimension and look if transactions are attributed to (self-) referrals.Eike Pierstorff

1 Answers

1
votes

Since you say that the 3rd party domain has no special configuration I refer you to the documentation that says:

This query parameter can then be added to all the URLs that point to the destination domain. To write this to the cookie on the destination domain, you must update all the create commands on the destination domain by setting the allowLinker tracking configuration parameter to true:

I.e. not only do you need to pass the _ga parameter from the domain where the visit starts, you also need to configure the other domain so that it accepts the ga parameter and continues the session. Plus you need to include both domains in the referral exclusion list. And if you expect the user to go back and forth between domains you need to do the full cross domain configuration on both domains.

So you must set the allowLinker field in the GA tag template in GTM, and you should fill the "autolink domains" settings with your domain list (and possibly set "decorate forms" to yes if travel between the domains happens via form submissions).