Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <head>
- <!-- Google tag (gtag.js) -->
- <script async src="https://www.googletagmanager.com/gtag/js?id=TAG_ID"></script>
- <script>
- window.dataLayer = window.dataLayer || [];
- function gtag(){dataLayer.push(arguments);}
- gtag('js', new Date());
- gtag('config', 'TAG_ID');
- </script>
- </head>
- <body>
- <div>This is where the purchase form would go</div>
- <script>
- gtag("event", "purchase", {
- transaction_id: "T_12345_1",
- affiliation: "Google Merchandise Store",
- value: 25.42,
- tax: 4.90,
- shipping: 5.99,
- currency: "USD",
- coupon: "SUMMER_SALE",
- items: [
- // If someone purchases more than one item,
- // you can add those items to the items array
- {
- item_id: "SKU_12345",
- item_name: "Stan and Friends Tee",
- affiliation: "Google Merchandise Store",
- coupon: "SUMMER_FUN",
- discount: 2.22,
- index: 0,
- item_brand: "Google",
- item_category: "Apparel",
- item_category2: "Adult",
- item_category3: "Shirts",
- item_category4: "Crew",
- item_category5: "Short sleeve",
- item_list_id: "related_products",
- item_list_name: "Related Products",
- item_variant: "green",
- location_id: "ChIJIQBpAG2ahYAR_6128GcTUEo",
- price: 9.99,
- quantity: 1
- }]
- });
- </script>
- </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement