ianboyte
(Ian Boyte)
January 4, 2023, 9:22pm
1
Is there a best practice implementation for embedding a hubspot form within a custom type/slice?
Hubspot provides a pair of scripts for embedding a form on your page, ex.
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/embed/v2.js"></script>
<script>
hbspt.forms.create({
region: "na1",
portalId: "5555555",
formId: "5555555-5555-5555-5555-555555555555"
});
</script>```
Pau
January 5, 2023, 8:13pm
3
Hello @ianboyte , you can create a custom code component in your Custom Types:
To add a custom embed code or raw HTML, you will first need to set up a unique field or Slice specifically for this. Then you will need to add code to your website application to handle this new field.
1. Create a new field for the HTML
You have two options, using a Key Text field or a Rich Text field.
with a Rich text field
We recommend you using a customized Rich Text field specifically for your custom code. You will need to configure the field to "Allow multiple paragraphs" and set the fi…
kris
(Kristiyan Bogdanov)
January 6, 2023, 9:05am
4
Hey @ianboyte , I've done this for many of my clients and the solution doesn't require injecting custom HTML. I'm quite busy right now, but I'll try to write and publish a tutorial over the coming days for you
2 Likes