Pipedrive
Pipedrive lead source tracking with SourceTag
SourceTag puts the channel, campaign, keyword and click ID on every Pipedrive lead that comes in through a form on your site. You create the custom fields in Pipedrive once, add matching hidden fields to your form, and your existing form-to-Pipedrive connection does the rest.
Your website
Script installed
SourceTag
Captures attribution
Your forms
Hidden fields sent
Pipedrive
Data arrives tagged
Your website
Script installed
SourceTag
Captures attribution
Your forms
Hidden fields sent
Pipedrive
Data arrives tagged
The problem
Pipedrive 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 Pipedrive, so the new contact already has its channel, source, campaign and keyword attached.
Step 1
Add SourceTag to your site
Paste the script tag in your header, or use the WordPress plugin if that's easier.
Step 2
Create matching fields in Pipedrive
Add contact or lead fields in Pipedrive named st_fc_channel, st_fc_detail_1 and so on. The setup guide has the full list.
Step 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.
Step 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 Pipedrive.
Field mapping
Each SourceTag form field maps to one Pipedrive custom field of the same name. The twelve core fields are always filled. The click ID and visitor meta groups are switched on by default for new sites, so most people create those too. Text is the right type for everything except st_visits and st_days_to_convert, which are Number.
Labels are for your sales team, so make them readable. Nobody remembers what detail 3 means, but First Click Keyword is obvious. The detail fields change meaning by channel: on Paid Search they hold utm_source, utm_campaign, utm_term and utm_content, and on Organic Search detail 1 is the search engine and detail 2 the referrer URL. The smart fields guide has the full mapping and the captured fields reference has every optional field.
SourceTag field Pipedrive label Type
st_fc_channel First Click Channel Text
st_fc_detail_1 First Click Source Text
st_fc_detail_2 First Click Campaign Text
st_fc_detail_3 First Click Keyword Text
st_fc_detail_4 First Click Ad Content Text
st_fc_landing_page First Click Landing Page Text
st_lc_channel Last Click Channel Text
st_lc_detail_1 Last Click Source Text
st_lc_detail_2 Last Click Campaign Text
st_lc_detail_3 Last Click Keyword Text
st_lc_detail_4 Last Click Ad Content Text
st_lc_landing_page Last Click Landing Page Text
Optional
st_fc_click_id First Click Click ID Text
st_fc_click_id_type First Click Click ID Type Text
st_lc_click_id Last Click Click ID Text
st_lc_click_id_type Last Click Click ID Type Text
st_visits Visit Count Number
st_days_to_convert Days to Convert Number
st_device Device Type TextSetup steps
You need admin access in Pipedrive and access to your website and form builder. The Pipedrive setup guide has the same steps in reference form.
Step 1
Install SourceTag on your site
Paste the script tag from your dashboard into your site header, or install the WordPress plugin. Check which field groups are on in the Fields page before you build the Pipedrive side.
Step 2
Create the custom fields in Pipedrive
Go to Settings > Company settings > Data fields and add one field per row of the table above. The setup guide uses the Person tab, because most form integrations create a person. If yours creates leads or deals instead, add them as deal fields. Pipedrive leads use the same fields as deals.
Step 3
Add hidden fields to your form
Add a hidden field to the form for each SourceTag field, with the st_ name as the field name. Copy the names from the Fields page rather than retyping them. A one-character typo leaves the field empty. Your form builder has its own setup guide in the docs.
Step 4
Map each field in your Pipedrive connection
In the native add-on, Zapier or Make step that sends the form to Pipedrive, map st_fc_channel to First Click Channel and so on down the list. If you post to the Pipedrive API yourself, use each field's API key from the "..." menu in Data fields.
Step 5
Send a test lead
Open your site in a private window with ?utm_source=google&utm_medium=cpc&utm_campaign=test on the URL, click through to another page, then submit the form with an email Pipedrive has never seen. Open the new record and check every field.
What a lead looks like afterwards
Say someone clicks a Google Ads ad for "crm consultant", reads your pricing page and leaves. Twelve days later they search your business name on Google, land on the home page and fill in the contact form. This is what arrives on the Pipedrive record.
First click keeps the ad that introduced them. Last click shows the visit that converted. Having both means you can choose per report, which first touch vs last touch explains. The landing pages have UTMs and click IDs stripped, so you see the path, not the tracking string. Fields with no value read (not set), which tells you the field was captured and was empty, as opposed to a mapping that never fired.
Twelve days is past Safari's seven-day limit on JavaScript cookies. On Safari, and on any iOS browser outside the EU, that first click only survives if you set the cookie from your server. See Safari cookies for the WordPress setting, the Cloudflare Worker and the data-server-cookie option.
First Click Channel Paid Search
First Click Source google
First Click Campaign crm-consulting-search
First Click Keyword crm consultant
First Click Ad Content rsa-v2
First Click Landing Page /pricing
First Click Click ID EAIaIQobChMI...
First Click Click ID Type gclid
Last Click Channel Organic Search
Last Click Source Google
Last Click Campaign https://www.google.com/
Last Click Keyword (not set)
Last Click Ad Content (not set)
Last Click Landing Page /
Visit Count 2
Days to Convert 12
Device Type DesktopWhy the labels above say Campaign for a referrer URL
In the example, Last Click Campaign holds a Google URL. That is not a bug. On Organic Search, detail 2 holds the referrer URL rather than utm_campaign, because a search visit has no campaign. If that reads badly in your Pipedrive views, label the fields by position instead, such as First Click Smart Field 2 (Campaign or Referrer), or turn on the raw UTM group and create st_fc_campaign and st_lc_campaign as well. Those always hold the literal utm_campaign value and stay empty when there is none.
Which forms this works with
SourceTag fills hidden inputs in forms that sit on your own pages. That covers WPForms, Gravity Forms, Contact Form 7, Jotform on its JavaScript embed, Webflow and plain HTML, sent to Pipedrive by a native add-on, Zapier, Make or a webhook. A form loaded in an iframe from another domain is out of reach of the script.
The setup guide does not cover Pipedrive's own LeadBooster Web Forms. Pipedrive added its own UTM capture to Web Forms in August 2026. How to capture UTM parameters in Pipedrive covers that route, along with Pipedrive's built-in Source fields and reporting in Insights.
How data gets into Pipedrive
SourceTag doesn't connect to Pipedrive directly. It works through your forms. Whatever form builder you use, attribution data gets submitted alongside the lead's details and flows into Pipedrive through your existing form-to-CRM connection.
Any form builder that supports hidden fields will work:
Frequently asked questions
The twelve core fields: st_fc_channel, st_fc_detail_1 to st_fc_detail_4 and st_fc_landing_page, then the same six with st_lc_. Add the click ID and visitor meta fields if those groups are on for your site. They are on by default.
No. Those are Pipedrive's own fields and keep working. Source origin tells you a record came from a web form, the chatbot or an import. The SourceTag fields tell you which channel, campaign and keyword sent the person who filled in the form.
In First Click Keyword (st_fc_detail_3) or Last Click Keyword (st_lc_detail_3) when the channel is Paid Search. It holds utm_term, so your ads need to pass the keyword in utm_term.
Yes, if you capture the click ID. The combined click ID group gives you the value and its type. Turn on the individual click ID group if you want st_fc_gclid and st_lc_gclid as their own fields. Export won deals with the gclid and upload them as offline conversions.
You get both on every record, so you can pick per question. First click shows what introduced the buyer. Last click shows what brought them back to convert. Our post on first touch vs last touch explains the trade-off.
Usually the hidden field names do not match the st_ names exactly, or the fields are not mapped in the Zapier, Make or add-on step. Test with a new email address too, because some integrations skip custom fields when updating an existing person. The testing guide in the docs shows how to check the values in the browser before the form submits.


