Marketing Integrations

ashwinsande
Member

How to place a Javascript SDK inside a Hubspot iFrame form?

SOLVE

We want to start capturing form submit events inside a Hubspot iFrame form. Is there a way to place a custom JS SDK inside a Hubspot iFrame form?

0 Upvotes
1 Accepted solution
Kevin-C
Solution
Recognized Expert | Partner
Recognized Expert | Partner

How to place a Javascript SDK inside a Hubspot iFrame form?

SOLVE

Thanks for the heaads up @danmoyle 


Hey @ashwinsande 

 

Integrating a build step into your development flow might just solve this for you rather easily!
This could be done using NPM and specifying the SDK as a dependency for the project. The awesome product development team at HS has provided a few JS framework boilerplates that could give ou some ideas!

 

Another options would be to use the require_js hubl tag to include the JS into your module or layout.

 

Hope this gets you going!

Kevin Cornett - Sr. Solutions Architect @ BridgeRev

View solution in original post

5 Replies 5
Kevin-C
Recognized Expert | Partner
Recognized Expert | Partner

How to place a Javascript SDK inside a Hubspot iFrame form?

SOLVE

In terms of injecting scripts into an iframe, im affraid that would be a CORs violation and is not viable.

Kevin Cornett - Sr. Solutions Architect @ BridgeRev
0 Upvotes
Kevin-C
Solution
Recognized Expert | Partner
Recognized Expert | Partner

How to place a Javascript SDK inside a Hubspot iFrame form?

SOLVE

Thanks for the heaads up @danmoyle 


Hey @ashwinsande 

 

Integrating a build step into your development flow might just solve this for you rather easily!
This could be done using NPM and specifying the SDK as a dependency for the project. The awesome product development team at HS has provided a few JS framework boilerplates that could give ou some ideas!

 

Another options would be to use the require_js hubl tag to include the JS into your module or layout.

 

Hope this gets you going!

Kevin Cornett - Sr. Solutions Architect @ BridgeRev
Akhil13
Member

How to place a Javascript SDK inside a Hubspot iFrame form?

SOLVE

Hey @Kevin-C . We wanted to do some email validation on the calendar schedule form iframe. How will we be able to inject our script via npm into the form iframe as it is hosted by hubspot? Could you elaborate a bit more on this?

0 Upvotes
Kevin-C
Recognized Expert | Partner
Recognized Expert | Partner

How to place a Javascript SDK inside a Hubspot iFrame form?

SOLVE

Hey @Akhil13 you would want to create a custom forms module using the hubspot CLI to incorporate your build step.

Kevin Cornett - Sr. Solutions Architect @ BridgeRev
danmoyle
Most Valuable Member | Elite Partner
Most Valuable Member | Elite Partner

How to place a Javascript SDK inside a Hubspot iFrame form?

SOLVE

Hi @ashwinsande. I'm checking with my teammates on this. I'm not a developer, so I'll ask my expert friends. 😁

 

Did my answer help? Please "mark as a solution" to help others find answers. Plus I really appreciate it!


Dan Moyle

HubSpot Advisor

LearningOps | Impulse Creative

emailAddress
dan@impulsecreative.com
website
https://impulsecreative.com/