Advertisement
GiacomoGalanti

view_cart GA4

Apr 8th, 2022
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. dataLayer.push({ ecommerce: null }); // Clear the previous ecommerce object.
  2. dataLayer.push({
  3. event: "view_cart",
  4. ecommerce: {
  5. currency: "USD",
  6. value: 7.77,
  7. items: [
  8. {
  9. item_id: "SKU_12345",
  10. item_name: "Stan and Friends Tee",
  11. affiliation: "Google Merchandise Store",
  12. coupon: "SUMMER_FUN",
  13. currency: "USD",
  14. discount: 2.22,
  15. index: 0,
  16. item_brand: "Google",
  17. item_category: "Apparel",
  18. item_category2: "Adult",
  19. item_category3: "Shirts",
  20. item_category4: "Crew",
  21. item_category5: "Short sleeve",
  22. item_list_id: "related_products",
  23. item_list_name: "Related Products",
  24. item_variant: "green",
  25. location_id: "L_12345",
  26. price: 9.99,
  27. quantity: 1
  28. }
  29. ]
  30. }
  31. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement