Analytics
4.6K members online now
4.6K members online now
Learn how to set up goals and Ecommerce tracking, verify accuracy of attribution traffic sources, and discuss funnel visualization, Multi-Channel Funnels, the Goal Flow Report, and Enhanced Ecommerce
 
Guide Me
star_border
Reply

Best practice for selectively triggering GTM ecommerce tag

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

I'm implementing the standard GTM ecommerce tag on the confirmation page of a form, and want to make sure it only fires once per transaction (i.e. not if someone refreshes the page, etc.)

 

The back-end does have this information, so that's not a problem, but I wasn't sure how well the ecommerce tag would work with certain implementations. For example, as suggested in the basic documentation for the tag, I've set the trigger for the page load of the confirmation page's URL. But what happens if the page chooses not to add the transaction information to the dataLayer (because it would result in a duplicate)? Will this cause some sort of error in GTM, or will the ecommerce tag simply do nothing during that firing? (The latter would of course make things easiest.)

 

Or, would it be better to simply define a custom trigger that looks for a specific flag parameter in the dataLayer, which would then only be added by the page when it does want to submit the ecommerce transaction data?

1 Expert replyverified_user

Best practice for selectively triggering GTM ecommerce tag

Visitor ✭ ✭ ✭
# 2
Visitor ✭ ✭ ✭

Or finally, is that not even an issue, because the system would just ignore duplicate transactionID submissions?

Marked as Best Answer.
Solution
Accepted by topic author Nathan S
February 2017

Best practice for selectively triggering GTM ecommerce tag

Top Contributor
# 3
Top Contributor

Hi Nathan,

 

GA will ignore the duplicate transaction if it is sent in the same session. If it is sent in a new session, it will be recorded. You won't see it as a duplicate in the reports, but if you select the transaction and a timeframe when the transactions were sent you will see two spikes on the time graph. Best practice would be inserting the transaction information to the dataLayer only once, as you mentioned. It won't cause any errors, the tracking tag just won't send the transaction to GA. Hope this helps, let me know if you have questions.


Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital