For the past few days I have been trying to populate the Google Tag Manager datalayer on the OpenCart product page when the button "Add to Cart" is clicked.
I understand that I need to use the push method, but I can't figure out where to place it and how to get the actual data I want.
I turned the internet up side down but found no solution to this. Any help is appreciated.
Probably best to as for a developer from the Commercial Support forum to do this.
UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk
I actually got it to work. The code needs to go in the script that adds the product to the cart.
It starts like this:
It starts like this:
Code: Select all
$('#button-cart').on('click', function()
Who is online
Users browsing this forum: No registered users and 191 guests