TechnicalWebAnalytics/dataLayer-shopify

Product Sku & Variant on collections page

flkwade opened this issue · 1 comments

The script in your code
'id' : {{product.id | json}},
'sku' : {{product.selected_variant.sku | json}},
'variantId' : {{product.selected_variant.id | json}},
Doesn't work on the collections page. I updated it to
'id' : {{product.id | json}},
'sku' : {{product.variants.first.sku | json}},
'variantId' : {{product.variants.first.id | json}},

The product isn't yet selected on the collections page so it makes sense that selected doesn't work. Hope this is useful

Issue also exist on product pages. I also had to remove the " " on the transaction page in place for ' '