APIs & Integrations

SRitchot
Participant

Hubspot Identify User With a Module

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/");

0 Upvotes
2 Replies 2
Jaycee_Lewis
Community Manager
Community Manager

Hubspot Identify User With a Module

Hi, @SRitchot 👋 Were you able to make some progress on this project? — Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

0 Upvotes
SRitchot
Participant

Hubspot Identify User With a Module

Hi @Jaycee_Lewis, I wasn't able to make any progress on this.

0 Upvotes