Description
We are running Consent Pro on a Webflow site that also contains a pop up embed form, which contains a HubSpot embed.
The HubSpot form is a Designer Embed element placed directly in a page’s content, rather than a site-wide script registered through Webflow’s Scripts API or Consent Pro’s script-blocking dashboard, so I believe it’s firing in parallel with the Consent Pro script, and not after a consent decision.
Is there a way I can configure the Consent Pro script, to forcibly gate the HubSpot script so that it’s not allowed unless the user accepts the Consent Pro consent banner?
Hey @spiritus-webmaster!
You’re spot on with the diagnosis — Designer Embed elements execute their scripts at parse time, before Consent Pro can intercept them. That’s exactly why the HubSpot form isn’t being gated automatically.
The fix is to modify the HubSpot embed code directly inside your Designer Embed element. Here’s what to change:
For any <script> tags in your embed:
<script type="fs-consent" fs-consent-categories="marketing" src="[your-hubspot-script-src]"></script>
For any <iframe> elements:
<iframe fs-consent-src="[your-hubspot-iframe-src]" fs-consent-categories="marketing" ...></iframe>
Three things are happening here:
- Change type to
fs-consent on scripts — this stops execution at parse time
- Replace src with
fs-consent-src on iframes
- Add
fs-consent-categories="marketing" to assign the right consent category
HubSpot forms typically fall under marketing, but if the embed is also doing analytics tracking you can combine them like fs-consent-categories="analytics,marketing".
If you’d rather inject the script dynamically after consent is granted, there’s also a callback queue approach:
<script>
window.FinsweetConsentPro = window.FinsweetConsentPro || [];
window.FinsweetConsentPro.push([
'consent',
(FinsweetConsentPro) => {
if (FinsweetConsentPro.consents.marketing) {
const script = document.createElement('script');
script.src = '[your-hubspot-script-src]';
document.head.appendChild(script);
}
},
]);
</script>
This keeps the embed container empty until consent is granted, then injects the HubSpot code on the fly.
If you share your actual HubSpot snippet we can walk through exactly where each attribute goes 