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

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';
        (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) {

          var analytics = document.createElement('script');
          var loaded = false;
          var onload = function() {
            if (loaded) return;
            loaded = true;
            window.ShopifyAnalytics.lib =;
              {"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.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;

          "Checkout - Contact information",
          "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;
          analytics.async = true;



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?



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

Participant ✭ ✭ ✭
# 3
Participant ✭ ✭ ✭

It might be related to browser / device.

Can you try to debug on the website with GA debugger with different browsers:

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

Best Regards,

'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.