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

Data is not passing Google Analytics Enhanced Ecommerce via Tag Manager - Magento

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

I'm using a third party module to implement Google Analytics Enhanced Ecommerce via Tag manager in my Magento website. I confugured my codes according to the https://developers.google.com/tag-manager/enhanced-ecommerce#purchases tag configuration. 

Tag manager preview section shows that the Tags were fired correctly, and the data is available in dataLayer. 

But when i'm checking GA reports in next day, I can't see any ecommerce data. Troubleshooting this is very time consuming as I have to wait a day to check reports after changing codes/tags configurations.

 

Am I missing any settings or, is there any way which I can troubleshoot this issue quickly?

 

 

1 Expert replyverified_user

Data is not passing Google Analytics Enhanced Ecommerce via Tag Manager - Magento

Rising Star
# 2
Rising Star

Hey Jeewantha, 

 

Without looking at your site it's hard to say for sure. A few questions: 

 

+ It sounds like you're using Google Tag Manager - this is correct? 

+ Have you tried using Google Tag Assistant to QA your implementation? 

+ Have you tried using Real-Time data section of Anaytics to see if it's working? 

+ Have you enabled any kind if filter to remove your local IP data? 

 

Let me know the answer to these questions and hopefully we can identify your issue! 

 - Josh

Joshua, Rising Star
Was my response helpful? If yes, please mark it as the ‘Best Answer.’

Data is not passing Google Analytics Enhanced Ecommerce via Tag Manager - Magento

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Hi Josh,

First of all thank you for your reply,

 

- Yes I'm using Google Tag Manager

- I tried Tag Manager, But its showing only few

- In real-time data its showing sessions, but not conversions

- No, There are no filters

 

I'm using my local development copy, So there is no way I can give you a link to see. 

 

I have following data in my datalayer in checkout success page

 

window.dataLayer = window.dataLayer || []; dataLayer.push({"ecommerce":{"purchase":{"actionField":{"id":"OR400263366","affiliation":"magedev.com","revenue":71.88,"shipping":4.95,"tax":11.98,"coupon":""},"products":[{"name":"Case for iPhone 7 Plus","id":40086,"category":"Cell phone|Apple|Apple|Brand|Cases|Devices","price":54.95,"quantity":1}]}},"visitorId":598672,"visitorLoginState":"Logged in","visitorType":"Direct","visitorLifetimeValue":118.56,"visitorExistingCustomer":"Yes"});

 

I want to do configuration as https://developers.google.com/tag-manager/enhanced-ecommerce#checkout 

 

I'm confused and I think my problem might related to the tag configuration "Trigger: event equals checkout" setup under tag configuration section there. As initially there is not variable called "event". 

Re: Data is not passing Google Analytics Enhanced Ecommerce via Tag Manager - Magento

Follower ✭ ✭ ☆
# 4
Follower ✭ ✭ ☆

We are not using Magento but Shopware and I also came across troubles with the ecommerce data being sent (or not) to GA. In case this problem could be not Magento or Shopware specific but instead located on a different place I describe what I observed:

 

  • GA successfully counts conversions as conversion goal (checkout/finish; with a deviation of 10-20 % according to Shopware internal analytics)
  • the sales performance inside GA doesn't see any or very rare transactions under sales performance

 

Yesterday I was doing some testing with Google Tag Manager which triggers the Ecommerce data to be sent. I used Analytics Pros dataLayer Inspector+ to check the dataLayer.push events and saw, that events are indeed being fired: There actually IS the purchase event:

ecommerce-purchase-event.jpg

 

Today I again made two purchases, one with active preview mode and one without. In both times the event successfully fired.

 

Imagine my surprise to find only my transactions in the yesterday's summary of sales inside Shopware (which is rubbish, we did have far over 100 sales). Currently I don't know what to do: The event fires (it did to me at least) which could mean that either everyone else does not trigger the event (very unlikely) or the information is not reaching GA for some mysterious reasons.

 

Filters in GA:

  • exclude 2 of our own IPs
  • include ghost spam filter (set to our domain(s))
  • always lowercase of URLs

The dataLayer.push event itself is handled by a custom code in GTM which contains the following (only copied the relevant part):

function preparePurchase() {
  var products = [];
  for (var i=0; i < {{cart}}.products.length; i++) {
    var product = {{cart}}.products[i];
  	products.push({
      'name': product.name,       // Name or ID is required.
      'id': product.ordernumber,
      'price': product.amount.net.replace(",","."),
      'brand': product.supplier,
      'category': '',
      'variant': '',
      'quantity': product.quantity
    });
  }
  
  dataLayer.push({
    'ecommerce': {
      'purchase': {
        'actionField': {
          'id': {{order}}.number,  // Transaction ID. Required for purchases and refunds.
          'affiliation': 'ebrosia',
          'revenue': {{order}}.amount.net, // Total transaction value (incl. tax and shipping)
          'tax': {{order}}.amount.tax,
          'shipping': {{order}}.amount.shipping,
          'coupon': ''
        },
        'products': products
      }
    }
  });
}

switch({{page.controller}}) {
  case 'listing':
    prepareImpressions();
    break;
  case 'detail':
    prepareDetail();
    break;
  case 'checkout':
    if ({{page.action}} == 'finish') {
      preparePurchase();
    } else {
      prepareCheckout();
    }
    break;  
  default:
    break;
}  

Note: I was playing around with the replace statement because we had inconsistent price formatting with both comma and dot as decimal separator.

 

Like suggested, I get a lot of information in GA: sessions, bounces, conversion goals etc., but the information for Conversion/E-Commerce is getting lost on its way somehow. I am willing to check what I can if someone has an idea what to do. Hopefully I can sort this out somehow.

 

Best regards

 

Benjamin

Re: Data is not passing Google Analytics Enhanced Ecommerce via Tag Manager - Magento

Follower ✭ ✭ ☆
# 5
Follower ✭ ✭ ☆

It's working now, I kind of rebuilt the whole stuff and think it was a combination of wrong format and triggering. Maybe it was firing too early, I set it to DOM ready now. It's firing correctly now and today I even managed to fix my "product performance is too high" problem too.