Analytics
2K members online now
2K 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

Missing nearly 50% of ecommerce transactions (Shopify)

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

We're using Shopify for ecommerce. GA is not recording about 50% of our orders. They say it must be b/c half of our customers have JS and/or cookies disable, but that seems absurd. From what I read, the percent of users who disable JS or cookies is 1 - 3 %, not 50%.

 

I know Shopify has it's own way of coding GA, and I suspect that something in their implementation is causing so many transaction to be missed.

 

Here is their code as it appears on the checkout page of our site. I can also do a test order and grab the code from the confirmation page if that will help.

 

Would appreciate any thoughts from the experts here! 

 

<script type="text/javascript" class="analytics">
        
      window.ShopifyAnalytics = window.ShopifyAnalytics || {};
      window.ShopifyAnalytics.meta = window.ShopifyAnalytics.meta || {};
      window.ShopifyAnalytics.meta.currency = 'USD';
    
        (window.gaDevIds=window.gaDevIds||[]).push('BwiEti');
        
        (function () {
          var customDocumentWrite = function(content) {
            var jquery = null;

            if (window.jQuery) {
              jquery = window.jQuery;
            } else if (window.Checkout && window.Checkout.$) {
              jquery = window.Checkout.$;
            }

            if (jquery) {
              jquery('body').append(content);
            }
          };

          var analytics = document.createElement('script');
          var loaded = false;
          var onload = function() {
            if (loaded) return;
            loaded = true;
            window.ShopifyAnalytics.lib = window.analytics.noConflict();
            window.ShopifyAnalytics.lib.initialize(
              {"Google Analytics":{"trackingId":"UA-4005528-1","domain":"auto","siteSpeedSampleRate":"10","enhancedEcommerce":null,"doubleClick":true,"includeSearch":true},"Performance":{"navigationTimingApiMeasurementsEnabled":true,"navigationTimingApiMeasurementsSampleRate":0.01},"Trekkie":{"appName":"storefront","environment":"production","defaultAttributes":{"shopId":3157737}}}
            );

            window.ShopifyAnalytics.lib.ready(function() {
              
      ga('require', 'linker');
      function addListener(element, type, callback) {
        if (element.addEventListener) {
          element.addEventListener(type, callback);
        }
        else if (element.attachEvent) {
          element.attachEvent('on' + type, callback);
        }
      }
      function decorate(event) {
        event = event || window.event;
        var target = event.target || event.srcElement;
        if (target && (target.getAttribute('action') || target.getAttribute('href'))) {
          ga(function (tracker) {
            var linkerParam = tracker.get('linkerParam');
            document.cookie = '_shopify_ga=' + linkerParam + '; ' + 'path=/';
          });
        }
      }
      addListener(window, 'load', function(){
        for (var i=0; i < document.forms.length; i++) {
          var action = document.forms[i].getAttribute('action');
          if(action && action.indexOf('/cart') >= 0) {
            addListener(document.forms[i], 'submit', decorate);
          }
        }
        for (var i=0; i < document.links.length; i++) {
          var href = document.links[i].getAttribute('href');
          if(href && href.indexOf('/checkout') >= 0) {
            addListener(document.links[i], 'click', decorate);
          }
        }
      });
    

              var originalDocumentWrite = document.write;
              document.write = customDocumentWrite;
              try {  } catch(e) {};
              document.write = originalDocumentWrite;

              
        window.ShopifyAnalytics.lib.page(
          "Checkout - Contact information",
          {"path":"\/checkout\/contact_information","search":"?_ga=1.2661432.927246327.1363711516","url":"https:\/\/checkout.shopify.com\/3157737\/checkouts\/edb9c8376d381d84f24eeac030501df7?_ga=1.2661432.927246327.1363711516"}
        );
      
              
        window.ShopifyAnalytics.lib.track(
          "Started Order",
          {"step":1,"products":[{"category":"Medical Device","sku":"FW101","name":"Fisher Wallace Stimulator® \u003cp\u003eKit Includes Everything You Need to Relieve Symptoms\u003c\/p\u003e \u003cp class=\"red\"\u003e100% Money Back Guarantee\u003c\/p\u003e","price":"699.00","quantity":1,"brand":"FisherWallace","variant":""}],"currency":"USD"}
        );
      
            });
          }
          analytics.onload = onload;
          analytics.onreadystatechange = function() {
            if (!/complete|loaded/.test(analytics.readyState)) return;
            onload();
          }
          analytics.async = true;
          analytics.src="https://cdn.shopify.com/s/javascripts/trekkie.storefront.min.js";
          document.getElementsByTagName('head')[0].appendChild(analytics);
          
        })();
      </script>

 

 

1 Expert replyverified_user

Re: Missing nearly 50% of ecommerce transactions (Shopify)

Follower ✭ ✭ ✭
# 2
Follower ✭ ✭ ✭

@Arthur S

 

If you have 50% transaction - so code I think is good -> you need to send code to developer with documentation.

 

But I have a questions:

- do you have some issue with server or your website speed isn't good?

- where do you have GA code -> in head or bottom of the body?

- maybe this situation include people who paying with PayPal, PayU etc. ? And there is a problem?

 

SH

Re: Missing nearly 50% of ecommerce transactions (Shopify)

A T
Participant ✭ ✭ ✭
# 3
A T
Participant ✭ ✭ ✭
Hi,

It might be related to browser / device.

Can you try to debug on the website with GA debugger with different browsers:
https://chrome.google.com/webstore/detail/jnkmfdileelhofjcijamephohjechhna

You can check in chrome, console tab with 'Preserve log' turned ON.

Best Regards,
A.T.

'Star' or 'Accept as Solution' if it helped.

Missing nearly 50% of ecommerce transactions (Shopify)

Visitor ✭ ✭ ✭
# 4
Visitor ✭ ✭ ✭

Works fine for us, see: EraVape
It might be few things:
- If you have a JS error, it might be breaking GA code so look for JS errors
- Not sure why, but it seems like you provided the Shopify script and not the GA script.
- You should add the GA code in your shopify admin, works like magic.


I would suggest to contact Shopify support to help you out.

Missing nearly 50% of ecommerce transactions (Shopify)

Rising Star
# 5
Rising Star

Suggestion - compare your backend data with your GA data; which transactions are missing? You should be able to compare them by transaction ID. It could be as simple that some of your products contain special characters in their product name, which will break the GA tracking.

John Wedderburn, Advertiser Community, Rising Star
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here.