Last active
July 10, 2023 17:24
-
-
Save brablc/d3d1458e7ceed3e068b4 to your computer and use it in GitHub Desktop.
Shoptet GTM Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var dataHelper = new DataLayerHelper(dataLayer); | |
| // Page type is one of: | |
| // checkout: cart, billingAndShipping, customerDetails, thankYou | |
| // other: homepage, article, category, productDetail, section | |
| var pageType = dataHelper.get('shoptet.pageType'); | |
| // On any page, you can check for content of cart. | |
| // It contains pairs productCode => itemCount | |
| var cart = dataHelper.get('shoptet.cart'); | |
| // Different page types have different data available | |
| if (pageType == "productDetail") { | |
| dataLayer.push({ | |
| // We show how to change delimiter if needed | |
| 'hierarchy' : dataHelper.get('shoptet.product.currentCategory').split(' \| ').join(':') | |
| }); | |
| } |
Author
Author
2015-06-23
- added
shoptet.cart(on all page types when cart is not empty) - added
shoptet.product.codeorshoptet.product.codescontaining the code of the product (or product variants) onproductDetailpage
Author
2015-10-26
- Google Analytics Ecommerce variables are now automatically included on conversion page.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
2015-05-25
shoptet.order.totalnow contains the full amount with tax and shippingshoptet.order.shippingis a new field containing shipping with taxshoptet.order.shippingTaxis a new field containing shipping taxshoptet.order.nettois a new field containing only price of items without tax (previoustotal)