I am installing google tags on a site that uses wordpress and smoothstate transition animations. When I navigate between scene elements using smoothstate (which are each unique wp pages), my GTM's do not fire. If I do a hard refresh of one of those pages, the GTM's will fire until I navigate to another scene element.
Here is an example of a listener that is not working:
$( '.back-to-home' ).on('click', function() {
if (typeof dataLayer !== 'undefined') {
dataLayer.push({
'event': 'backToHomeClicked',
});
}
});
I am installing google tags on a site that uses wordpress and smoothstate transition animations. When I navigate between scene elements using smoothstate (which are each unique wp pages), my GTM's do not fire. If I do a hard refresh of one of those pages, the GTM's will fire until I navigate to another scene element.
Here is an example of a listener that is not working: $( '.back-to-home' ).on('click', function() { if (typeof dataLayer !== 'undefined') { dataLayer.push({ 'event': 'backToHomeClicked', }); } });
How can I keep the listener enabled?