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

eCommerce Tracking Issue

[ Edited ]
Follower ✭ ☆ ☆
# 1
Follower ✭ ☆ ☆

I've setup eCommerce tracking successfully on the order confirmation page of my main website; all the data comes through fully into Google Analytics.

 

I have another Google Analytics account which i am using for a separate cross domain campaign;

 

Domain1.com is the landing page, visitors get funneled through to Domain2.com where there is a unique checkout process and confirmation page with the below included (implemented in pretty much the same way as my main site bar the cross domain additions in the code). 

 

I cannot seem to get the eCommerce values to be passed back into Google Analytics from the thankyou page however from my GA site content report its clear that the GA code is working and recording visitors to the thankyou pages (it just seems as though the eCommerce information isn't being passed back into GA.

 

Notably prior to setting up the cross domain functionality recently I've also tried to implemented Adwords Goals however again getting the data passed through has never occurred.

Any recommendations or suggestions?

2 Expert replyverified_user

Re: eCommerce Tracking Issue

Top Contributor
# 2
Top Contributor
Hi Michael,

Did you check your order confirmation page with the Google Tag Assistant or GA debugger Chrome plugins to see if your ecommerce tracking code is sending the data to GA? Please let me know.

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: eCommerce Tracking Issue

[ Edited ]
Follower ✭ ☆ ☆
# 3
Follower ✭ ☆ ☆

The forum doesn't seem to allow images to be included so here's a link instead:

https://s32.postimg.org/q8pf8cc8l/screenshot.png

Re: eCommerce Tracking Issue

Top Contributor
# 4
Top Contributor
Thank you Michael, unfortunately there is no ecommerce information is sent to GA from your confirmation page. If you could paste your ecommerce tracking code (or the full source code) here I'd be happy to look into it for you.

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: eCommerce Tracking Issue

Follower ✭ ☆ ☆
# 5
Follower ✭ ☆ ☆
This is what is included on the confirmation page just within the opening <body> tag. Some values removed for privacy.

&lt;script&gt;
(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');

ga('create', 'UA-XXXXXX-55', 'auto', {'allowLinker': true});
ga('require', 'linker');
ga('linker:autoLink', ['domain2.com'] );
ga('send', 'pageview');

ga('require', 'ecommerce');
ga('ecommerce:addTransaction', {
'id': 829875, // Transaction ID. Required.
'affiliation': 'WebsiteName', // Affiliation or store name.
'revenue': 297, // Grand Total.
'shipping': 0.00, // Shipping.
'tax': '0' // Tax.
});

&lt;/script&gt;

&lt;script&gt;
window.dataLayer = window.dataLayer || []
dataLayer.push({
'event': 'transactionComplete'
'transactionId': 829875,
'transactionAffiliation': 'WebsiteName',
'transactionTotal': 297,
'transactionTax': 0,
'transactionShipping': 0.00,
'transactionProducts': [{
'sku': '74',
'name': 'ProductName',
'category': 'Package',
'price': 297,
'quantity': 1
}]
});
&lt;/script&gt;

Re: eCommerce Tracking Issue

Top Contributor
# 6
Top Contributor

Please find the edited code below.

 

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

ga('create', 'UA-XXXXXX-55', 'auto', {'allowLinker': true});
ga('require', 'linker');
ga('linker:autoLink', ['domain2.com'] );
ga('send', 'pageview');

ga('require', 'ecommerce');
ga('ecommerce:addTransaction', {
'id': '829875', // Transaction ID. Required.
'affiliation': 'WebsiteName', // Affiliation or store name.
'revenue': 297, // Grand Total.
'shipping': 0.00, // Shipping.
'tax': '0' // Tax.
});
ga('ecommerce:addItem', {
  'id': '829875', // Transaction ID. Required.
  'sku': '74',
  'name': 'ProductName',
  'category': 'Package',
  'price': 297,
  'quantity': 1
});
ga('ecommerce:send');
</script>

Your code for adding items was for a Google Tag Manager implementation.

Also I've added the ecommerce:send command that will send the data to GA.

 

Let me know how you get on.


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: eCommerce Tracking Issue

Rising Star
# 7
Rising Star
I think the trouble is that the information related to items is being pushed in to the data layer via dataLayer.push.

What's your GA implementation? Inline or GTM? The above code and GA Debugger printed information suggest it's inline, however the item call is typical of a GTM implementation.

Have a look at the link below for reference.
https://developers.google.com/analytics/devguides/collection/analyticsjs/ecommerce

You have to pass item data inside the 'ecommerce:addItem' call.

Re: eCommerce Tracking Issue

Visitor ✭ ✭ ✭
# 8
Visitor ✭ ✭ ✭
Fantastic, managed to sort it and I'm not getting the data through.

An additional question; is it possible to pass the data layer information into more than one Google Analytics account?

E.g. can the following code be adjusted to include more than one web property?

ga('create', 'UA-XXXXXX-55', 'auto', {'allowLinker': true});

The reason for wanting to do this is due to having two funnels; in one account we want to be able to see the data/revenue from both funnels, whilst on another account/property we only want to include data/revenue from one of the funnels.