How to send Coupon code to Google Analytics

Silver Contributor
Silver Contributor

How can pass this info to GA from Tealium

 

 

ga('ec:setAction', 'purchase', { 

'coupon': 'SUMMER2013' // User added a coupon at checkout. 
}); 

 

 

 

4 REPLIES 4

How to send Coupon code to Google Analytics

Tealium Employee

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:

 

coupon code.png

 

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.

How to send Coupon code to Google Analytics

Silver Contributor
Silver Contributor

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.Screen Shot 2017-08-03 at 12.39.40 PM.png 

How to send Coupon code to Google Analytics

Silver Contributor
Silver Contributor

Hi @dave_milsom is there any update on this. Thank you 

How to send Coupon code to Google Analytics

Tealium Employee

@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).
});
Public