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.

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

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 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
Leadand aform_leadevent in the GTMdataLayer. 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
Leadevent;with a Google Tag Manager ID, the form pushes
{ event: 'form_lead' }to thedataLayer. In GTM, create a Custom Event trigger with the event nameform_leadand 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:
to HubSpot, through the five UTM mappings in Form elements;
to your endpoint, in the
utmobject of the webhook payload.
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 withutm_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, andform_leadlands in the frame'sdataLayer, 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
Analytics: views, starts, completion rate and drop-off, measured by dForms.
Form elements: UTMs, score, outcome, submitted date: send the captured UTMs to HubSpot properties.
Landing page & HubSpot attribution: link submissions to the visitor's earlier page views in HubSpot.
Payload & headers reference: where the UTMs and the page sit in the webhook body.
Autosave, drafts & publishing: why the IDs wait for Publish.
Last updated