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

Google Tag Manager and Ecommerce Tracking Not Working

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi There,

 

I've recently been working to implement ecommerce tracking on a hospitality client's booking engine using Tag Manager. I've had a dataLayer created using custom variables defined by the booking engine. I've also set-up Virtual Pageviews for the booking engine checkout process, since the URL does not change as a user progresses.

 

Once the ecommerce dataLayer was added, the Virtual Pageview dataLayer stopped sending data to GA. Additionally, after running multiple test transactions, I'm still not seeing ecommerce data recorded in GA. I've included the section of two dayaLayers from the source code of the order confirmation page below.

 

I'm wondering if they are configured correctly...the ecommerce dataLayer populates in the code, it's just not showing up in GA, so I'm wondering if there is a problem with it being pushed. Any insight or help is greatly appreciated!

 

Thanks,

UpWord

 

DataLayer:

 

<script type="text/javascript">
   dataLayer = [];
    dataLayer.push({
        'transactionId'            : '27328SB013442',
        'transactionTotal'        : 4760.00,
        'transactionTax'        : 480.32,
        'transactionProducts'    : [{
            'sku'        : '27328SB013442 - 7/1/2016',
            'name'        : ‘Client Name’,
            'category'    : 'GV1K'
            'price'        : 595.00,
            'quantity'    : 8
        }]
    });
   dataLayer.push({
      'event':'VirtualPageview',
      'virtualPageURL':'/booking/confirmation',
      'virtualPageTitle':'confirmation'
});
</script>
<!-- Google Tag Manager - desktop - 10/2/2015 -->
<noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-W4ZZHF"
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-W4ZZHF');</script>
<!-- End Google Tag Manager -->

2 Expert replyverified_user

Re: Google Tag Manager and Ecommerce Tracking Not Working

Top Contributor
# 2
Top Contributor
Do you have regular or enhanced e-commerce activated?
VP & Chief Evangelist at Hub'Scan | Contact me
Level 80 Digital Analytics Warrior, KPI Therapist and Keeper of the One True Tagging Plan

Re: Google Tag Manager and Ecommerce Tracking Not Working

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭
I have regular e-commerce activated in GA at the moment.

Re: Google Tag Manager and Ecommerce Tracking Not Working

Top Contributor
# 4
Top Contributor

Hi UpWord,

 

You have a syntax error in your code. A missing "," after the category line in your snippet. The value for "name" is also enclosed in invalid single quotes. Please find the corrected code below:

 

<script type="text/javascript">
   dataLayer = [];
    dataLayer.push({
        'transactionId'            : '27328SB013442',
        'transactionTotal'        : 4760.00,
        'transactionTax'        : 480.32,
        'transactionProducts'    : [{
            'sku'        : '27328SB013442 - 7/1/2016',
            'name'        : 'Client Name',
            'category'    : 'GV1K',
            'price'        : 595.00,
            'quantity'    : 8
        }]
    });
   dataLayer.push({
      'event':'VirtualPageview',
      'virtualPageURL':'/booking/confirmation',
      'virtualPageTitle':'confirmation'
});
</script>
<!-- Google Tag Manager - desktop - 10/2/2015 -->
<noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-W4ZZHF"
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-W4ZZHF');</script>
<!-- End Google Tag Manager -->

Hope this resolves your issue.

 


Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital

Re: Google Tag Manager and Ecommerce Tracking Not Working

Top Contributor
# 5
Top Contributor
Not ideal but consider upgrading to enhanced ecommerce
https://developers.google.com/tag-manager/enhanced-ecommerce#purchases
VP & Chief Evangelist at Hub'Scan | Contact me
Level 80 Digital Analytics Warrior, KPI Therapist and Keeper of the One True Tagging Plan

Re: Google Tag Manager and Ecommerce Tracking Not Working

Top Contributor
# 6
Top Contributor
nice catch
VP & Chief Evangelist at Hub'Scan | Contact me
Level 80 Digital Analytics Warrior, KPI Therapist and Keeper of the One True Tagging Plan

Re: Google Tag Manager and Ecommerce Tracking Not Working

Visitor ✭ ✭ ✭
# 7
Visitor ✭ ✭ ✭
Thank you! I will keep you posted on results.