The Lead Source Problem With Brevo and WordPress
Brevo (formerly Sendinblue) is one of the most widely used email marketing and CRM platforms for small and mid-sized businesses. Connect it to your WordPress site and you can capture subscribers, send campaigns, and manage contacts — all in one place.
But Brevo has the same blind spot as most email platforms: it captures who opted in, not what drove them there. Your Brevo contacts list might show 5,000 subscribers with names and email addresses, but no source data. Did they come from Google Ads? Facebook? Organic search? A referral campaign? Without that information, you can’t measure which marketing is actually building your list.
This guide shows you how to track lead source through WordPress and pass it to Brevo so every contact has channel, campaign, and landing page data attached from the moment they sign up.
Why Source Data in Brevo Changes What You Can Do
Brevo is more than email — it includes contacts, deals, and pipeline features that function as a lightweight CRM. When you add source data to your contacts, you unlock capabilities that most Brevo users never use:
- Filter and segment by source: Create a list of all contacts from Google Ads vs. organic search. Compare their engagement rates. Make informed decisions about where to invest your marketing budget.
- Trigger source-specific automations: Send a different welcome email to someone who found you through a specific ad campaign vs. someone who subscribed from a blog post. Personalized first touchpoints improve conversion rates.
- Report on marketing ROI: If you close deals in Brevo, you can attribute revenue back to the lead source — finally showing which campaigns are driving actual business, not just traffic.
- Build better lookalike audiences: Export your highest-converting contacts by source and use them to build lookalike audiences in Facebook or Google Ads for better targeting.
How the Tracking Setup Works
The technical flow has four steps:
- UTM parameters arrive on landing. When a visitor clicks your ad or a tagged link, UTM parameters appear in the URL:
utm_source,utm_medium,utm_campaign, and optionallyutm_contentandutm_term. - A cookie script captures and stores them. A script runs on every page load, reads the URL for UTM values, and writes them to first-party cookies. This preserves the data as the visitor navigates through your site.
- Hidden form fields are populated. When a visitor reaches your opt-in form, JavaScript reads the cookies and populates hidden fields in the form — one for each UTM value you want to capture.
- Brevo receives the data as contact attributes. When the form submits, Brevo receives the hidden field values alongside the subscriber’s name and email. Those values get stored as contact attributes on their profile.
Step 1: Tag Your Campaigns With UTM Parameters
UTMs are the foundation. Every paid ad, every email campaign, every social media link you control should include UTM parameters so you know exactly where traffic is coming from.
A properly tagged URL looks like this:
https://yoursite.com/offer/?utm_source=google&utm_medium=cpc&utm_campaign=summer-launch&utm_content=headline-v2
Organic search traffic doesn’t need UTM tags — Google provides that data via Google Search Console and GA4. Direct traffic (visitors who type your URL directly) will naturally have no UTM data, which is expected and normal.
Step 2: Capture UTMs in Cookies When Visitors Land
UTM parameters only exist in the URL on the first pageview. If a visitor lands on your homepage, reads a blog post, then navigates to your pricing page and fills out a form there, those original UTMs are long gone from the URL.
You need a script that reads UTMs on landing and stores them in browser cookies so they’re available whenever the visitor converts. A basic version:
document.addEventListener('DOMContentLoaded', function() {
const params = new URLSearchParams(window.location.search);
const utms = ['utm_source','utm_medium','utm_campaign','utm_content','utm_term'];
utms.forEach(function(param) {
const value = params.get(param);
if (value) {
document.cookie = param + '=' + encodeURIComponent(value)
+ '; path=/; max-age=7776000; SameSite=Lax';
}
});
// Also save the landing page URL
if (!getCookie('landing_page')) {
document.cookie = 'landing_page=' + encodeURIComponent(window.location.href)
+ '; path=/; max-age=7776000; SameSite=Lax';
}
});
function getCookie(name) {
const match = document.cookie.match(new RegExp('(^| )' + name + '=([^;]+)'));
return match ? decodeURIComponent(match[2]) : '';
}
The max-age=7776000 is 90 days in seconds — enough to capture most conversion journeys. Adjust based on your typical sales cycle.
Step 3: Create Contact Attributes in Brevo
Brevo stores subscriber data in contact attributes. Before you can pass source data to Brevo, you need to create the custom attributes where that data will live.
In Brevo, go to Contacts > Settings > Contact Attributes > Add new attribute. Create the following as “Text” type attributes:
LEAD_SOURCE— the utm_source value (e.g., “google”, “facebook”)LEAD_MEDIUM— the utm_medium value (e.g., “cpc”, “email”, “organic”)LEAD_CAMPAIGN— the utm_campaign valueLEAD_CONTENT— the utm_content value (ad creative or link identifier)LEAD_KEYWORD— the utm_term value (paid keyword)LANDING_PAGE— the URL the visitor first landed on
These attributes will appear on every contact’s profile once you start sending data.
Step 4: Pass Cookie Values Through Your Opt-In Form
Now connect your WordPress opt-in form to the cookies. The approach depends on which form plugin you’re using to integrate with Brevo.
Using Brevo’s native WordPress plugin: Brevo’s official plugin lets you add hidden fields to their embedded forms. Add hidden fields for each attribute and use JavaScript to populate them from cookies when the page loads.
Using WPForms, Gravity Forms, or Fluent Forms with a Brevo integration: Add hidden fields to your form and wire them to the cookie values via JavaScript. The Brevo integration then maps those form fields to the contact attributes you created.
The JavaScript to populate the hidden fields:
document.addEventListener('DOMContentLoaded', function() {
const fieldMap = {
'LEAD_SOURCE': 'utm_source',
'LEAD_MEDIUM': 'utm_medium',
'LEAD_CAMPAIGN': 'utm_campaign',
'LEAD_CONTENT': 'utm_content',
'LEAD_KEYWORD': 'utm_term',
'LANDING_PAGE': 'landing_page'
};
Object.entries(fieldMap).forEach(function([attr, cookie]) {
const value = getCookie(cookie);
if (value) {
const input = document.querySelector('[name="' + attr + '"]');
if (input) input.value = value;
}
});
});
Step 5: Test the Full Pipeline
Before you trust the data in Brevo, run a manual test:
- Open a link with UTM parameters in a private/incognito browser window:
yoursite.com/?utm_source=test&utm_medium=email&utm_campaign=pipeline-test - Click around your site for a page or two to confirm the cookies persist across pages
- Submit your opt-in form with a test email address
- In Brevo, find that contact and check their attributes — LEAD_SOURCE should show “test”, LEAD_MEDIUM should show “email”, LEAD_CAMPAIGN should show “pipeline-test”
If the attributes are empty, debug in order: check whether the cookies were written (DevTools > Application > Cookies), then check whether the hidden fields are being populated (inspect the form HTML after load), then check whether the integration is mapping the fields correctly to the Brevo attributes.
Using Source Data in Brevo Automations and Segments
Once data is flowing, put it to work:
Source-based automation triggers: In Brevo’s automation builder, you can trigger different flows based on contact attributes. Create one welcome sequence for Google Ads contacts (“You found us while searching — here’s what you’re probably looking for”) and a different one for organic contacts (“You found us through content — here’s more depth on the topic you were reading”).
Segment by lead source for reporting: Create saved segments like “Source = google” and “Source = facebook.” Use these to compare list growth over time, open rates, and click rates by acquisition channel.
Campaign reporting by source: When you run a broadcast email, you can filter your recipients by segment. This tells you whether subscribers from different sources respond differently to the same campaign.
Deal attribution if using Brevo CRM: If you use Brevo Deals, the lead source attribute flows into the contact associated with each deal. You can filter deals by source to calculate revenue by marketing channel.
The One-Setup Alternative
The approach above works. But it requires custom JavaScript on every page, per-form configuration, and maintenance whenever you change forms or update your site. If you add a new landing page, you need to make sure the cookie script and hidden fields are wired up there too.
A dedicated WordPress attribution plugin removes that overhead. Install it once, connect to Brevo, and source data flows to every new contact automatically — regardless of which page or form they convert on.
Sales Provenance is built for exactly this: WordPress sites that use Brevo (or any email/CRM platform) and need to know which marketing is actually working. It handles the cookie capture, the landing page tracking, and the Brevo integration in a single setup — no per-form JavaScript, no maintenance burden, and more data than basic UTM tracking alone.
If getting clean lead source data into Brevo is on your list, Sales Provenance is the fastest way to get there.