2
votes

I've implemented GTM on an ecommerce site and have some tags set up for a few thins (page impressions, add to cart etc.) These all work and track in Analytics as expected however I've now added the checkout funnel pushes and these are firing but not tracking.

Data flow is basically: User Visits Cart Page >> Step 1 dataLayer.push request >> Console shows Checkout Tag has fired >> Data doesn't show up in analytics.

An example of this dataLayer push event is as follows:

dataLayer.push({
    'event' : 'checkout',
    'ecommerce' : {
        'currencyCode' : 'GBP',
        'checkout' : {
            'actionField' : {'step' : 1},
            'products' : [
            {
                'name' : '"Some product name"',
                'id' : '55',
                'price' : '35',
                'quantity' : 1
            }
            ]
        }
    }
});

It looks like the problem is more likely a setup issue with GTM so I've included the current settings I have for the Checkout Tag:

Tag Type - Universal Analytics
Tracking ID - {{ Tracking-ID }}
Track Type - Event
Category - Ecommerce
Action - Checkout
Enable Enhanced Ecommerce Features - True
Use data layer - True
3

3 Answers

0
votes

String vs Integer

Quantity is an Integer type, you have string type. https://developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-ecommerce#ecommerce-data

dataLayer.push({
    'event' : 'checkout',
    'ecommerce' : {
        'currencyCode' : 'GBP',
        'checkout' : {
            'actionField' : {'step' : 1},
            'products' : [
            {
                'name' : '"Some product name"',
                'id' : '55',
                'price' : '35',
                'quantity' : 1
            }
            ]
        }
    }
});
0
votes

After some trial and error deleting the tag from GTM and re-adding it solves the issue.

I'm not really sure why this is. It's also worth noting if using the dataLayer.push() method included on page load (rather than attached to an action) it can fire before GTM is ready which may lose data. Instead wrap it in a $(document).ready (if you're using jQuery)

0
votes

The following works absolutely fine for me, may be try adding 'option' with your step

dataLayer.push({
                'event': 'checkout',
                'ecommerce': {
                  'checkout': {
                    'actionField': {'step': 1, 'option': 'Billing Address'},
                    'products': [{
                      'name': 'Sony VAIO',
                      'id': 'VGN-TXN27N/B',
                      'price': '2494.22',
                      'category': 'Peripherals',
                      'quantity': '1'
                      }]

                 }
               },
               'eventCallback': function() {
                  //document.location = 'checkout.html';
               }
              });

Here is the GTM settings

GTM Setting 1

GTM Setting 2