enhanced ecommerce and GTM UA

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;
}
Randy ColeDigital Marketing, Marketing Director, Market Manager, IT DirectorAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Randy DownsOWNERCommented:
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 DirectorAuthor 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.
Randy DownsOWNERCommented:
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 DirectorAuthor 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.
Randy DownsOWNERCommented:
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.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.