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

Google Analytics and Enhanced Ecommerce integration

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hello, i am implementing "Google Ecommerce Enhanced" but i'm having some issue in getting tracked my data.
Below you can see how i have implemented the tracking

1- setup "ga" object and track the exact url the user is visiting

<script>
// GA : SETUP AND STANDARD PAGE TRACKING
(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-XXXXXXX','auto');
ga('send', 'pageview', location.pathname);
</script>


2- at the end of the page it's tracked the "click" on a product, tracking also a new pageview related to a "custom url"

<script>
// GA : ECOMMERCE TRACKING AND CUSTOM PAGE TRACKING
ga('require', 'ec');
ga('ec:addProduct', {  'id': 'prd001', 'name': 'Product #1'});
ga('ec:setAction', 'click');
ga('send', 'pageview', '/Product-1-Main');
</script>


The result is that only pageviews are registered in Analytics, even if i have enabled "Ecommerce" inside its configuration panel.

Using "GA Debug" (Chrome's extension) i see all data are sent, and they are sent exactly the same way other websites are doing (ex: https://enhancedecommerce.appspot.com/item/9bdd2 ).

As anyone suggestion on how to fix this strange behaviour ???
1 Expert replyverified_user

Google Analytics and Enhanced Ecommerce integration

Top Contributor
# 2
Top Contributor

Hi,

 

Do you have Enhanced Ecommerce enabled in Ecommerce Settings?

I'd suggest sending the click actions using events instead of pageviews.


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 Analytics and Enhanced Ecommerce integration

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Enhanced Ecommerce has been enabled in Ecommerce Settings, but no "sales" are tracked. 
I can see, now, events tracked (thank you for your suggestions).


Below the code used to track sales:

<script>
ga('set', '&cu', 'EUR');
ga('ec:addProduct', { 'id': 'prod1', 'name': 'Prod 1', 'price': '0.05', 'quantity': 1 });
ga('ec:setAction', 'purchase', { id: 'prod1', revenue: '0.05', tax: '0.01', coupon: '' });
ga('send', 'pageview', "/Prod-1-Sale");
</script>

Re: Google Analytics and Enhanced Ecommerce integration

Visitor ✭ ✭ ✭
# 4
Visitor ✭ ✭ ✭

After some day of test no changes in tracking behaviuor ..

1- product click : code present and action tracked

2- product added to cart : code present and action tracked

3- checkout : code present and action tracked

4- transaction completed : code present (see post before) but action not tracked

 

I'm not understanding why last tracking step is failing ...  Any idea ?