- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
07-27-2017 05:59 AM
07-28-2017 09:54 AM - last edited on 07-28-2017 10:23 AM by kathleen_jo
Best practice, @anupama, would be to set the coupon code to a utag_data attribute on the confirmation page, such as order_coupon_code. You'd then map this attribute in the Google Universal Analytics tag mapping toolbox to Coupon in the Enhanced E-commerce section of the toolbox:
The more "automatic" way would be to leverage the E-commerce extension. If you set your coupon code utag_data attribute to Promo Code in the E-commerce extension, the GUA coupon variable will be automatically populated without having to specifically map it as above.
08-03-2017 12:08 AM - edited 08-03-2017 12:11 AM
Hi @dave_milsomThank you for quick reply. I alredy set this _cpromo code to customized varible. But my problem is how to send the Coupen code to Google Analytics. Currently I am using ecommerce_action value as purchage. When I did this In GA I did't find Any coupen code Please see my image for more clarification.
08-07-2017 03:22 AM
Hi @dave_milsom is there any update on this. Thank you
08-07-2017 09:41 AM
@anupama The purchase event is meant to be set at time of purchase (i.e. on the order confirmation page). Since transaction ID is a required GA purchase event field, our template will only fire the purchase event when order id is present.
Best practice is that you populate the coupon code on the order confirmation page. Setting this variable in the e-commerce extension, or manually mapping in the GA tag's mapping toolbox, will ensure this is sent as part of the purchase event, as outlined in the GA docs:
ga('ec:setAction', 'purchase', { // Transaction details are provided in an actionFieldObject.
'id': 'T12345', // (Required) Transaction id (string).
'affiliation': 'Google Store - Online', // Affiliation (string).
'revenue': '37.39', // Revenue (currency).
'tax': '2.85', // Tax (currency).
'shipping': '5.34', // Shipping (currency).
'coupon': 'SUMMER2013' // Transaction coupon (string).
});
Copyright All Rights Reserved © 2008-2023