Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dataLayer.push({ ecommerce: null }); // Clear the previous ecommerce object.
- dataLayer.push({
- event: "view_cart", // name of an event. In this case, always stays as view_cart
- ecommerce: { // ecommerce object. This is the essential part of tracking. New EE data must always be pushed to this object
- currency: "USD", // Currency of the items associated with the event
- value: 7.77, // The monetary value of the event
- items: [ // The items for the event - this is an array
- {
- item_id: "SKU_12345", // The ID of the item, in our case ISBN
- item_name: "Stan and Friends Tee", // The name of the item
- affiliation: "Cambridge University Press and Assessment", // A product affiliation to designate a supplying company or brick and mortar store location. In our case, Cambridge University Press and Assessment
- coupon: "SUMMER_FUN", // The coupon name/code associated with the item.
- discount: 2.22, // The monetary discount value associated with the item.
- index: 0, // The index/position of the item in a list.
- item_brand: "Google", // The brand of the item. In our case academic, education or cambridge english
- item_category: "Apparel", // The category of the item. If used as part of a category hierarchy or taxonomy then this will be the first category.
- item_category2: "Adult", // The second category hierarchy or additional taxonomy for the item.
- item_category3: "Shirts", // The third category hierarchy or additional taxonomy for the item.
- item_category4: "Crew", // The fourth category hierarchy or additional taxonomy for the item.
- item_category5: "Short sleeve", // The fifth category hierarchy or additional taxonomy for the item.
- item_list_id: "related_products", // The ID of the list in which the item was presented to the user. We may not be using this.
- item_list_name: "Related Products", // The name of the list in which the item was presented to the user. In this case Bag List
- item_variant: "green", // The item variant or unique code or description for additional item details/options.
- location_id: "ChIJIQBpAG2ahYAR_6128GcTUEo", // The physical location associated with the item (e.g. the physical store location) NA
- price: 9.99, // The monetary price of the item, in units of the specified currency parameter.
- quantity: 1 // Item quantity.
- }
- ]
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement