enhanced ecommerce and GTM UA

Randy Cole
Randy Cole used Ask the Experts™
on
Using GTM and Enhanced eCommerce: I need to track eCommerce on a third-party system and the required ID field is not called ID or transactionID ... it is called confirmID. I'm trying to retrieve a few values from the purchase including transaction amount and cannot use the dataLayer so I'm using a custom JavaScript variable in GTM and have built a tag to read data from the custom variable.

How can I make this work if my ID field name does not match the required ID field name? Here's my JavaScript variable:

    function() {
  var ecommerceData = {
    'ecommerce': {
      'purchase': {
        'actionField': {'confirmid':'T123456',
          'tik_value':'500.00',
          'pids':'800911',
          'discounts':'chipster' }


        }
      }
  };
   return ecommerceData;
}
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Do you get anything if you use the standard javascript?

// A custom JavaScript macro that returns an ecommerceData object
// that follows the data layer syntax.
function() {
  var ecommerceData = {
    'ecommerce': {
      'purchase': {
        'actionField': {'id': 'T12345'},
        'products': [
            // List of productFieldObjects
        ],
        ... // Rest of the code should follow the data layer syntax.
     }
  };
  return ecommerceData;
}

Open in new window


If you choose to use a custom JavaScript macro instead of the data layer, select Enable Enhanced Ecommerce Features and set the Read data from macro option.
Randy ColeDigital Marketing, Marketing Director, Market Manager, IT Director

Author

Commented:
No, I don't get anything at all. I'm considering hiring someone to fix this for me as it seems to be above my level of expertise and is taking more of my time than I have to give to it.
Did you do this?

If you choose to use a custom JavaScript macro instead of the data layer, select Enable Enhanced Ecommerce Features and set the Read data from macro option.
Randy ColeDigital Marketing, Marketing Director, Market Manager, IT Director

Author

Commented:
Yes, I did. I'm thinking this is not something I can solve without the assistance of a developer or the IT team at the third party system. I think my firing rules are being trumped by the virtual pageload and I can't get the tags to fire as desired.
It would be helpful to get the insight of  the assistance of a developer or the IT team at the third party system. They may already have a solution for this.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial