cannot read properties of undefined split

I am trying to get the values of _clickHref and _pageName, however if I use the code: jQuery().ready(function(){ var _clickHref = jQuery(this).attr(‘{{Referrer}}’); var _pageName= _clickHref.split(‘/’).filter(Boolean); _pageName = _pageName[_pageName.length-1]; window.dataLayer = window.dataLayer || []; window.dataLayer.push({ ‘event’: ‘special_offer’, ‘carouselHref’ : _clickHref, ‘modelName’: _pageName }); }); I get the error ‘cannot read properties of undefined split’ and when… Read More cannot read properties of undefined split

Google Tag Manager – How to collect immediately?

In my web page there is the following measurement const data = { event: "FreeTrial-RegistrationLoginDone", eventContext: "additional info" }; window.dataLayer.push(data); The issue is, I need to redirect from this page right after this measurement and there is a several second delay between pushing into window.dataLayer and automatic calling the API endpoint /collect. The web page… Read More Google Tag Manager – How to collect immediately?