Post by djordje » Wed Feb 21, 2018 6:52 am

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.

User avatar
New member

Posts

Joined
Fri Oct 14, 2016 4:23 pm


Post by paulfeakins » Wed Feb 21, 2018 7:40 pm

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


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by djordje » Thu Feb 22, 2018 2:30 am

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:

Code: Select all

$('#button-cart').on('click', function()

User avatar
New member

Posts

Joined
Fri Oct 14, 2016 4:23 pm

Who is online

Users browsing this forum: No registered users and 191 guests