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 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(':') | |
}); | |
} |
2015-06-23
- added
shoptet.cart
(on all page types when cart is not empty) - added
shoptet.product.code
orshoptet.product.codes
containing the code of the product (or product variants) onproductDetail
page
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.total
now contains the full amount with tax and shippingshoptet.order.shipping
is a new field containing shipping with taxshoptet.order.shippingTax
is a new field containing shipping taxshoptet.order.netto
is a new field containing only price of items without tax (previoustotal
)