Get Started Log in
How it works

From first click to CRM contact

Sourcream follows a visitor from the ad, search or post that brought them in to the form they finally submit, then hands the whole story to your CRM. This is what happens at each step.

Step 01

The script records each visit

The script loads asynchronously on every page and weighs about 6.5 KB gzipped, so it never holds up rendering. On each page view it looks at how the visitor arrived: campaign tags, ad click IDs and the referring site.

  • The first visit and the latest visit that wasn't direct are kept in first party cookies for 180 days.
  • A new session starts after 30 minutes without activity.
  • Click IDs come from the URL, or from the cookies Google and Meta tags already set when the URL doesn't have them.
In the head of every page
<!-- Sourcream -->
<script src="https://cdn.sourcream.ai/t/YOUR_SITE_KEY.js" async></script>
Step 02

Every visit gets a source and medium

Rules are checked in order and the first match wins. Campaign tags always beat click IDs, and click IDs beat the referrer.

How the visitor arrivedSource / medium
A link tagged ?utm_source=newsletter&utm_medium=emailnewsletter / email
A Google Ads click (gclid, gbraid or wbraid)google / cpc
A Microsoft Ads click (msclkid)bing / cpc
A Meta ad click (fbclid)facebook / cpc, with the medium set per site
A link in ChatGPT, Perplexity, Claude or Geminichatgpt / ai and similar
Google search resultsgoogle / organic
A post on LinkedInlinkedin / social
A link in Gmail on the webgmail / email
Another websiteexample.com / referral
No referrer, or a payment or sign in page(direct) / (none)

TikTok, LinkedIn, X, Pinterest and Snapchat ad click IDs are recognised too. The full rule list is in the docs.

Step 03

The form carries the source

When a page has a form, the script adds hidden fields holding the current values, so the source travels with the submission into your form tool. As the form is submitted, the browser also tells Sourcream, which creates the lead.

  • Works on plain HTML forms, WordPress, Webflow, Squarespace, Typeform and Gravity Forms.
  • Forms handled on a server can post to your site's webhook intake instead, which keeps working even if the browser call is blocked.
  • Field names can be renamed per site to match the properties in your CRM.
Your contact form, after the script runs
<form action="/contact" method="post">
  <input name="email" type="email">
  <!-- added by Sourcream -->
  <input type="hidden" name="first_source" value="google">
  <input type="hidden" name="first_medium" value="cpc">
  <input type="hidden" name="last_source" value="linkedin">
  <!-- and the rest of the field set -->
</form>
Step 04

Your CRM gets the lead

Sourcream creates or updates the contact in HubSpot, Salesforce or Pipedrive, matched on email address, and fills in the attribution properties. Anything else can take the lead from a signed webhook.

  • Failed deliveries are retried automatically.
  • The delivery log shows every attempt, with a button to send it again.
  • Rather not send email addresses through us? Match on visitor ID instead: your form tool creates the contact and Sourcream fills in the source.
Step 05

Channels and source clean up

Every lead also gets a channel such as Paid Search, Organic Social or AI Assistants. Channels are worked out on our servers using GA4's default groupings, with extra groups for AI assistants and messaging apps.

On Business plans and above, Sourcream tidies inconsistent UTMs and uses AI to put referrers we haven't seen before into the right channel. Only the referring host name goes to the AI, never page addresses or personal information.

Two ways to run it

Standard mode or first party mode

Standard mode works everywhere and takes a minute. First party mode serves the script from your own domain through a small proxy, which keeps Safari visitors for 180 days and gets past common block lists.

Standard modeFirst party mode
Script and data callscdn.sourcream.aiyourdomain.com/_sc/
Visitor ID in SafariScript cookie, capped at 7 daysServer cookie, kept for 180 days
Block lists that name SourcreamCan block itDon't match your domain
SetupPaste the script tagScript tag plus a proxy: our WordPress plugin, Cloudflare, Vercel, Netlify, nginx, Apache or Next.js
Webflow and SquarespaceYesNot possible, these hosts can't proxy a path

Set up first party mode

Try it on your own site

Install takes a few minutes. Submit a test form with UTMs on the URL and watch the lead arrive.