Article

    Capture Website Form Submissions

    5 min read
    Last updated 4 hours ago
    ws 75 ahoy

    Capture website form submissions

    Bring submissions from the forms on your website into Ahoy as contacts.


    Add the Ahoy tracking code to your website and form submissions flow straight into your CRM. Each submission creates or updates a contact, and you don't need to rebuild your forms.

    Before you start

    • Availability. Websites & Forms appears in Settings once form capture is turned on for your workspace. If you don't see it, contact the Ahoy team.
    • Permissions. An account admin needs to run the initial setup.
    • Website access. You need someone who can edit your website's code.

    Set up form capture

    1. Open the setting. Go to Settings → Marketing → Websites & Forms.
    2. Run setup. Under Tracking and capture, click Set up. Ahoy creates three automations, all switched on: Ahoy tracking code, Automatic form creation and Process form submissions.
    3. Copy the tracking code. Click Ahoy tracking code. The Overview tab shows the script snippet, already filled in with your workspace's unique ID.
    4. Add it to your website. Paste the snippet into your site's <head> section. In most site builders, this is under custom code in the site settings.
    5. Choose which forms to capture. Pick one of the two options below.
    6. Test it. Submit the form on your live site with an email address. The form appears under Forms on the same settings page, and the contact is created or updated in your CRM.
    7. Check the field mappings. Click the form under Forms and review Field Mappings. Email, first name, last name, phone and company are mapped automatically. Assign any other fields by hand.

    Choose which forms to capture

    • Specific forms. Add data-ahoy-capture="Form name" to each <form> element. The value becomes the form's name in Ahoy.
    • Every form. Add data-ahoy-capture-all-forms to the script tag. Ahoy names each form from its name , then its id , then the page path (for example, "Form on /pricing").

    You can combine the two. A tagged form is always captured and keeps the name you gave it.

    Good to know

    • A contact needs an identifier. A contact is only created if the form includes an email address or LinkedIn URL. Without one, the submission is only added to a contact that visitor is already linked to.
    • Existing data is protected. Email updates on every submission. Other fields only fill empty properties, unless you change the mapping's update mode to Always.
    • Capture-all skips some forms. With data-ahoy-capture-all-forms , forms with a password field and search forms are skipped. Add data-ahoy-ignore to a form to leave it out, or to a single field to exclude just that field.
    • Some fields are never collected. These are passwords, hidden fields, file uploads, and fields whose names contain sensitive words such as card, account, birth, token or auth. A field named account_name is dropped, so rename it if you need it.
    • Cookie consent. The snippet waits for consent before setting a cookie. Your consent tool should call window.ahoy.consentGranted() when a visitor accepts and window.ahoy.optOut() when they decline. Forms are still captured before consent, without a persistent visitor ID.
    • Global Privacy Control. Visitors whose browser sends this signal aren't tracked, and their form submissions aren't captured. Brave sends it by default, so run your test from another browser.

    Third-party forms

    Embedded forms from other providers are captured only with the every-form option, and only when the provider shares submission data with your page.

    ProviderCapturedNotes
    HubSpotYesAppears in Ahoy as "HubSpot form" plus a short ID
    MarketoYesAppears in Ahoy as "Marketo form" plus its ID
    TypeformNoThe embed doesn't share field values with your page
    JotformNoThe embed doesn't share field values with your page
    PardotNoThe embed doesn't share submissions with your page
    Google FormsNoThe embed doesn't share submissions with your page

    Need help?

    Email help@ahoy.ai or message us in your shared Slack channel.