For the complete documentation index, see llms.txt. This page is also available as Markdown.

Tracking & pixels

Add Google Tag Manager, Meta Pixel, PostHog or the HubSpot tracking code to a form's public page, understand when each tag fires, including the Lead conversion on a completed form, and see how UTM par

Tracking & pixels lets you measure the traffic that reaches a form with the tools you already use. You paste an ID, publish, and the matching tag loads on the form's public page. Nothing loads in the editor, and nothing loads for a tool whose ID you left empty.

This is optional. dForms already counts views, starts, submissions and drop-off on its own under Analytics; tracking IDs are for stitching form traffic into your own campaign reporting.


Step 1: Open the form in the editor and click the Connect tab. Scroll past Integrations to the Tracking & pixels section.

The Connect tab of the form editor showing the Integrations cards and the start of the Tracking and pixels section
The Connect tab holds Integrations, Tracking & pixels, Emails and Spam protection (captcha).

Step 2: Fill in only the fields for the tools you use. Every field is optional and independent.

The five tracking fields filled in, each with its help text: Google Tag Manager ID, Meta Pixel ID, PostHog project key, PostHog host and HubSpot tracking ID
Five fields, five tags. Leave a field empty and that tag is never loaded.
Field
What you paste
What it does on the form page

Google Tag Manager ID

GTM-XXXXXXX

Loads your GTM container so your tags fire, and pushes a form_lead event when someone completes the form.

Meta Pixel ID

123456789012345

Fires a PageView when the form loads, and a Lead when someone completes it.

PostHog project key

phc_...

Captures a pageview in PostHog for product analytics.

PostHog host (optional)

https://us.i.posthog.com

Defaults to PostHog US cloud; set your EU or self-hosted ingestion URL.

HubSpot tracking ID

12345678

Loads the HubSpot tracking code for your portal on the form page. If you embed this form in pages that already load your HubSpot tracking code, leave it empty: the embed passes the visit from those pages.

💡 Tip: The PostHog host field only matters if your project is not on PostHog US cloud. It must be a full address, for example https://eu.i.posthog.com. Anything else is refused with Enter a full http(s) URL, e.g. https://eu.i.posthog.com.


Step 3: Click Publish. Tracking IDs are part of your draft, so they only reach visitors once the form is published.

The staged banner above the tracking fields and the Publish button in the topbar, both outlined in red
The banner says it plainly: tracking IDs are staged with your draft, Integrations are not.

The banner above the fields reads: "These IDs are staged with the rest of your draft: click Publish to put them on the live form. Integrations above save to the live form immediately."

That difference is worth remembering:

  • Tracking & pixels: saved into the draft, live after Publish.

  • Integrations (webhook, HubSpot): saved to the live form the moment you change them, no publish needed.

See Autosave, drafts & publishing for the rest of the draft lifecycle.


When each tag fires

The rules are the same for every tool, so what you measure stays predictable:

  • Tags load only on the public form page. The editor, the preview and the admin never load them.

  • Each visit produces exactly one pageview: one GTM container load, one Meta PageView, one PostHog $pageview, one HubSpot tracking script.

  • Moving from one question to the next fires nothing. A slides form is a single page for your analytics, however many steps it has.

  • Completing the form fires one conversion: a Meta Lead and a form_lead event in the GTM dataLayer. See the next section.

⚠️ Note: dForms does not show a cookie or consent banner on the public form. If your visitors need one, handle consent in your own GTM container and gate your tags there.


The conversion on a completed form

When someone completes the form:

  • with a Meta Pixel ID, the pixel fires the standard Lead event;

  • with a Google Tag Manager ID, the form pushes { event: 'form_lead' } to the dataLayer. In GTM, create a Custom Event trigger with the event name form_lead and attach your conversion tags to it.

Three rules keep the count honest:

  • It fires only after dForms has saved the complete submission. A partial submission, or a send that failed, never fires it.

  • It fires once per visit. A double click, or a reload of the thank-you screen in the same tab, does not count twice.

  • It goes out before the redirect of the ending screen, so an ending that redirects with no delay does not cancel it.

LinkedIn, TikTok, Google Ads and everything else

There are only five fields, and there is no separate field for LinkedIn Insight, TikTok Pixel, Google Ads or any other tool. Load those through Google Tag Manager: set the Google Tag Manager ID here, then add each tag inside your container, with form_lead as the trigger for their conversion tags. One ID on the form, as many tags as you like in GTM.

UTM parameters are captured for you

You do not need a pixel to know where a lead came from. When someone opens a form with campaign parameters on the link, for example:

utm_source, utm_medium, utm_campaign, utm_term and utm_content are stored with the submission. From there they travel with the answer:

When the form is embedded with the full snippet, the UTMs of your page count too: if the iframe src has no utm_ parameters, the ones on your page's address are saved. See What your page tells the form.

The footnote under the fields says the same: "UTM parameters are captured automatically and can be mapped to HubSpot properties in Integrations."

⚠️ Note: utm_ keys are reserved for campaign capture. A question whose field key starts with utm_ is never prefilled from the URL. See Hidden fields & URL prefill.

Embedded forms

  • Tracking IDs set here load inside the iframe, on the form's own page, and fire there. The page around the form is not told: its own pixel or GTM container does not see the Lead, and form_lead lands in the frame's dataLayer, not in your page's.

  • Some browsers, Safari among them, limit tracking inside a frame from another site, so conversions from an embedded form are measured less reliably than on the direct link.

  • For HubSpot, an embedded form does not need the HubSpot tracking ID: the embed script passes the visit from your page. See Landing page & HubSpot attribution.

Page paths in your triggers

Form links have the shape https://app.dforms.ai/{account code}/f/{slug}. Older links carried a teammate's handle in place of the f, and Edit link can change the slug. A GTM or Google Analytics trigger that matches an older path with a handle only fires for visitors who still use that old link. A trigger for a slug you changed stops firing, because the old address sends visitors to the new one before any tag loads. Match on /f/{slug}, or on the slug alone. See Your public link.

What is collected

A form with no tracking IDs makes no requests to third parties, with one exception: with spam protection on, the Cloudflare check loads once the visitor starts answering (see its privacy notes).

dForms itself stores the answers, the score, the timestamps and the UTMs of a submission, plus the page it was answered on:

  • the page address: the form's own address with only its utm_ parameters on a direct link, your page's full address when the form is embedded with the full snippet, or what the browser reports as the referring page (usually just your site's domain) with a bare iframe;

  • the page title;

  • the visitor's HubSpot cookie, only when one arrived and the form's webhook or HubSpot integration will use it.

It does not store IP addresses, user agents, devices or countries. Read Security & Privacy for the full picture.

What's next

Last updated