add_to_cart and Use SKU instead of ID
-
hi gtm4wp guys, great work with the plugin, keep up the great work,
I have this case with multisite and woocommerce, where they sell the same product through different sites, hence I want to use the same SKU for all. I ticked the box for Use SKU instead of ID and it works well on begin_checkout and other checkout related events. It also works on the view_item, however when the add_to_cart is pushed the datalayer item_id changes from SKU string back to the ID number – so my GA4 reporing of view_item to add_to_cart to purchase is getting messed up.
Looking inside the code – this condition somehow does not apply to add_to_cart data?
'id': gtm4wp_use_sku_instead ? dom_productdata.getAttribute( 'data-gtm4wp_product_sku' ) : dom_productdata.getAttribute( 'data-gtm4wp_product_id' )
thanks
The page I need help with: [log in to see the link]
- The topic ‘add_to_cart and Use SKU instead of ID’ is closed to new replies.