Sync Cognito Forms on WordPress to Google Sheets
Cognito Forms delivers payment-enabled forms with repeating sections and calculations. LeadToSheet captures every submission from the Cognito embed on your WordPress site, flattening complex data structures into clean spreadsheet rows.
CMS: WordPress
Overview
Cognito Forms embeds via an iframe and renders sophisticated forms with calculations, repeating sections, and payment processing. The SDK captures page-level context (UTM parameters, referrer) on the host page. For Cognito Forms submission data, use the webhook integration to send data to your LeadToSheet endpoint, where it is structured into spreadsheet columns that are immediately usable for reporting.
Implementation checklist
- 1
Install the LeadToSheet SDK on your WordPress site
Add the SDK to your WordPress page to capture UTM parameters and referrer data. For Cognito Forms submission data, configure Cognito Forms' webhook integration to send data to your LeadToSheet endpoint.
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 the Cognito Forms embed script is loaded
Cognito Forms requires its own embed script alongside the iframe. Confirm both the Cognito script and the LeadToSheet SDK are present in your page source by checking DevTools.
Tip: Use the Cognito Forms WordPress plugin for the simplest setup. It handles the embed script injection automatically.
- 3
Test repeating sections and payment flows
Submit test entries with multiple repeating section rows and complete a test payment. Repeating section data structure depends on how Cognito Forms serializes it in the webhook payload. Column naming in your sheet will match the field names from the webhook.
Customization ideas
Flatten repeating sections for analytics
Repeating section data arrives as structured fields from the webhook. Use Google Sheets formulas or Apps Script to split repeating entries into separate rows if needed.
Capture calculated field results
Cognito's built-in calculations (totals, discounts, tax) are included in the submission payload. These appear as dedicated columns so you can reconcile financial data without recalculating in Sheets.
Route order forms vs. inquiry forms
LeadToSheet auto-identifies each Cognito form via fingerprinting. Configure routing in the LeadToSheet dashboard to send order submissions to a fulfillment tab and general inquiries to a leads tab.
Troubleshooting
Cognito iframe does not communicate with the parent page
Cognito Forms renders in a cross-origin iframe. The SDK cannot capture submissions directly. Use the webhook integration for reliable capture.
Repeating section data appears in a single column
If repeating data is concatenated into one cell instead of separate columns, check that you are using the latest LeadToSheet SDK version. Older versions may not support Cognito's nested JSON structure.
Payment confirmation fields are missing
Cognito processes payments asynchronously. The payment status may not be included in the initial webhook payload. Ensure the Cognito Forms webhook is configured to send a follow-up notification after payment confirmation.
Resources
Frequently asked questions
- How does LeadToSheet handle Cognito's document generation feature?
- LeadToSheet captures the form field data used to generate documents. The generated document URL is not included in the submission payload, but you can add it via Cognito's webhook with a document link field.
- Are Cognito's conditional logic outcomes captured?
- Yes. Only fields visible at the time of submission are included in the payload, so your sheet reflects the exact data the user saw and submitted.
- Can I use Cognito's free tier with LeadToSheet?
- Yes. LeadToSheet works with all Cognito Forms tiers. The free tier includes up to 500 entries per month with basic fields, which are fully captured.
