I have Google Tag Manager set up on a website and want to manually trigger an event when a button is clicked (by manually I mean from Javascript).
All tutorials say that pushing into the dataLayer
variable will result in the event being recorded, however I don't see any requests made in the Network tab, so I don't think that's working.
My code is simple:
jQuery('.sign-up-action').on('click', function (e) {
dataLayer.push({'event': 'signup-btn-click'});
});
After clicking the button, dataLayer
does have a new item, but since I don't see a request made to the GTM servers, I don't believe the event is saved.
Please note that I don't have access to the GTM admin panel, so I can't really check.