We use cookies to make HubSpot's community a better place. Cookies help to provide a more personalized experience and relevant advertising for you, and web analytics for us. To learn more, and to see a full list of cookies we use, check out our Cookie Policy (baked goods not included).
Nov 30, 2022 9:30 PM
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"));
window.location.replace("https://www.example.com/");
Dec 6, 2022 11:15 AM
Hi, @SRitchot 👋 Were you able to make some progress on this project? — Jaycee
Dec 6, 2022 2:17 PM
Hi @Jaycee_Lewis, I wasn't able to make any progress on this.