APIs & Integrations

Not applicable

Angular 5 integration with hubspot

Hi Hubspot team,

Currently the hubsport script js only track for the first load of angular app. If we change the route, it will disabled it.

As we need to integrate this for the user can tracks the activity on the page. What other method should i use? is it the hubspot plugin already compatible with Single Page Application (SPAs)?

0 Upvotes
5 Replies 5
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

Angular 5 integration with hubspot

Hi @FAIZ_ASYRAF,

Like Tim touches on above, you can programmatically set the page path your visitors are on using the Tracking Code API:

Alex808
Participant

Angular 5 integration with hubspot

Hello Derek

I have seen your comment about Set page path in Angular project. Also, I have followed the link you shared.

But I am not sure where to put the script 'var _hsq = ......' in order to set the path and the track page view.

Does it have to be placed in the body tag of the 'index.html' or somewhere else? Considering I am currently using Angular 9.

Any advice will be very heplfull!!

0 Upvotes
Not applicable

Angular 5 integration with hubspot

Hi @Derek_Gervais , yes this solution works for me. thank you for your help and support on this.

Really appreciate it :slight_smile:

0 Upvotes
Tim_Joyce_Belch
Member

Angular 5 integration with hubspot

@FAIZ_ASYRAF - does the event tracking javascript api help fit your needs?

0 Upvotes
Not applicable

Angular 5 integration with hubspot

Hi @Tim_Joyce_Belch, yes this solution works for me. thank you for your help and support on this.

Really appreciate it :slight_smile: