APIs & Integrations

Matthieu_Brau
Member

Identify, trackPageView : no activity logged in user Hubspot page

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

0 Upvotes
8 Replies 8
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

Identify, trackPageView : no activity logged in user Hubspot page

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

0 Upvotes
Matthieu_Brau
Member

Identify, trackPageView : no activity logged in user Hubspot page

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

Derek_Gervais
HubSpot Alumni
HubSpot Alumni

Identify, trackPageView : no activity logged in user Hubspot page

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?

0 Upvotes
Matthieu_Brau
Member

Identify, trackPageView : no activity logged in user Hubspot page

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 :

Chasseur d'immobilier principal et secondaire - Je Rêve d'une Maison

Je Rêve d’une Maison est le 1er service de chasse immobilière 100% côté acheteur à Paris, petite couronne et France. Avec notre équipe de chasseurs immobiliers passionnés & motivés, nous trouvons


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

0 Upvotes
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

Identify, trackPageView : no activity logged in user Hubspot page

Hi @Matthieu_Brau,

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

0 Upvotes
Matthieu_Brau
Member

Identify, trackPageView : no activity logged in user Hubspot page

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

0 Upvotes
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

Identify, trackPageView : no activity logged in user Hubspot page

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?

0 Upvotes
Matthieu_Brau
Member

Identify, trackPageView : no activity logged in user Hubspot page

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

0 Upvotes