ActiveCampaign logo

ActiveCampaign

ActiveCampaign attribution: lead source on every contact

ActiveCampaign tracks what a contact does after they subscribe. It does not record the campaign that brought them. Custom fields plus hidden fields on your form put the channel, campaign and keyword on the contact record from the moment it is created.

Your website

Script installed

SourceTag

Captures attribution

Your forms

Hidden fields sent

ActiveCampaign

Data arrives tagged

The problem

ActiveCampaign shows you the lead. It doesn't show you which campaign or keyword produced it, so you're stuck guessing what to spend more on.

How to set it up

SourceTag runs on your site and remembers how each visitor arrived. When they submit a form, hidden fields carry that history into ActiveCampaign, so the new contact already has its channel, source, campaign and keyword attached.

1

Add SourceTag to your site

Paste the script tag in your header, or use the WordPress plugin if that's easier.

2

Create matching fields in ActiveCampaign

Add contact or lead fields in ActiveCampaign named st_fc_channel, st_fc_detail_1 and so on. The setup guide has the full list.

3

Match hidden fields on your forms

Whatever builds your forms, add hidden fields with the same names so the data has somewhere to land.

4

Run a test lead through

Visit your site with ?utm_source=test&utm_medium=cpc, submit the form, and check the new record in ActiveCampaign.

Create the custom fields

Settings > Fields. Add a Text Input field for each SourceTag field, and put them in a field group called SourceTag Attribution so they do not clutter the contact view.

Twelve core fields: st_fc_channel, st_fc_detail_1 through st_fc_detail_4, st_fc_landing_page, plus the six st_lc_ versions. st_visits and st_days_to_convert are better as Number if you enable the visitor meta group.

ActiveCampaign builds the internal name from the label, and the internal name is what your form connection maps to. Check it after you save rather than assuming.

How the values reach ActiveCampaign

SourceTag does not talk to ActiveCampaign. It writes into your form, and your existing form-to-ActiveCampaign path carries the values across. That path is either an ActiveCampaign embedded form, a WordPress form plugin with an ActiveCampaign feed, Zapier, or a webhook.

Whichever one you use, map each st_ field to its custom field inside that connection. This is where most setups quietly fail: the field exists in ActiveCampaign, the hidden field exists on the form, and nothing maps them together.

ActiveCampaign's own embedded forms can carry the values if the form supports hidden fields. If it does not, use a form builder that does and connect it. WPForms, Gravity Forms and Jotform all have ActiveCampaign connections.

What each field holds

st_fc_channel is the channel from the contact's first ever visit, one of eleven: Paid Search, Paid Social, Organic Search, Organic Social, Email, Display, Paid Video, Affiliates, Referral, Direct or Other Campaigns.

The four detail fields adapt to the channel. On Paid Search and Paid Social they hold utm_source, utm_campaign, utm_term and utm_content. On Organic Search, detail 1 is the search engine and detail 2 the referrer URL. On Email, detail 1 is utm_source, which for an ActiveCampaign broadcast is whatever you set in the link.

st_fc_landing_page keeps the path and query string, with UTMs and click IDs removed. Enable the click ID group if you want st_fc_click_id and st_fc_click_id_type, or the individual group for st_fc_gclid and friends.

Using it in segments and automations

Once the fields are on the contact, they behave like any other custom field: build a segment on First Click Channel is Paid Search, or start an automation when Last Click Campaign contains a specific name.

The pairing that earns its keep is first click against last click. A contact whose first click is Organic Search and last click is Email tells you the blog found them and the newsletter closed them. Crediting either one alone gives you the wrong answer about where to spend.

Test it with a UTM link

Use a fresh email address. ActiveCampaign updates an existing contact rather than creating a new one, and some connections skip fields on an update, which reads as a tracking failure when it is not.

Submit, then open the contact and scroll to the SourceTag Attribution group. First Click Channel should read Paid Search, First Click Source google, First Click Campaign newsletter-promo. Blank rather than (not set) means the mapping in your form connection is missing, not the capture.

https://yoursite.com/subscribe?utm_source=google&utm_medium=cpc
  &utm_campaign=newsletter-promo&utm_term=marketing+automation

Safari, ad blockers and the seven day problem

Safari and all iOS browsers cap JavaScript cookies at seven days. If your list-building runs on content and people subscribe weeks after their first visit, most first click data will be gone by then. Set the cookie server-side: the WordPress plugin does it from PHP, the Cloudflare Worker does it for any site behind Cloudflare, and both give you 400 days.

Ad blockers rarely touch cdn.sourcetag.io because it is not on the standard filter lists. When one does, the subscribe still works and the st_ fields arrive empty.

Subdomains, popups and forms that load late

The cookie is set on the root domain, so www.yoursite.com and pages.yoursite.com share one attribution record without any configuration. Two separate top level domains each need their own site in the dashboard.

A form that appears after page load, in a popup or a slide-in, still gets filled. The script watches the page for forms that show up later rather than checking once and giving up.

A form inside a cross-domain iframe is out of reach. Read the values with the JavaScript API and pass them into the embed yourself.

Use Text Input rather than a dropdown for these fields. Campaign names change more often than anyone remembers to update an option list.

How data gets into ActiveCampaign

SourceTag doesn't connect to ActiveCampaign directly. It works through your forms. Whatever form builder you use, attribution data gets submitted alongside the lead's details and flows into ActiveCampaign through your existing form-to-CRM connection.

Any form builder that supports hidden fields will work:

Frequently asked questions

Related integrations

Start with one form.

The trial is 14 days and doesn't need a card.