Theres 2 ways to look at this in my opinion, theres a more technical way which will be option 2 in this thread, then theres a more streamlined way that ive seen consent mode success with.
Streamlined:
1) The first part is ensuring youre conesnt banner in HubSpot is active, whether external or not. For example, I have a client with 3 consnent banners on 3 different domians, external and hubspot hosted:
Implement your html onto your website via the tracking code - you can do this via GTM or in Webflow:
Once Google Tag Manager is stitched up with your site and your site has the HubSpot consent banner code also on there - you will be good to go consent banner wise.
Very important: in GA4, once you stitch up your consent banner, you should see 2 green checkmarks ensuring you’re consent mode v2 complaint; you can see this in “Data Stream” in your GA4 Admin settings:
If these signals are active, you’re compliant.
Now there are more specific items that live in consent mode v2 such as Enhanced Conversions in Paid Ads world. For example, on HubSpot form submits, you can have user 1st party data - e.g., email, also go to Google Ads & GA4, on top of HubSpot:

More technical:
2) Integrating HubSpot’s cookie consent management with GTM and GA4 on a Webflow site involves several steps and (potentially) custom JS code.
I’m assuming youve stitched up your HubSpot Consent banner with Webflow via the tracking code, right?
On the off chance you have not, here’s the how to for convenience:
- In HubSpot, go to your account settings to find the tracking code.
- In Webflow, navigate to your project settings.
- Go to the Custom Code section and paste the HubSpot tracking code in the head or footer code sections. This ensures the HubSpot cookie banner and tracking functionality is loaded on all pages of your site.
After this is set up, given that GTM and GA4 integration options in HubSpot mainly apply to HubSpot-hosted pages, you’ll need to now manually configure GTM and GA4 to respect the consent settings managed by HubSpot’s cookie banner. This includes:
- Using GTM’s Consent Management features (akin to consent mode v2) to configure the consent initialization event.
- Create trigger(s) based on the HubSpot cookie consent state.
- Modify your GA4 configuration tag in GTM to fire based upon the consent triggers you’ve set up.
You want to ensure that the consent categories in HubSpot match those used by GTM and GA4.
Also, you may need to add a custom JavaScript snippit under the custom code tag to listen for consent changes from the HubSpot cookie banner and then pass those consents to GTM. This script should map the HubSpot consent categories to the consent settings used in GTM and GA4, ensuring that analytics tracking is only enabled when consent is given.
Below is an example JavaScript snippet that demonstrates how you might listen for consent changes from the HubSpot cookie banner and then communicate those consent states to GTM. This script assumes you’ve already configured GTM to handle consent states appropriately, which might involve setting up custom events or variables in GTM based on user consent.
This example script is for illustrative purposes. You might need to adjust it based on your specific consent categories, the details of your HubSpot setup, and how you’ve configured GTM.
Notes:
- HubSpot Event Type: This script listens for messages from the HubSpot cookie consent banner using window.addEventListener. The specific event type ‘hsCookieConsent’ and data structure (event.data.data.categories.analytics) are based on a simplified interpretation of how HubSpot might communicate consent. You’ll need to verify the actual event type and data structure based on HubSpot’s implementation.
- GTM Custom Events: The script uses dataLayer.push() to communicate consent states to GTM through custom events (‘analyticsConsentGiven’ and ‘analyticsConsentRevoked’). You will need to create these custom events in GTM and configure your tags to trigger based on these events.
- Consent Categories: This example focuses on a single consent category (analytics). If your website uses multiple categories (e.g., marketing, functional), you’ll need to expand the script to handle each category separately.