Hello,
I am trying to implement onclick data layer push. Basically, I want to get a datalayer push with product data after the add to cart button has been clicked. I implemented this to our product form liquid:
But this is firing at all times on a product page, and not waiting for the onclick, I can see it in the source code even before clicking on something. I would like to then send this data to GTM. The URL for preview of a product page is here:
Am I doing something wrong? Thank you all for your help.
