HubSpot Tracking Code Via Google Tag Manager

Hi,
I am trying to install the HubSpot tracking code on one of my demo account using Google Tag Manager.
The code inside Google Tag Manager (trigger for all pages) fires in the testing screen. (See screenshot below).
However when I click on it the code seems to be altered to something like:
`
<script type=“text/gtmscript” id=“hs-script-loader” async defer data-` +
`gtmsrc=“//js.hs-scripts.com/1234567.js”></script>
Vs
The original code that I added in GTM
<!-- Start of HubSpot Embed Code -->
<script type=“text/javascript” id=“hs-script-loader” async defer src=“//js.hs-scripts.com/12345671.js”></script>
<!-- End of HubSpot Embed Code -->
I am using HubID: 1234567 as example.
Our developers are saying that the GTM trigger is not actually triggering the HubSpot but I can’t understand why that would take place since the Google Tag Manager is saying Yes.
The URL we are using for test is a digital brochure: https://demorahul1.funstorytotell.com/
Now because the code is not triggering obviously the pageview is not being logged for a contact.
All we want is to confirm the pageview being logged for a contact and the code firing under GTM.
If there is someone who used GTM can you take a look at this.

Hi @rahul_inbound,
Thank you for asking the Community!
First, I’d like to share these resources that might be of interest to you:
- Add the Google Tag Manager code to HubSpot content
- Install the HubSpot tracking code
I’d like to invite a couple of subject matter experts and some of our Community Members to this conversation: Hi @LMeert, @RBRESK, @JAalbers, @LMcNair, @Teun and @JBhathena do you have suggestions to help @rahul_inbound, please?
Also, if anybody else has anything to add and/or share, please feel free to join in the conversation :slightly_smiling_face:
Thank you very much and have a lovely day!
Best,
Bérangère

Hey @rahul_inbound you seem to have implemented the HS snippet correctly but when I check the source code on the demo link you shared I could not find it there, can you make sure that you have published the GTM container.
To verify whether the HubSpot snippet is working
- Open up the networ requests tab
- Check for requests like “https://js.hs-analytics.net/analytics/1718010300000/{account_id}.js”
And the Status Code: 200 OK

I cannot find your HS script neither in main or external JS files (even with errors if it has them). Tag is probably not triggering or not published, although your screenshot suggests differently.
Best course of action would be to give an access to GTM for further inspection.

I’m guessing the GTM container is not published. That’s why you see it in your testing screen, and your developers can’t find it. I also don’t see a tracking code on the page you linked.
In the GTM preview mode you may see the script altered, like the example below, but when you publish the GTM container it won’t be altered. Here you find some documentation about publishing a GTM container: Publishing, versions, and approvals - Tag Manager Help