- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
Hello
I've added a custom metric to my Google Universal tag.
It should be send when there is a new transaction. Therefore, I've mapped it like this in the GA tag under the metrics category:
- Event type: transaction
- Metric: metric1
When I debug it, the google debug info tells me the metric is undefined:
Running command: ga("gaMain.ecommerce:addTransaction", {metric1: undefined, id: "1511265721905", affiliation: "", revenue: "337.50", shipping: "", tax: "", currency: ""})
When I take a look in the utag_data object, the commerce_product_fraction is properly defined and filled in with an array:
Does anyone know what I've did wrong?
Thanks for the help!
Solved! Go to Solution.
11-22-2017 01:42 AM - last edited on 11-22-2017 03:02 AM by kathleen_jo
What if you create a new Data Layer variable (type: javascript variable) and call it "commerce_product_fraction[0]". Than it should get the first string within the array, @koen_de_keersma. Now you're trying to put an array into the custom metric.
What @AndreScholten suggests is correct, you are trying to assign an array to the mapping, which will not work.
Using a Set Data Values Extension as suggested is the best option.
Adrian
Thanks guys! Did the job indeed.
Copyright All Rights Reserved © 2008-2023