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
5.8K members online now
5.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 Suddenly Stopped

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi all,

 

This has to be, by far, the most irritating error I've ever encountered within the GA platform. 

 

Our ecommerce tracking code has worked fine for roughly two weeks. All of the data we required was being sent to us. Great. Then, out of no where, the tracking suddenly dropped without any input from any of our developers here. The code and setup are the same but, for some reason, the data has now stopped filtering through.

 

Here's an example of our code how it is currently setup.

 

Ecommerce

 

<script type="text/javascript">

ga('require', 'ecommerce');

 

ga('ecommerce:addTransaction', {

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

'affiliation': 'Quote system',                         // Affiliation or store name.

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

'currency': 'GBP'                                          // local currency code.

});

 

ga('ecommerce:addItem', {

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

'name': 'Insurance product',                                                               // Product name. Required.

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

'price': '3437.86',                                                                                // Unit price.

'currency': 'GBP',                                                                                 // local currency code.

'quantity': 1

});

 

ga('ecommerce:send');

</script>

 

I have replaced some of the confidential data in this with generic words. 

 

And this is our GA tracking code which defines which UA is to be used within the ecommerce:

 

<script type="text/javascript">

               (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-2955510-7', 'auto');

               ga('send', 'pageview');

</script>

 

Can anybody, please, help me understand what is going on?

 

Thanks,

 

Ryan

1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by topic author Ryan R
April 2017

Ecommerce Tracking Suddenly Stopped

Visitor ✭ ✭ ✭
# 4
Visitor ✭ ✭ ✭

Hi all,

 

I've managed to figure it out. Even though the 'quantity' field is listed as optional, this is actually what caused the ecommerce code to stop firing.

 

The quantity didn't have the '1' around the number which caused this to stop working.

 

Cheers!

View solution in original post

Ecommerce Tracking Suddenly Stopped

Follower ✭ ✭ ✭
# 2
Follower ✭ ✭ ✭

Hi Ryan,

 

In which sequence does the GA tracking code fire? Do you fire it before or after the e-commerce command?

 

Thanks,

Adam

Ecommerce Tracking Suddenly Stopped

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Hi Adam,

 

We have the GA tracking code first, followed by the ecommerce code. Should we reverse this?

 

Thanks,

 

Ryan

Marked as Best Answer.
Solution
Accepted by topic author Ryan R
April 2017

Ecommerce Tracking Suddenly Stopped

Visitor ✭ ✭ ✭
# 4
Visitor ✭ ✭ ✭

Hi all,

 

I've managed to figure it out. Even though the 'quantity' field is listed as optional, this is actually what caused the ecommerce code to stop firing.

 

The quantity didn't have the '1' around the number which caused this to stop working.

 

Cheers!