Dynamic Hubspot forms per blog page
-
For a B2B website I have 10 forms in Hubspot for specific services they provide.
Each product has its own blog/product page, made in Elementor and using the ACF(Advance Custom Fields) plugin.
These pages are populated using dynamic fields so that the client just adjusts these themselves.
These are headings, texts, images etc. But here I also want them to be able to add or select the right Hubspot form. This is the conversion that needs to happen on the page.
If anyone has made this work please let me know how you did it, my failed approach thus far:
My idea was to add a code block in the Elementor builder that then loads the code dynamically from the blog/product post. The same way I do headings. But this sadly does not work. It only renders a part of the code as plain text. For example:
The embed code (that works statically but here made anonymous):<script charset=”utf-8″ type=”text/javascript” src=”//js.hsforms.net/forms/embed/v2.js”>
</script>
<script> hbspt.forms.create({ region: “na1”, portalId: “12345678”, formId: “XXXX” }); </script>
On the rendered page it only outputs:
hbspt.forms.create({ region: “na1”, portalId: “12345678”, formId: “XXXX” }); as text inside a div.
Anyone have an idea to fix this.
Elementor does have native Hubspot support and I am talking to their support but no help so far.
- The topic ‘Dynamic Hubspot forms per blog page’ is closed to new replies.