GUA Enanced Tracking - Add to Cart Extension

Bronze Contributor
Bronze Contributor

Clearly I'm doing something wrong. I am trying to implement enhanced commerce. I want to trigger the add to cart event. I am obviously new. Be kind

product_temp_quantity = jQuery('select#qty.selectcalender.width50.quantity').val();
prod_temp_price = jQuery('select#prodctprice.semibold.productPrice.fontsize16').val();
utag.link({
enh_action : "add", // enhanced e-commerce action
prod_id : utag.data.product_id, // product id
prod_name : utag.data.product_name, // product name
prod_brand : [], // product brand
prod_var : [], // product variant
prod_cat : utag.data.product_category, // product category
prod_price :prod_temp_price, // product price
prod_quan : product_temp_quantity, // product quantity
prod_pos : ['1'], // product position
prod_color : [], // product color as a custom dimension
prod_metric : [] // product-level metric
});

5 REPLIES 5

GUA Enanced Tracking - Add to Cart Extension

Employee Emeritus

Rudy
Have you seen this series yet: https://community.tealiumiq.com/t5/User-Documentation/SERIES-Google-Universal-Analytics/ta-p/9494.

Without seeing your specific implementation, I would look for three things to start:
1) Did you enable Enhanced Ecommerce under the Tag Configuration for Google Universal Analytics Tealium Tag?
2) Did you map enh_action under Mapped Data Sources for GUA Tealium Tag?
3) Did you add the E-Commerce extension?

Last looking at your naming convention, I might also suggest looking at the E-Commerce Data Sources within the Data Layer Common Data Sources.
https://community.tealiumiq.com/t5/Analytics-and-Data/Data-Layer-Wizard/m-p/2218

Please let us know if this was helpful.
Brian

GUA Enanced Tracking - Add to Cart Extension

Moderator
Moderator

Hi Rudy,

 

It looks like you're on the right track. Pay particular attention to Brian's points above, but also make sure that all of the data sources you're passing are arrays, with the exception of "enh_action".

 

Using your example, you'd need to change to this:

 

utag.link({
enh_action : "add", // enhanced e-commerce action
prod_id : [utag.data.product_id], // product id
prod_name : [utag.data.product_name], // product name
prod_brand : [], // product brand
prod_var : [], // product variant
prod_cat : [utag.data.product_category], // product category
prod_price :[prod_temp_price], // product price
prod_quan : [product_temp_quantity], // product quantity
prod_pos : ['1'], // product position
prod_color : [], // product color as a custom dimension
prod_metric : [] // product-level metric
});

Please note: I've made an assumption here that none of your data sources are already arrays, so I've added square brackets to cast them to arrays. The "prod_temp_price" and "prod_temp_quantity" are definitely not arrays (I can see this from your jQuery code), so I've assumed the same for the other product data. This will need tweaking if your other data sources are in fact arrays (just remove the square brackets from those lines).

 

Also, I can see you've taken the prod_color and prod_metric variables from the example code. These are not mandatory, and the example was completely fabricated, so you can omit these if you don't require them.

 

I hope this is useful and not too verbose!

 

Craig.

Check out our new Swift integration library for iOS, macOS, tvOS and watchOS: https://github.com/Tealium/tealium-swift with updated
documentation https://community.tealiumiq.com/t5/Swift/tkb-p/swift.

GUA Enanced Tracking - Add to Cart Extension

Bronze Contributor
Bronze Contributor
product_temp_quantity = jQuery('select#qty.selectcalender.width50.quantity').val();

utag.link({
    "enh_action" : "add", // enhanced e-commerce action
    "prod_id ": [utag.data.product_id], // product id
    "prod_name": [utag.data.product_name], // product name
    "prod_cat" : [utag.data.product_category], // product category
    "prod_price" :[utag.data.product_unit_price], // product price
    "prod_quan":  [product_temp_quantity], // product quantity
    "prod_pos" : ['1'], // product position
    "prod_metric" : [utag.data.product_unit_price]// product-level metric
});

This is what I ended up with @craig_rouse. It is an extension that is triggered on our add to cart button.

jquery selector #productDetailForm div a img

Trigger on mousedown

Tracking event Custom.

 

I continue to get transaction counts in my funnel, but zero sessions with add to carts.  I'm not sure what I'm missing. Rookie error for sure.

GUA Enanced Tracking - Add to Cart Extension

Bronze Contributor
Bronze Contributor

Hey @brian_kranson,

 

Can you clarify #2 for me?

 

2) Did you map enh_action under Mapped Data Sources for GUA Tealium Tag?

 

Thank you in advance,

 

Rudy

GUA Enanced Tracking - Add to Cart Extension

Employee Emeritus

Hello @rudy_martinez. In the example above, there is a utag.link cal.  The link function will trigger Tealium to send data to various tagging vendors.  The link event uses an object as the data layer which then gets used in Load Rules, Extensions and Data Mappings.  The question I wanted to know in point number 2 is if the proper action was being passed to the Google Analytics Tag.  Here is an image that represents the Data Mapping.

 

tmp-gua-20151102T155706.png

Public