0

I have a production site in which my transactions are all recorded in google analytics correctly. Recently we have decided to create a staging environment which will be a replica of production. For this staging environment I created a new google account and hooked it up with Anaytics and Google tag manager. I then updated the code in staging environment to use this UA and GTM account ids.

When I look at my staging GA dashboard now, I see data, however I do not see a 'transactions' heading under 'ecommerce' and there is nowhere I can see my transactions. I have enabled 'ecommerce' for this GA dashboard from Account > Settings. Is there anything else I need to configure to see transactions in the dashboard?

Undefined Variable
  • 4,196
  • 10
  • 40
  • 69
  • Just to confirm, your problem is not that you do not see any data, your problem is that the relevant menu item does not appear in the Conversions/E-Commerce section of the menu? – Eike Pierstorff Feb 28 '19 at 10:04
  • @EikePierstorff that is correct – Undefined Variable Mar 01 '19 at 07:41
  • I am just curious, did you ever find a solution? Because it sounds like this just shouldn't happen, and it would be interesting to hear what was going on. – Eike Pierstorff Mar 03 '19 at 20:06
  • @EikePierstorff Unfortunately I did not get a solution. However I noticed that in my staging GA, Under Ecommerce > Sales Performance I see the same report as I see under Ecommerce > Transactions in production. Maybe some kind of configuration issue but I since I got the same report I have not dug around more. – Undefined Variable Mar 14 '19 at 18:10

1 Answers1

0

Here is the official GTM dataLayer GA Enhanced Ecommerce spec: https://developers.google.com/tag-manager/enhanced-ecommerce

Transactions are referred to as "purchase": https://developers.google.com/tag-manager/enhanced-ecommerce#purchases

<script>
dataLayer.push({
  'ecommerce': {
    'purchase': {
      'actionField': {
        'id': 'T12345',                         // Transaction ID. Required for purchases and refunds.
        'affiliation': 'Online Store',
        'revenue': '35.43',                     // Total transaction value (incl. tax and shipping)
        'tax':'4.90',
        'shipping': '5.99',
        'coupon': 'SUMMER_SALE'
      },
      'products': [{                            // List of productFieldObjects.
        'name': 'Triblend Android T-Shirt',     // Name or ID is required.
        'id': '12345',
        'price': '15.25',
        'brand': 'Google',
        'category': 'Apparel',
        'variant': 'Gray',
        'quantity': 1,
        'coupon': ''                            // Optional fields may be omitted or set to empty string.
       },
    ...

The spec documentation isn't of the highest quality, so for a happy implementation I recommend the following best practices dataLayer.push not working after GTM script

  • Always initialize the dataLayer
  • Always set the "event" property

To facilitate your life even more, you can do:

  • Event = ecommerce_{action}
  • Category = Ecommerce
  • Action = {action} (eg purchase, click...)

The event naming convention will allow you to create 1 single GTM trigger (Event REGEX ecommerce_.*) and therefore 1 single tag to capture all your Ecommerce events (having to create separate triggers/tags for each Ecommerce action is unnecessary and painful)

Once that's done, create a GTM Google Analytics Event tag with the above trigger, and enable Ecommerce in the GA settings:

enter image description here

Max
  • 12,794
  • 30
  • 90
  • 142