Adding hubspot tracker in Anvil

What I’m trying to do:
Is there a way for me to add this Hubspot tracking code to my Anvil app? https://knowledge.hubspot.com/reports/install-the-hubspot-tracking-code

It is supposed to be added into the tag of the html code for each page. How do I do this in Anvil?

Code Sample:

<!-- Start of HubSpot Embed Code -->
  <script type=“text/javascript” id=“hs-script-loader” async defer src=“//xxx.js”></script>
<!-- End of HubSpot Embed Code -->`

Anvil apps are single page apps, so I doubt you will need to change the HTML (maybe I’m wrong, I haven’t read the documentation).

I think you should start from here: https://developers.hubspot.com/docs/api/events/tracking-code#tracking-in-single-page-applications

1 Like

Thank you! Solved my issue :slight_smile: