Hi, I want to set the identity of the User using a Module created on Hubspot in the section Design tools. I have seen the Tracking Code API and did try the code example given in the module. But this is not working. Can you guide me?
/* The below example gets the value of a query string parameter '?email=' and uses that to identify the visitor */ function getParameterByName(name) { var match = RegExp('[?&]' + name + '=([^&]*)').exec(window.location.search); return match && decodeURIComponent(match[1].replace(/\+/g, ' ')); } var _hsq = window._hsq = window._hsq || []; _hsq.push(["identify",{ email: getParameterByName("email") }]);
// Track the page view for the new page _hsq.push(['trackPageView']); console.log(getParameterByName("email"));