APIs & Integrations

ASavaliya
Participant

How to set tracking code in react js

Hello All,

 

can any one know how to set hubspot tracking code for react js app.

 

I refer this document https://legacydocs.hubspot.com/docs/methods/tracking_code_api/tracking_code_overview?_ga=2.132924617...

but not found soluation.

I also write code like this given in document. but after that i seen two time my tracking code load.

So any soluation ?

Thank you.

Ankur

0 Upvotes
3 Replies 3
RyanHilliard
Contributor

How to set tracking code in react js

Here are a couple things that can trip up sessions that we found. It is still not perfect within our own app but:

 

Do you use dynamic variables?

If it is a single page web app, did you account for those instructions further down on the support page?  

dennisedson
HubSpot Product Team
HubSpot Product Team

How to set tracking code in react js

Hey @ASavaliya 

I would recommend looking at a couple other posts that have been added to the community

@wmlutz  built a page listener component that he details here

@RyanHilliard also seems to have found a solution although he might need to add some details to explain his setup 😀

0 Upvotes
ASavaliya
Participant

How to set tracking code in react js

Hey @dennisedson 

 

I install tracking code but page visit count not reflate on hubspot.

After code is load first time in react.

 

Thank you

Ankur

0 Upvotes