- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
07-25-2019 09:51 AM
07-29-2019 08:58 AM
@anourani - is the transaction number the same each time? GA should be deduping on unique transaction numbers.
Beyond that, it should be possible to set a cookie the first time the tag fires to use as a condition to be checked the next time the tag might be triggered. Others may have some ideas and chime in as well. You might also research why the page is being refreshed so often. Good luck, and look forward to your updates how you solved so others can benefit from your experience.
07-31-2020 12:54 PM - edited 07-31-2020 12:54 PM
Have you resolved this issue using Tealium? I see this is an issue that has some documented solutions in Google Tag Manager and also using server-side measurement protocol. But, if you've managed to solve this in TiQ, it would be very appreciated if you would share the solution.
08-13-2020 01:53 AM
As per @mitchellt previous post. you can drop a cookie and set a condition against this to prevent duplicate fires.
10-19-2020 07:19 AM
@GavinAttard , after several attempts to solve this in our application and with Tealium, I believe I need some help here. I see quite a few posts on the internet on how to do this with Google Tag Manager, using a callback function of the GA tag. But I haven't been able to successfully translate those into how to do it with Tealium.
I do understand that the basic steps (copied from a post on Google Tag Manager method) are:
Would you be able to outline specifically how to make this work with the standard Tealium GA tag (we are using the "legacy" analytics.js tag).
10-20-2020 01:05 AM
Hi @Krasner
Create a datalayer property of type cookie - call it 'transaction_made' or any other appropriate name.
Using the persist extention drop a cookie and populate it with the data layer property that holds your order id. set expiry to what you think is most appropriate.
Place this at the boittom of your extention list and scope to after tags.
You can place a condition on it to check if the cookie already exists, and if the value it holds is the same as the value in the order_id datalayer property. If it exists and is the same, then no need to drop again.
Create a data layer property called is_order.
Create a Set data value extention, scope it to before tags and place appropratly in extention list. This extention shuold set the is_order to true if the cookie does not exist, or the cookie exists and the value it holds is not the same as the value in the order_id datalayer property
Finally map the is_order to the GA order action to trigger on true.
I think... that ought to do it.
kr
Gavin
10-20-2020 07:21 AM
@GavinAttard Thank you very much for the detailed instructions. These are very helpful. I do have one follow-up about where you wrote "Finally map the is_order to the GA order action to trigger on true".
We are using Tealium's standard GA tag. And in this tag, there is logic built into its template to create the order action based on the presence of a value in the order_id field. So, we don't have any explicit extension or tag to fire the order event, but rather the Tealium tag does it by itself, based on whether there is an order_id or not.
I've pasted the relevant section fro the standard Tealium GA tag below, whcih controls whether the order action occurs. If I am following you, then what we would need to do is to customize this tag, by adding another IF, so that in addition to the presence of the u.data.order_id field, it also requires that is_order = true. Is that correct? Or is there a way to do this without customizing the tag template?
Here is the relevant section from the standard tag template:
//ENH: ORDER start
else if (u.data.order_id) {
if (u.data.order_id instanceof Array && u.data.order_id.length > 0) {
u.data.order_id = u.data.order_id[0];
}
u.addproduct("product_purchase", u.data.product_id.length, false);
g = {};
g.id = u.data.order_id;
g.affiliation = (u.data.affiliation ? u.data.affiliation : u.data.order_store);
g.revenue = (u.data.revenue ? u.data.revenue : u.data.order_total);
g.shipping = (u.data.shipping ? u.data.shipping : u.data.order_shipping);
g.tax = (u.data.tax ? u.data.tax : u.data.order_tax);
g.coupon = (u.data.coupon ? u.data.coupon : u.data.order_coupon_code);
u.setHitData(g, "enhecom_events", "purchase");
u.all('ec:setAction', 'purchase', g);
// ENH: ORDER end
10-21-2020 12:54 AM
Hi @Krasner
Indeed the answer is right there in your reply.
Instead of populating is_order with a boolean value, get it to populate with the order id if the conditions are met.
Then map the is_order to the transaction id in the GA tag.
If is_order has a value, then it will fire the order, if left unpopulated/undefined etc... then it won't fire.
10-21-2020 09:36 AM
@GavinAttard Thanks. So, now the part of this where I'm having difficulty is setting a condition on the extension to check whether one variable equals another variable. I can choose avariable as the first part of a condition, but then after the expression like "equals" or "does not equal", it does not let me choose another variable. Only to enter a text value. How does one compare two variables in an extension condition?
I'm trying to implement the condition in the "set data values" extension" to only set the is_order when the current order ID does not equal the one in the cookie. So, I need to compare two variables in this case.
10-22-2020 12:52 AM
Ah, of course.. doh... you will need ot use a custom javascript extention
somethign along the lines of
if(b["cp.cookiename"] && b["cp.cookiename"] == b.orderid) { b.is_order = b.orderid; }
set the extention condition to run only on the order confirmation page.
Copyright All Rights Reserved © 2008-2023