Skip to main content
Auto Form Builder
Download FREE
Docs

Ad Tracking

Ad tracking

This free add-on remembers the ad click IDs and UTM parameters a visitor arrived with, and lets you add them to form entries and webhooks. The values are saved in a first-party cookie named afb_attr.

Set it up

  1. Open the Add-Ons screen, click Activate on Ad Tracking, then Settings.
  2. Keep Capture ticked. It saves ad click IDs and UTM parameters in the afb_attr cookie.
  3. Set Cookie lifetime to the number of days the values should be kept, and click Save Changes.
  4. In the form builder, add a Text Input, turn on Hidden Field, and enter a tag such as {utm_source} as its Hidden Value. Save the form.

What gets saved

  • Click IDs: fbclid, gclid, gbraid, wbraid and msclkid.
  • UTM parameters: utm_source, utm_medium, utm_campaign, utm_term, utm_content and utm_id.
  • Only visits that carry such parameters change the cookie. Normal visits leave it alone.
  • The Meta _fbp and _fbc cookies are read as {fbp} and {fbc}, but never written.

Latest visit and first visit

Tags without a prefix, such as {utm_source}, hold the latest visit with campaign parameters. Tags that start with first_, such as {first_utm_source}, keep the first one. For example, a visitor who first came from a YouTube ad and later from a Facebook ad sends facebook in {utm_source} and youtube in {first_utm_source}.

Other tags include {first_landing_url}, {first_referrer}, {last_landing_url}, {last_referrer} and {click_time}. The full list is on the Ad Tracking settings page.

Webhooks

The same tags work in webhook JSON templates, so you can send them to a CRM or another app.

Ask your visitors for consent first where the law requires it.

Related: Ad Tracking · Hidden Fields · Webhooks. · Capture the Google Ads GCLID · Capture the Facebook click ID · Landing page and referrer · Send lead source to Google Sheets

Updated

Was this helpful?