Our situation
We run a multi-brand website built as a Nuxt 4 / Vue 3 app. Most of our lead forms
use a single HubSpot portal (our “global” account, portal A). One product line
(private lease) has its own separate HubSpot portal (portal B) with its own forms.
We’ve made the portal ID configurable per section, so private-lease forms embed with
portal B while the rest of the site uses portal A.
How we embed
Primarily the Forms v4 developer embed: https://js-eu1.hsforms.net/forms/embed/developer/{portalId}.js (region eu1),
reacting to the global hs-form-event:on-ready event and using window.HubSpotFormsV4.getFormFromEvent(...).
We also have a legacy path using hbspt.forms.create({ portalId, formId, target })
via forms/embed/v2.js.
The problem
When a single page needs a form from portal A and a form from portal B at the same
time, they conflict. Both portals’ embed scripts appear to register the same global
object (window.HubSpotFormsV4, and window.hbspt in the legacy case) and share one
global hs-form-event:on-ready stream. Loading two different portals’ scripts on the
same page overwrites each other’s globals, and forms / prefill / tracking for one of
the portals stop working. In practice it looks like only one portal ID can be active
per page.
Questions
Is embedding forms from two different portal IDs on the same page officially
supported with the v4 developer embed (and/or the v2 hbspt embed)? If not, why is
only one portal ID allowed per page?
Is the one-portal-per-page limitation about the analytics/tracking code (single _hsq/hub per page), about the forms embed script and its global objects, or both?
If multi-portal on one page is not supported, what is the recommended way to render
forms from two portals on the same page — e.g., iframe isolation, a specific
multi-portal embed option, or per-form portal scoping?
For the legacy hbspt.forms.create({ portalId }) API, since portalId is passed per
form call: can multiple portals coexist on one page there, and is that a supported/
stable pattern?
Do you have any best practice or roadmap for organizations that operate multiple
portals but occasionally need cross-portal pages?
Environment
HubSpot Forms v4 developer embed, region eu1, embedded in a Nuxt 4 / Vue 3 single-page
style app.
Hey @RKorsten4 and welcome back, it’s great to see you again on the HubSpot Community!
Great questions, thanks for asking!
At the moment, embedding HubSpot forms from two different portal IDs into the same page is not something we’d recommend.
HubSpot’s form embeds rely on page-level globals and event plumbing rather than isolated per-form runtimes, and rendering forms from two portals in the same window can fail because of shared singleton/global state.
For that reason, I would not recommend loading both portal A and portal B form embed scripts on the same page, whether through the v4 developer embed or the legacy hbspt.forms.create() path.
I’d love to hear from our Top experts: Hi @Anton, @nickdeckerdevs1 and @SteveHTM can you think of other ways to achieve this, please?
Thanks so much and have a brilliant day!
Bérangère
This post was created with the assistance of AI tools
My first question would be why you got two portals for such a use-case.
I mean, a dedicated portal for a single product line seems a bit overengineered to me.
If it’s because of something like team-access, data management or similar, you could think about business units (Marketing Enterprise). This would allow you to seperate access and data without relying on a second portal.
If you shouldn’t have Marketing Enterprise, you could create a similar setup with Team access permissions (available in all Pro and Enterprise tiers).
Building workflows, lists, reports, properties etc. for seperating those two things is easier than handling two portals at once imo.
As mentioned, I’ve never had such a case but something I could think of would be:
a delayed loading of the second form/script based on a choice in the first form
Build everything in form a and pass the data via API or a HubSpot app to portal b (this would make portal b more or less obsolete over time as the data would be available in portal a)
Put both forms into iFrames (def. not the best approach)
p.s. Personally I’m a big fan of legacy forms as the new forms (V4) are not even close to customization and “dev-friendliness”
Hi @Emmytech and thanks for sharing your thoughts here!
To help us dig a bit deeper (I see you said you didn’t mix two portals on a same page), can you share more about your use case for needing both portals on a single page?
We’re always interested in how Community Members are pushing the platform, and your feedback is valuable for ongoing improvements.
The recommended path here would be that, instead of embedding multiple forms from different portals on one page, use a centralized form in a primary HubSpot account with Multi-Account Workflows to route submissions and sync contacts across portals, enabling clean tracking and unified, cross-portal customer data visibility.