Identify, trackPageView : no activity logged in user Hubspot page


#1

Hello,

I want to use identify method to track users on my website.

I try several _hsq.push and there is no activity logged in the user page on hubspot :
var _hsq = window._hsq = window._hsq || [];
_hsq.push([“identify”,{ email: ‘<%= current_user.email %>’ }]);
_hsq.push([‘trackEvent’,{ email: ‘<%= current_user.email %>’ }]);
_hsq.push([“trackPageView”, {email: ‘<%= current_user.email %>’}]);

What is wrong ? Is that method should do what I want (logged activity in hubspot user page) ?

Thanks

Matthieu


#2

Hi @Matthieu_Brau,

I know this seems like a basic question, but is the HubSpot tracking code installed on the page in question? If so, can you follow up with a link to the page?


#3

Hello,
Yes I confirm the Hubspot tracking code is intalled.
I can’t give you the link of that page, it’s a private page.
But the code integrated is :

<script type="text/javascript" id="hs-script-loader" async defer src="//js.hs-scripts.com/XXX.js"></script>
<% if current_user %>
  <script>
    var _hsq = window._hsq = window._hsq || [];
    _hsq.push(["identify",{
        email: '<%= current_user.email %>'
    }]);
    _hsq.push([‘trackEvent’,{ email: ‘<%= current_user.email %>’ }]);
    _hsq.push([“trackPageView”, {email: ‘<%= current_user.email %>’}]);
  </script>
<% end %>

Thanks


#4

Hi @Matthieu_Brau,

Can you remove the JSON object with email from the trackPageView call? That call doesn’t take any additional parameters.


#5

Hello Derek,

I try these two solutions (after _hsq.push([“identify”,{email: ‘<%=
current_user.email %>’}]):wink: :
_hsq.push(“trackPageView”);
_hsq.push([“trackPageView”]);

Nothing happend…

Thanks

<+33681277754>
https://jerevedunemaison.typeform.com/to/SLCKTu?social=signature_email_mb


#6

Hi @Matthieu_Brau,

That appears like it should function correctly. The only other thing I can think of would be that the email address inside the identify call might be malformed somehow. It’s difficult to troubleshoot this issue without being able to take a look at the page; is there a way you could give me an example of a public page, or perhaps direct message me the page URL so that the page isn’t made public?


#7

Hello Derek,

The email address is a little bit special in fact. There is “+” character
in the address
I add “+px310118” to add several contact with same emails address.
On hubspot interface, users with such email address have been created
throught api without any problem.

To test, you can go on our homepage :


The code is not implemented, but you can use chrome js console to do it :
var _hsq = window._hsq = window._hsq || []
_hsq.push([“identify”,{email: ‘xxx+test05012018@gmail.com’}]);
_hsq.push([“trackPageView”]);

I make a test with an email address without “+” and i can see a track
request in network console.
But nothing is loggued in the contact page on hubspot (still no activity
and 0 visite)

Thanks

<+33681277754>
https://jerevedunemaison.typeform.com/to/SLCKTu?social=signature_email_mb


#8

Hi @Matthieu_Brau,

Are you testing this on a filtered IP? The tracking code API filters our analytics information (including identify calls) from filtered IP addresses. I just did some testing from a non-filtered IP and I found that the identify call was successful:

https://app.hubspot.com/contacts/3800700/contact/1196301/?interaction=note


#9

Hello Derek,

I will continue to check, but it looks working fine now.

Thanks for your time

<+33681277754>
https://jerevedunemaison.typeform.com/to/SLCKTu?social=signature_email_mb