GTM/GA - insert code in header/footer, or use Pages > Integrations?


Hi there


*First post alert - go easy on me!* 😉 


We use Google Analytics (and Google Ads, Hotjar, etc), and our new site wasn't getting great scores using the Google Page Speed Insights tool, so I decided to switch to Google Tag Manager to manage our tags and use sequencing etc. 


This all appears to be working fine and our score has improved significantly but when I look at the site code in Chrome developer tools I see that Google Analytics still appears to be firing, outside of GTM. (I have cleared all code from the header/footers for this domain, and there are no 'all domains' headers or footers set up)


This got me hunting around Hubspot settings... If I naviage to Pages > Integrations, I realise at some point I integrated Google Analytics here, by ticking the box and adding the UA code. 


Question - do I need to clear this off now GA tracks using GTM? (i.e. is it 'double firing'?) Or, alternatively, should I remove it from GTM and leave this integration here for any reason? (i.e., is it 'better' in anyway than manually having the code in header/footer?)


Additionally, I noticed on this same page you can now integrate directly with GTM - would that be a 'better' way to do it then manually add the GTM code in header/footer for the site? 


Any advice greatly appreciated! 


Thanks,  Caroline

1 Reply 1
HubSpot Employee

Hey @Crosswalk,


Welcome! 🙂 


If you track based on the integrations, do note that these integrations will only track users who have opted in to allow cookies if your HubSpot cookie banner is set to require opt-in. Learn more.