Marketing Agencies

Lead attribution for agencies: report leads per client, not traffic

A client asks which Google Ads campaign produced last month's enquiries. A traffic chart does not answer that. SourceTag writes the channel, campaign, keyword and click ID onto every form submission on each client's site, so the answer is sitting on the lead records in their CRM. One account covers up to 30 client domains, each with its own script and channel rules.

14-day free trial · No credit card · Set up in 5 minutes

  1. Google Ads

    "car accident lawyer"

    First click
  2. Blog post

    12 days later, via search

  3. Contact form

    Submitted on mobile

    Last click

Sarah Mitchell

New lead in your CRM

Source attached
Channel
Paid Search
Campaign
pi-brand-search
Keyword
car accident lawyer
Landing page
/personal-injury
First click Google Ads Last click Organic search 3 visits · 12 days

The problem

A client asks where their leads are coming from and the honest answer is a Google Analytics traffic chart. Traffic isn't leads. What you need is each form submission tied to the campaign and channel that produced it, on every client site you run.

How SourceTag helps

Each client site gets its own SourceTag setup and channel rules. You can see which campaigns produced form submissions and report lead sources instead of pageview estimates.

What lands in your CRM

Every form submission is tagged as it is sent. Your team reads the source next to the name and the phone number.

Lead source

Channel, source, campaign and keyword. First click and last click on the same record.

Ad click IDs

gclid, fbclid, msclkid and ttclid. Match each lead back to the exact ad that created it.

Visit history

Visit count, days to conversion, device and landing page, so whoever picks up the lead knows the story before they call.

Examples for marketing agencies

A client asks which Google Ads campaign generated the most enquiries last month. You pull the data from their CRM.

You need to prove your SEO work drives leads, not just rankings or traffic.

A client wants to know if Facebook ads generate real enquiries or just clicks.

Channels set up by default

Every visit is sorted into a channel as it happens. If our channels don't match how you report, change the rules or add your own.

Paid SearchPaid SocialOrganic SearchOrganic SocialAI ReferralEmailDisplayPaid VideoAffiliatesReferralDirectOther Campaigns

Set up in 5 minutes

Step 1

Add the script

One line in your site header, or install the WordPress plugin.

Step 2

Add hidden fields

Works with any form builder. Gravity Forms, HubSpot, Typeform and 60 more.

Step 3

Every lead is tagged

Channel, campaign, keyword and landing page, wherever your forms already send data.

What clients actually ask for

Clients pay for enquiries. The ad platforms report clicks and platform conversions, and Google Analytics reports sessions. None of those tell the client that 14 of last month's 40 enquiries came from the emergency plumber campaign and 3 came from the brand campaign. When the report and the CRM disagree, the client believes the CRM.

So put the source on the lead itself. Once each enquiry carries its channel, campaign and keyword, the client's own CRM becomes the report, and you can count enquiries per campaign instead of estimating them. In the agency client retention statistics we collected, 55% of agencies say clients regularly ask whether marketing connects to revenue. That question needs lead-level data to answer.

One account, one site per client

Each client domain is a separate site in your dashboard. Every site gets its own tracking script with a unique Site ID, its own channel rules, its own field settings, its own _sourcetag cookie and its own submission count. Changing one client's setup never touches another's.

Multi-site covers 10 domains for 189 US dollars a month, and Multi-site Plus covers 30 domains for 349 a month. Both include unlimited submissions and every feature, and both have annual billing. Subdomains share the root domain's cookie, so www.client.com and book.client.com are one site, not two. When a client leaves, delete their site to free the slot and remove the script tag from their pages. The add a site guide covers the details.

Rolling it out across 12 client WordPress sites

The field names are the same on every site, so once you have built the hidden fields for one client you can reuse the same form setup everywhere. The only thing that differs per site is the Script URL.

Step 1

Add each client as a site

On the Sites page click Add Site, enter the client name and their domain. The site starts with the 12 default channel rules and the core fields switched on.

Step 2

Install the plugin and paste the Script URL

Install the SourceTag WordPress plugin, go to Settings > SourceTag and paste that client's Script URL from their site page. For clients not on WordPress, paste the script tag into the site header or add it as a Custom HTML tag in their Google Tag Manager container.

Step 3

Turn on server-side cookies

Tick Enable server-side cookie setting in the plugin. Safari and every iOS browser cap JavaScript cookies at 7 days, and most lead-gen clients have prospects who take longer than a week. The plugin re-sets the cookie from PHP so it lasts up to 400 days. For a Webflow or Squarespace client behind Cloudflare, the [Cloudflare Worker](/docs/cloudflare-worker-cookies) does the same job.

Step 4

Add the hidden fields to each form

Add a hidden field for each SourceTag field name to the client's enquiry forms. Gravity Forms, WPForms, Contact Form 7 and Elementor Forms all work, and each has its own guide in the docs. Copy the names from the Fields page rather than typing them. A one-character typo leaves the field empty.

Step 5

Map the fields into the client's CRM

Create matching custom fields in the client's CRM and map them in whatever sends the form there, whether that is a native integration, Zapier or Make. Use readable labels such as First Click Campaign, because the client's sales team will be reading them.

Step 6

Send a test lead per site

Visit each site in an incognito window with UTM parameters on the URL, submit the form and check the record in the CRM. The dashboard also shows the submission count per site, which is a quick way to spot a client whose forms stopped sending data.

Channel rules that match each client's tagging

Rules are set per site. One client's email platform tags links with utm_medium=newsletter, which already lands in Email. Another client's old agency used utm_medium=paid_social on Meta ads, so you add that value to Paid Social on that client's site only. A client with a partner programme can get its own Partner channel, placed above Affiliates so it matches first.

Custom parameters cover the cases UTMs do not. For a client with five locations on one domain, add location as a custom parameter and tag ads with location=north-shore. The value arrives in st_fc_custom_location and st_lc_custom_location. The channel rules guide and custom parameters guide have the full options. Rule changes take effect once the CDN cache refreshes, usually within an hour.

Keyword to enquiry, and closed leads back into Google Ads

On Paid Search the four detail fields hold the source, campaign, keyword and ad content. Add a tracking template at the account level so every click carries readable values, and each lead then shows the keyword that triggered the ad. {keyword} is the matched keyword, not the exact search term. The search terms report does not attach to individual leads.

The click ID group is on by default for new sites and puts whichever click ID was present into st_fc_click_id and st_lc_click_id, with the type alongside. If you upload offline conversions for clients, switch on the individual click ID group as well. It gives each platform its own field: st_fc_gclid, st_fc_fbclid, st_fc_msclkid and the same for last click. Export the leads the client marked as qualified or won, with their gclid, and import them into Google Ads as offline conversions. Bidding then works toward the leads the client wanted rather than every form fill. SourceTag captures the click ID. The upload is done from the CRM or by you.

{lpurl}?utm_source=google&utm_medium=cpc&utm_campaign={campaignid}&utm_term={keyword}&utm_content={creative}

What this does not cover

Phone calls. SourceTag tags form submissions only. For clients whose enquiries mostly come by phone, you need call tracking alongside it.

Lead data never comes through us. The attribution sits in a first-party cookie on the client's domain and is submitted with their own form, straight to their CRM or inbox. The dashboard shows submission counts, not names or emails, so client lead reporting happens in the client's CRM or in whatever reporting tool you already pull it into.

Each top-level domain has its own cookie. If a client runs a landing page on a separate domain from their main site, a visitor moving between the two has separate attribution on each. Forms inside a cross-domain iframe are also out of the script's reach, so read the values with the JavaScript API and pass them in yourself.

Frequently asked questions

Start with one form

14-day free trial · No credit card required