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
1.8K members online now
1.8K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
 
Guide Me
star_border
Reply

eCommerce Tracking Not Working - Page After Checkout Gets Hits But Does Not Seem to Send ECommerce I

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi there,

 

I hope you can help! Ecommerce setting has been implemented in this account and the code placed on the site.

01ecommercesetup.png02ecommercesetup.png

I enclose the screenshots of the ecommerce admin set-up.

 

Here's the code that implemented:

 

<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-6854369-5', 'auto');
ga('send', 'pageview');

</script>

 

The problem is that any sales are not being tracked and details are not being sent through to analytics.

 

I have set goals up for the cart , checkout and page after the checkout, and can see these are being hit.




cart:  https://titanlite.com.au/go-checkout

checkout: https://www.titanlite.com.au/go-checkout/form/seb_ecommerce_order

thank-you page after checkout: https://titanlite.com.au/thanks-for-your-order?thanks=seb_ecommerce_order

 

So I believe the problem may be that the analytics code is not sending the right information back to analytics.

 

Is that correct, and if so what extra code needs to be added to the analytics tracking code?

 

Many thanks

 

1 Expert replyverified_user

eCommerce Tracking Not Working - Page After Checkout Gets Hits But Does Not Seem to Send ECommerce I

Top Contributor
# 2
Top Contributor

Hi,

 

You need to implement the ecommerce tracking code to the thank you page as per the document below:

https://developers.google.com/analytics/devguides/collection/analyticsjs/ecommerce

 

Let me know if you need help with it.


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

eCommerce Tracking Not Working - Page After Checkout Gets Hits But Does Not Seem to Send ECommerce I

Participant ✭ ✭ ☆
# 3
Participant ✭ ✭ ☆

Hi @Francis N,

 

Only enabling ecommerce on Google Analytics settings is not enough to collect ecommerce data. You should also implement the code that sends the ecommerce data to google analytics.

 

Please read more about Google Analytics ecommerce implementation through following links:

For Ecommerce: https://developers.google.com/analytics/devguides/collection/analyticsjs/ecommerce

For Enhanced Ecommerce:  https://developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-ecommerce

 

I hope this helps.

Regards

eCommerce Tracking Not Working - Page After Checkout Gets Hits But Does Not Seem to Send ECommerce I

Visitor ✭ ✭ ✭
# 4
Visitor ✭ ✭ ✭

Thanks for the help.

 

I did go through this before, and I think I need to add this code on the back end thank-you page. This was given to me by the Google analytics implementation team:

 

<script type="text/javascript">

ga('require', 'ecommerce');

ga('ecommerce:addTransaction', {

  'id': '1234',                     // Transaction ID. Required.

  'affiliation': 'Acme Clothing',   // Affiliation or store name.

  'revenue': '11.99',               // Grand Total.

  'shipping': '5',                  // Shipping.

  'tax': '1.29'                     // Tax.

});

 

ga('ecommerce:addItem', {

  'id': '1234',                     // Transaction ID. Required.

  'name': 'Fluffy Pink Bunnies',    // Product name. Required.

  'sku': 'DD23444',                 // SKU/code.

  'category': 'Party Toys',         // Category or variation.

  'price': '11.99',                 // Unit price.

  'quantity': '1'                   // Quantity.

});

 

ga('ecommerce:send');

</script>

 

However, I find the above code confusing, as obviously I would need to put in global values. They don't have any "fluffy pink bunnies" to sell. Where do thes values come from, how are they populated? Would I just put in the following code, and then the analytics code would automatically fill in the variables? For example in the second part of the code:

 

ga('ecommerce:addTransaction', {

  'id':xxxx,                     // Transaction ID. (the code will fill in the variable xxxx)

  'affiliation':,   // Affiliation or store name. (the code will fill out the variable)

  'revenue':,               // Grand Total.(the code will fill out the variable)

  'shipping':,                  // Shipping.(the code will fill out the variable)

  'tax': '                     // Tax.(the code will fill out the variable)

});

 

 

 

eCommerce Tracking Not Working - Page After Checkout Gets Hits But Does Not Seem to Send ECommerce I

Participant ✭ ✭ ☆
# 5
Participant ✭ ✭ ☆

Hi @Francis N,

 

First of all, ga('require', 'ecommerce'); command should be in your Google Analytics tracking snippet (after you create the tracker object and before your pageview and any other ecommerce command.

 

About rest of the code; you need to have programming skills(especially JavaScript) and implementation depends on the technologies that you are using on your website. Please do not use the last code that you wrote because it can not find out the id, name, etc.. by itself and it will throw error. You need assign this values programmatically.

 

I hope this helps.
Regards

 

Re: eCommerce Tracking Not Working - Page After Checkout Gets Hits But Does Not Seem to Send ECommer

Visitor ✭ ✭ ✭
# 6
Visitor ✭ ✭ ✭

Ok thanks... so the code on all the pages throughout the website will be this:

 

<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-6854369-5', 'auto');

ga('require', 'ecommerce');
ga('send', 'pageview');

</script>

 

The bold code is the tracker object, and the red is as suggested.

 

The thank-you page would have the above on and the extra part of the code? 

 

The other part of the code - I do have a developer to go to but need to know what's involved. Will they need to create a database? Do they just need to place global variables in (according to the technology used on the site? He implied he would have to create some kind of entry for every eCommerce item previously. I would have thought that analytics would just get the information for the second part of the code dynamically.

 

Thanks :-)

eCommerce Tracking Not Working - Page After Checkout Gets Hits But Does Not Seem to Send ECommerce I

Top Contributor
# 7
Top Contributor

Hi,

 

You need to use ga('require', 'ecommerce'); only on the thankyou page where you are running ecommerce commands. The source code is different for most of the thankyou pages out there and GA is unable to collect the ecommerce data automatically, that's why you need to send it using the ecommerce tracking code. If the transactions details are available for the user on the thankyou page, your developer will be able to plug the values into the tracking code easily. If not, he should query the database for the values. Hope this helps.


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