Does a Classic Analytics Ecommerce Data Layer work with Universal Analytics?

176 views Asked by At

For example, does the following mark-up...

dataLayer = [
    {
        'transactionId': 'placeholder-id',
        'transactionAffiliation': 'placeholder-affiliation',
        'transactionTotal': 'placeholder-total',

Work with analytics.js, or a Google Tag Manager configuration? Any resources which provide information about how necessary an upgrade to Universal Analytics' new data layer would be hugely useful.

Thanks.

2

There are 2 answers

0
nyuen On

The datalayer you have specified, although incomplete, does work for a Google Tag Manager implementation of standard ecommerce with Universal Analytics, but not enhanced ecommerce. You can refer to this resource for more information: https://support.google.com/tagmanager/answer/3002596

Note that the datalayer is not a feature of UA but is built into Google Tag Manager. So using the DL for analytics tracking does not require a UA implementation.

0
Jakub Kriz On

No, they are totally different. Try to search a little and you will find a lot of todos like: https://developers.google.com/tag-manager/enhanced-ecommerce http://merch.docs.magento.com/ee/user_guide/content/marketing/google-universal-analytics-enhanced-ecommerce.html

Example from google developers

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.
       },
       {
        'name': 'Donut Friday Scented T-Shirt',
        'id': '67890',
        'price': '33.75',
        'brand': 'Google',
        'category': 'Apparel',
        'variant': 'Black',
        'quantity': 1
       }]
    }
  }
});