Identifying a visitor with javascript embed code

contacts

#1

Hi again developers forum,

I have been working on getting user data via the _hsq.push([“identify”… method. Im having problems getting any contacts however.

I have a DOM object which gets the users email address. The address itself is in string format and I have many other parameters I still want to check, for the sake of simplicity I have limited it to the email address like in the API docs.

All the methods were put in via the Reports editor within hubspot and the DOM object was accessible within the scope of the custom embed block.

The methods that I have tested are:
direct DOM object call:
if(DOMObject.email.length > 1) {

    _hsq.push(["identify", {
        email: DOMObject.email 
    }]);

}

Get parameter via function call.

 function myFunc() {
     return DOMObject.email;
 }

 if(DOMObject.email.length > 1) {
    _hsq.push(["identify", {
                      email: myFunc() 
 }]);
 }

I have also gone through the forums and I couldn’t find any definitive answer. I only have access to this data via GTM and hubspot embed. I am a bit stumped as to why no results were returned and im sur im getting traffic within the embedded urls. Any ideas as to whats missing?