- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
10-20-2020
12:34 PM
- last edited on
10-21-2020
06:59 AM
by
TealiumJustin
Hi!
We recently retired our Google Universal Analytics tag and added a Gtag.js. The problem is that a lot of very specific events are firing with this tag that we never coded. For example the Purchase event on the Thank You page. Category is Ecommerce and value is some big number. So I commented out these pieces of code in the tag template
/* if ( !u.data.event_name && u.data.order_id ) { u.data.event_name = "purchase"; } */ /*"purchase": [{ "name":"transaction_id", "required": true }, { "name":"value" }, { "name":"currency" }, { "name":"tax" }, { "name":"shipping" }, { "name":"affiliation" }, { "name":"coupon" }, { "name":"items" }, { "name":"trip_type" }, { "name":"passengers"} ], */
There are 2 identical GA tags for Dev and Prod with the load rule in terms of the URL being different. I made this change in both tags and the Dev tag does not fire the Purchase event on the Thank You page. That is, on the Test store.
On production this change (commenting out) is not helping at all. So I'm out of ideas. I need to either prevent this event from firing or catch hold of that utag.link (wherever it is coming from) and let it continue only if it does not fire the Purchase event. Will appreciate any help!
Solved! Go to Solution.
10-21-2020
04:31 AM
- last edited on
10-21-2020
06:59 AM
by
TealiumJustin
Hi, I could block the purchase event finally after commenting out this part of the template as well-
/* else if (cdm_event === "ecom" && u.data.event_name && u.data.event_name.match(/add_payment_info|add_to_cart|add_to_wishlist|begin_checkout|checkout_progress|purchase|refund|remove_from_cart|product_click|promotion_click|set_checkout_option|view_item|view_item_list|view_promotion/)) { cdm_event_flag = true; }*/
Readded the else if condition without the 'purchase' option. Hoping somebody might benefit from this
10-21-2020 04:40 AM
Hi @sujani_koya ,
Tealium uses E-commerece extension to catch hold of product related, Order related and Customer related details from your data layer.
Could you please provide some screenshot of your un-desired event ?
PFS
You would have mapped your respective datalayer variables here.
If you are using e-commerce extension you no need to fire any 'Purchase' event seperately.
Tags in Tealium where coded to fire,
If there is order_id in the dataLayer and that is mapped to ecommerece extension then 'Purchase' event will fire from Google Analytics or other related tags.
This is to reduce the load of e-commerce mapping.
It would be better if you reach the tealium support .
10-21-2020 06:08 AM
The mapping on the E-Commerce extension is just as you showed. The client does not want this event and so had to manually comment out all that code in the template
Copyright All Rights Reserved © 2008-2023