Cognito Forms tutorial

Stream Cognito Forms entries to Google Sheets

Cognito Forms delivers powerful repeating sections, payment processing, and calculations. Add LeadToSheet to capture every submission with UTM attribution and device data in Google Sheets, using Cognito's native JS embed.

CMS: Embed

Cognito Forms is a form builder with repeating sections, complex calculations, payment processing, and document merging. Its JavaScript embed renders forms directly in the host page DOM, making it a strong fit for LeadToSheet. Unlike iframe-based tools, Cognito's JS snippet gives LeadToSheet full access to form fields, enabling native capture of every field value, repeating section entry, and calculation result alongside marketing attribution data.

Implementation checklist

  1. 1

    Add the LeadToSheet SDK alongside the Cognito Forms embed

    Paste the LeadToSheet script tag on the same page as your Cognito Forms JavaScript embed. Since Cognito renders in the DOM, LeadToSheet captures form fields natively without any webhook setup required.

    LeadToSheet snippet

    <script src="https://cdn.leadtosheet.com/sdk.min.js" data-client="YOUR_CLIENT_KEY"></script>
  2. 2

    Test repeating sections thoroughly

    Cognito Forms allows users to add multiple entries within repeating sections (e.g., multiple attendees, line items). Submit a test entry with at least two repeating rows to confirm that LeadToSheet serializes them correctly into your Google Sheet columns.

    Tip: LeadToSheet flattens repeating sections into indexed columns like attendee_1_name, attendee_2_name. Review the column layout after your first test submission.

  3. 3

    Verify calculation and payment fields

    Submit a form that triggers calculations and a payment transaction. Confirm that computed values and payment confirmation details appear as columns in your Google Sheet.

Customization ideas

  • Capture repeating section data as structured rows

    For forms with repeating sections like order line items, configure LeadToSheet to create one sheet row per repeating entry rather than flattening everything into a single row. This works well for inventory or order tracking use cases.

  • Pair document merge data with lead attribution

    Cognito Forms can merge submission data into PDF or Word documents. After the document generates, use Apps Script to append the document URL to the LeadToSheet row, creating a complete record with both attribution and generated documents.

  • Build real-time financial dashboards

    Cognito's calculation engine handles pricing, taxes, and discounts. LeadToSheet writes the final calculated amounts to Sheets, where you can build pivot tables and charts for real-time revenue tracking by marketing channel.

Troubleshooting

  • Cognito JS embed loads form after DOMContentLoaded

    Cognito Forms renders its fields after the initial page load via its JavaScript embed. LeadToSheet uses mutation observers to detect dynamically rendered forms, but ensure the LeadToSheet script tag appears before the Cognito embed script so the observer is active when the form mounts.

  • Repeating section columns appear inconsistent

    When different submissions have varying numbers of repeating entries, column count may differ. Submit a test entry with the maximum expected number of repeating rows during setup to pre-create all necessary column headers.

  • Payment confirmation fields missing

    Cognito Forms processes payments through Stripe, Square, or PayPal. The payment confirmation renders in the DOM after the transaction completes. LeadToSheet captures the confirmation fields, but if the payment gateway redirects away from the page, the capture may not fire. Ensure your payment settings use in-page confirmation rather than redirect.

Frequently asked questions

Does LeadToSheet handle Cognito's repeating sections?
Yes. Repeating sections are serialized into indexed columns (e.g., item_1_name, item_2_name). For forms with variable-length repeating data, LeadToSheet dynamically expands the column set as new entries arrive.
Can I use both Cognito's email notifications and LeadToSheet?
Absolutely. LeadToSheet operates at the browser level and does not interfere with Cognito's server-side email notifications, workflow actions, or document generation.
Is the iframe embed option also supported?
Cognito's iframe embed restricts cross-origin access. For the best experience, use the JavaScript embed, which renders directly in the page DOM. If you must use the iframe, configure Cognito's webhook integration as a fallback.