Capture HubSpot WP Plugin Forms in Google Sheets
The official HubSpot WordPress plugin renders forms through HubSpot's JS engine inside your theme. LeadToSheet captures those submissions so your team gets real-time spreadsheet access without exporting from HubSpot CRM.
CMS: WordPress
Overview
The HubSpot WordPress plugin injects forms via a JavaScript embed rather than native HTML, which means the form DOM is generated dynamically after page load. LeadToSheet uses a MutationObserver to detect when HubSpot injects form elements into the DOM, then binds standard submit event listeners. When the HubSpot form renders as a native HTML form element, the SDK captures field values at submit time, giving you a live Google Sheets mirror of every lead without relying on HubSpot's export tools or API limits.
Implementation checklist
- 1
Add the LeadToSheet SDK to your theme
Place the script tag in your theme footer or use a header/footer injection plugin. It must load on every page where HubSpot forms appear.
LeadToSheet snippet
<script>(function(w,d,s,u,k,e){if(w.__formsync){return}w.__formsync={q:[],k:k,endpoint:e};var js=d.createElement(s);js.src=u;js.async=1;js.onload=function(){w.__formsync.init&&w.__formsync.init({ clientKey:k })};d.head.appendChild(js);})(window,document,'script','https://www.leadtosheet.com/sdk.min.js','YOUR_CLIENT_KEY','https://www.leadtosheet.com/api/ingest');</script> - 2
Verify HubSpot plugin form rendering
Open any page with a HubSpot form in DevTools and confirm the form is rendered inside a div with class `hbspt-form`. LeadToSheet binds to the standard DOM submit event on the form element that HubSpot renders. If HubSpot submits via AJAX without firing a DOM submit event, submissions may not be captured — use the webhook fallback in that case.
Tip: If you use the Gutenberg HubSpot block, the form loads via AJAX after page paint. LeadToSheet handles this with a MutationObserver, so no extra config is needed.
- 3
Submit a test lead and check your sheet
Fill in the form with sample data. Confirm that columns match HubSpot's internal field names (e.g. `firstname`, `company`) and that progressive profiling fields appear when triggered.
Customization ideas
Map progressive profiling stages
HubSpot rotates fields based on known contacts. Submit from both anonymous and known sessions so LeadToSheet creates all possible column headers upfront.
Route popup vs. embedded forms
HubSpot popup forms and inline forms fire different events. LeadToSheet auto-identifies each form via fingerprinting, and you can configure routing to separate sheet tabs in the LeadToSheet dashboard.
Preserve HubSpot tracking context
To correlate Google Sheets rows with HubSpot contact timelines, export the hutk cookie value via a HubSpot workflow or use the HubSpot API. The SDK does not read browser cookies directly.
Troubleshooting
Form renders but submissions are not captured
The HubSpot WP plugin loads forms asynchronously via the HubSpot JS API. Make sure the LeadToSheet SDK loads before or alongside the HubSpot embed script. If a caching plugin defers the SDK, switch to async loading with the `async` attribute.
Dependent fields not appearing in the sheet
Dependent (conditional) fields in HubSpot forms are only included in the payload when they are visible at submission time. Submit a test that triggers every dependent branch to pre-create all column headers.
Duplicate rows from non-HubSpot form plugins
If you also run Contact Form 7 or WPForms on the same page, LeadToSheet may capture both. Use form-level selectors in the LeadToSheet dashboard to scope capture to HubSpot forms only.
Frequently asked questions
- Does this replace the HubSpot CRM connection?
- No. Leads still flow into HubSpot CRM as normal. LeadToSheet provides an additional copy in Google Sheets for reporting, sharing with teams who lack HubSpot seats, or triggering automations in tools like Zapier or Make.
- Are GDPR consent fields captured?
- Yes. HubSpot consent checkboxes and communication preferences are captured as boolean columns so you can audit compliance directly in your spreadsheet.
- Will it work with HubSpot's non-WordPress embed code?
- This guide is specific to the WP plugin. For standalone HubSpot embeds on other platforms, see the general HubSpot Forms guide.
