Skip to content

Regional forms script#4

Open
mattheu wants to merge 4 commits intomainfrom
regional-forms-script
Open

Regional forms script#4
mattheu wants to merge 4 commits intomainfrom
regional-forms-script

Conversation

@mattheu
Copy link
Member

@mattheu mattheu commented Sep 8, 2025

I spotted an issues with our hubspot form implementation.

  • Main issue is we're loading the region specific tracking script e.g. https://js-eu1.hs-scripts.com/123.js, but not doing the same for the form script. The default (js.) is North America. Should update that to match.
  • The documentation suggests the region prefix in the script src should be either js-eu1. or js.. If you specify north america, you currently get js-na1 which works fine, but is not documented.
  • Secondly, we're loading the form script https://js.hsforms.net/forms/v2.js but I can't find any mention of this file in the documentation. All references use https://js.hsforms.net/forms/embed/v2.js. update to match current documentation. Note actual files are currently identical.
  • Finally, I think we should specify the region when calling hbspt.forms.create the docs don't say it's optional - and don't say what it defaults to. . This is "The region of the account where the form was created.". We currently do nothing with this value. But we should add it to the config and I think it should behave like portalId by allowing you to set on global or block level.

I'm slightly unsure if there are there potential problems loading scripts from one region and then specifying the form for another?

@roborourke
Copy link
Collaborator

This is superceded now by #5, so should no longer be necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants