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.
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.
<!-- Sourcream --> <script src="https://cdn.sourcream.ai/t/YOUR_SITE_KEY.js" async></script>
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 arrived | Source / medium |
|---|---|
A link tagged ?utm_source=newsletter&utm_medium=email | newsletter / 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 Gemini | chatgpt / ai and similar |
| Google search results | google / organic |
| A post on LinkedIn | linkedin / social |
| A link in Gmail on the web | gmail / email |
| Another website | example.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.
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.
<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>
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.
| Lead | Destination | Status |
|---|---|---|
| [email protected] | HubSpot | Delivered |
| [email protected] | Salesforce | Delivered |
| [email protected] | Webhook | Retrying |
| [email protected] | HubSpot | Delivered |
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.
| Raw value | Stored as |
|---|---|
utm_source=Facebook | |
utm_source=fb | |
utm_source=facebook-ads | |
utm_source=LinkedIn.com |
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 mode | First party mode | |
|---|---|---|
| Script and data calls | cdn.sourcream.ai | yourdomain.com/_sc/ |
| Visitor ID in Safari | Script cookie, capped at 7 days | Server cookie, kept for 180 days |
| Block lists that name Sourcream | Can block it | Don't match your domain |
| Setup | Paste the script tag | Script tag plus a proxy: our WordPress plugin, Cloudflare, Vercel, Netlify, nginx, Apache or Next.js |
| Webflow and Squarespace | Yes | Not possible, these hosts can't proxy a path |
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.