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:
// 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;}
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 Cole
ASKER
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.
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.
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.
Open in new window