Issue with HubSpot Forms not loaded in combination with Cookiebot and Tag Manager
Dec 30, 2020 1:04 AM - edited Dec 30, 2020 1:12 AM
I have the following situation:
- A WordPress website using Hubspot forms and a cookie consent from Cookiebot loaded via GTM.
- I've installed GTM via the Site Kit plugin (this method of installing doesn't provide me with adding custom code, but can be changed if needed)
- I use Hubspot forms both in pop-ups as directly embedded in the HTML of the page. Both ways use the HTML embed version from Hubspot Forms.
- The form is loaded when embedded directly in the page. When behind a button/inside the pop-up the forms are not loaded. This issue started after the monthly scan from Cookiebot, before that it worked fine.
- I've created an example page with both forms embedded for anyone who wants to help me solve this problem: https://founda.com/elementor-1840/
- In the console the following error message is shown: Couldn't find target container #hbspt-form-XXX for HubSpot Form XXX. Not rendering form onto the page (removed the codes with XXX)
- I've setup Cookiebot automatic blocking + did the installation through GTM.
- I've tried switching the cookies from Hubspot to various categories (Necessary, Statistics, Marketing) but have the feeling this is not the issue since the embedded form on the page itself is being loaded
- I've tried pausing the Hubspot script in GTM and add the following code from Cookiebot to the script / form from Hubspot (data-cookieconsent="ignore")
- Would be greatly appreciated if someone can shine some light on what is happening here.