FormWake for HubSpot
Lazy-load HubSpot forms and meeting schedulers, keep them working with cookie banners and send clean dataLayer events to GTM.
Install in
FormWake for HubSpot embeds HubSpot forms (from the updated and the legacy form editor) and HubSpot meeting schedulers without the official HubSpot plugin. It focuses on three things:
- Performance: the HubSpot form script is only loaded when a form comes close to the viewport (IntersectionObserver). A placeholder with a fixed minimum height prevents layout shift (CLS).
- Cookie banners: the form script can be exempted from marketing consent blocking via a filter, so forms keep working for visitors who decline marketing cookies.
- GTM tracking: form events are pushed to
window.dataLayerashubspot_form_ready,hubspot_form_submitandhubspot_form_error(names configurable). Only IDs and the page path are sent – never field values or other personal data.
Assets are only loaded on pages that actually contain a form. No jQuery, no build step, no HTTP requests from PHP.
Benchmark
The same landing page with two HubSpot forms below the fold, once with HubSpot’s official embed code and once with FormWake. Simulated mid-range phone (4x CPU slowdown, 1.6 Mbit/s, 150 ms latency, empty cache), visitor stays at the top for 10 seconds. Median of 5 runs.
HubSpot embed FormWake:
- Transferred data: 2,486 KB 367 KB (−85 %)
- Requests to HubSpot: 72 0
- Page fully loaded (load event): 14.7 s 3.6 s (−76 %)
- Largest Contentful Paint: 3.8 s 3.4 s (−10 %)
- Total Blocking Time: 203 ms 30 ms (−85 %)
The forms still load as soon as a visitor scrolls towards them. If a form is visible right away, FormWake cannot make that form faster – it still skips the forms further down the page (−45 % transferred data in the same test). Results depend on your page, theme and hosting.
This plugin is not affiliated with or endorsed by HubSpot, Inc.
Requirements in HubSpot
- Forms from the updated HubSpot form editor work as they are. For forms from the legacy editor, add
legacy="1"to the shortcode. - Add your website domain in HubSpot under the tracking code / domain settings. HubSpot marks submissions from domains that are not added as spam.
- The developer embed (no iframe) requires a Marketing Hub or Content Hub Professional or Enterprise subscription.
Usage
Enter your portal ID and region under Settings FormWake. Then add the shortcode to any page (works in the block editor’s Shortcode block, Elementor, Divi and classic content):
[formwake id="FORM-UUID" min_height="400"]
id(required): the form ID (UUID) from the HubSpot embed code (data-form-id).min_height(optional, default 400, max 3000): placeholder height in pixels to avoid layout shift.legacy(optional): set to1for a form from HubSpot’s legacy form editor. Its embed code containshbspt.forms.create.
For a HubSpot meeting scheduler, use your meeting link from HubSpot Meetings (no portal ID needed):
[formwake_meeting url="https://meetings-eu1.hubspot.com/your-name"]
url(required): your HubSpot meeting link (meetings.hubspot.comormeetings-eu1.hubspot.com). You can paste thedata-srcfrom HubSpot’s embed code – parameters such as prefilled properties (?interesse_an=…) are kept. Use fixed values only – never personal data like an email address, as the link is visible in the page source.min_height(optional, default 700, max 3000): placeholder height in pixels.
To prefill personal values (e.g. from a link in an email), add them to the page URL instead, e.g. /contact/?email=… – HubSpot’s meetings script passes the page’s URL parameters to the scheduler. Note that such URLs also end up in server logs and analytics tools.
dataLayer payload
{ event, form_id, instance_id, page_path, conversion_id }
The conversion_id field is only included on successful submissions. Legacy forms send no instance_id. page_path contains the path without query string.
Cookie banner exceptions
Use the formwake_script_attributes filter to add attributes your consent tool needs to leave the scripts alone:
add_filter( 'formwake_script_attributes', function ( $attributes, $context ) {
$attributes['data-cookieconsent'] = 'ignore'; // Cookiebot
return $attributes;
}, 10, 2 );
The $context parameter is loader (this plugin’s own script tags) or embed (the HubSpot form and meetings scripts). Please check with your legal advisor whether loading the HubSpot form script without consent is acceptable for your use case.
External services
This plugin embeds forms from HubSpot (HubSpot, Inc.), an external service. Without it, the plugin has no function.
- What is loaded: the HubSpot form embed script from
js.hsforms.net(region na1) orjs-{region}.hsforms.net(e.g.js-eu1.hsforms.net), for legacy forms HubSpot’sv2.jsfrom the same host. This script then loads the form and further resources from HubSpot domains. - When: only on pages that contain the
[formwake]shortcode – with lazy loading enabled, only once a form comes close to the visible area of the page. - What data is sent: loading the script transmits the visitor’s IP address, browser information and the page URL to HubSpot, as with any external resource. When a visitor submits a form, the entered form data is sent to HubSpot and stored in the site owner’s HubSpot account. The plugin itself does not send any data to HubSpot from the server.
- Meeting schedulers: the
[formwake_meeting]shortcode loads HubSpot’s meetings embed script fromstatic.hsappstatic.netand the scheduler page frommeetings.hubspot.com/meetings-{region}.hubspot.com– only once the scheduler comes close to the visible area. When a visitor books a meeting, the entered data is sent to HubSpot and stored in the site owner’s HubSpot account. - Google reCAPTCHA: if CAPTCHA is enabled for a form in HubSpot, HubSpot’s form script also loads Google reCAPTCHA, which in turn loads fonts from
fonts.gstatic.com. This transmits the visitor’s IP address and browser information to Google. FormWake cannot prevent this – turn off CAPTCHA in the form’s settings in HubSpot if you do not want it. Google terms of service: https://policies.google.com/terms – Google privacy policy: https://policies.google.com/privacy - HubSpot terms of service: https://legal.hubspot.com/terms-of-service
- HubSpot privacy policy: https://legal.hubspot.com/privacy-policy
The dataLayer events are only written to the window.dataLayer array in the visitor’s browser. No data is sent to Google or any other service unless the site owner has installed Google Tag Manager (or a similar tool) separately.
Written by Joobi from the project's own listing. See the source page
0.8.0
- New: blocks “HubSpot form (FormWake)” and “HubSpot meeting (FormWake)” for the block editor – paste the embed code from HubSpot, set the placeholder height in the sidebar. The editor loads nothing from HubSpot.
- New: paste a HubSpot embed code on the settings page and get the FormWake shortcode – for forms, legacy forms and meeting schedulers. Warns when the portal ID or region does not match your settings and can fill them in.
0.7.1
- Change: the cookie banner preset no longer applies to meeting schedulers – HubSpot loads its tracking code inside the scheduler, so it keeps following your cookie banner. The filter receives the new context
meetings.
0.7.0
- New: setting “Cookie banner” with presets for Real Cookie Banner, CookieYes, Cookiebot, Usercentrics, OneTrust, Complianz and Borlabs Cookie; the settings page shows which cookie banner plugins are active.
- Fix: when a consent tool held back FormWake’s configuration and released it after consent, forms only appeared after a page reload.
0.6.0
- New: setting “Meeting link” (off by default) adds the path of the booked meeting link to
hubspot_meeting_bookedasmeeting, to tell several schedulers apart. - Plugin and author links to borkolabs.de.
0.5.0
- New: forms from HubSpot’s legacy form editor via
[formwake id="…" legacy="1"]– lazy-loaded, with the same dataLayer events (ready, submit with conversion ID, error). Entered values are never pushed. - Fix: a second form or scheduler that appeared while HubSpot’s script was still loading could stay empty.
0.4.0
- New: HubSpot meeting schedulers via
[formwake_meeting url="…"]– lazy-loaded like forms, also in popups and tabs. - New: dataLayer event
hubspot_meeting_booked(name configurable) when a visitor books a meeting. Only the event and the page path are sent – never the visitor’s name or email.
0.3.0
- Each form now loads on its own when it comes close to the viewport (previously all forms loaded with the first one).
- Forms in popups, tabs and accordions load when they become visible.
- Forms inserted later via JavaScript are detected automatically; new
window.formwake.scan()for custom scripts.
0.2.0
- Settings page redesign: status box, sections as cards, help sidebar with copy-to-clipboard shortcode, GTM and cookie banner tips.
- Admin CSS/JS are loaded on the FormWake settings page only.
0.1.0
- Initial release: settings page, shortcode, lazy loading, dataLayer events, script attribute filter.
0.5.0
- New: forms from HubSpot’s legacy form editor via
[formwake id="…" legacy="1"]– lazy-loaded, with the same dataLayer events (ready, submit with conversion ID, error). Entered values are never pushed. - Fix: a second form or scheduler that appeared while HubSpot’s script was still loading could stay empty.
0.4.0
- New: HubSpot meeting schedulers via
[formwake_meeting url="…"]– lazy-loaded like forms, also in popups and tabs. - New: dataLayer event
hubspot_meeting_booked(name configurable) when a visitor books a meeting. Only the event and the page path are sent – never the visitor’s name or email.
0.3.0
- Each form now loads on its own when it comes close to the viewport (previously all forms loaded with the first one).
- Forms in popups, tabs and accordions load when they become visible.
- Forms inserted later via JavaScript are detected automatically; new
window.formwake.scan()for custom scripts.
0.2.0
- Settings page redesign: status box, sections as cards, help sidebar with copy-to-clipboard shortcode, GTM and cookie banner tips.
- Admin CSS/JS are loaded on the FormWake settings page only.
0.1.0
- Initial release: settings page, shortcode, lazy loading, dataLayer events, script attribute filter.
Follow this listing's changes (Atom feed)