0
votes

I am getting crazy trying to get this to work. I am pretty new to the whole Google Tag Manager thing, but after reading documentation, I got the basic google analytics to work.

Having said that, I am trying to set up an eCommerce transactions using dataLayer but I cannot seems to get it to work.

I am using the basic example taken on the main site:

    var dataLayer = dataLayer || [];
    dataLayer.push({
        'ecommerce': {
            'purchase': {
                'actionField': {
                    'id': 'T12345',                         
                    'affiliation': 'Online Store',
                    'revenue': '35.43',                     
                    'tax':'4.90',
                    'shipping': '5.99',
                    'coupon': 'SUMMER_SALE'
                },
                'products': [{                          
                    'name': 'Triblend Android T-Shirt',     
                    'id': '12345',
                    'price': '15.25',
                    'brand': 'Google',
                    'category': 'Apparel',
                    'variant': 'Gray',
                    'quantity': 1,
                    'coupon': ''                            
               },
               {
                    'name': 'Donut Friday Scented T-Shirt',
                    'id': '67890',
                    'price': '33.75',
                    'brand': 'Google',
                    'category': 'Apparel',
                    'variant': 'Black',
                    'quantity': 1
               }]
            }
       }
   });

In my GTM configuration, I have the following: - Tag Type: Universal Analytics - Track Type: Page View - Google Analytics Settings: {{gaTrackingID}} - Enable overriding settings in this tag: ticked - Enable Enhanced Ecommerce Features: true - Use Data Layer

and in the Trigger i have: - Trigger Type: Page view - Trigger fires on: "Page URL contains /checkout

I forgot to mention that I have two tags enabled, one to log activity on all pages and the second one which should log the purchase.

I can in google Analytics that the visit worked correcty, but the transaction does not.

Also, can someone tell me if the section "CONVERSATIONS -> Ecommerce" displays the standard or Enhanced Ecommerce?

I am a bit confused..

Why the above does not work?

2

2 Answers

1
votes

I just found out this morning that the code actually worked, but google analytics takes around 24/48 hours to reflect the changes. this is something I did not read anywhere in most of the documentation I found. This kind of make the whole testing process a bit difficult, as the only thing we can do is to check if the event is fired (as far as I know).

Perhaps there is a better way (and more instant) to test whether an eCommerce data has been pushed to google Analytics?

0
votes

Try to insert page and transaction information into a single 'ecommerce' object and not separated.

Regarding the data displayed in the ecommerce report in Analytics, it depends on whether you have enabled enhanced ecommerce settings or only those standard.