MailerLite and WordPress: The Attribution Problem
MailerLite is one of the most popular email marketing platforms for small businesses and growing teams. It’s clean, affordable, and handles most email needs well. But like every email marketing platform, it has a blind spot: it doesn’t automatically tell you where each subscriber came from before they landed on your WordPress site and filled out your form.
You can see that someone subscribed. You can see which emails they open. But the source data — the Google Ad they clicked, the organic search that brought them to your blog, the Facebook campaign that introduced them to your brand — lives on the WordPress side of the equation and doesn’t automatically make its way into MailerLite.
This guide covers how to bridge that gap: capturing UTM parameters from your marketing campaigns and passing them to MailerLite subscriber records as custom fields, so you can see which channels are actually growing your list.
Why Lead Source Data Matters for Email Marketing
Email list growth is only meaningful if you understand which sources are producing subscribers who actually engage, convert, or buy. Without source data:
- You can’t tell whether your Google Ads are building your list or just generating traffic that doesn’t subscribe
- You can’t compare list quality across channels (organic subscribers often have higher lifetime value than paid ad subscribers)
- You can’t send source-specific email sequences that speak to where someone came from and why they subscribed
- You can’t defend or expand a marketing budget based on which channels are building your email list
With source data in MailerLite, you can segment by where subscribers came from, build automations triggered by source, and report accurately on which marketing activities are growing your most engaged subscriber segments.
How the Tracking Works
The setup follows a consistent pattern whether you’re passing data to MailerLite, another email platform, or a CRM:
- A visitor arrives on your WordPress site from a tagged URL (one with UTM parameters in the query string)
- A JavaScript snippet reads those UTM values from the URL and stores them in a first-party cookie
- When the visitor fills out a form anywhere on your site — even several pages later — hidden fields in that form capture the stored UTM values
- The form submission, including the hidden UTM data, posts to MailerLite (through native integration, Zapier, or MailerLite’s API)
- MailerLite adds the subscriber with source data stored as custom fields on their subscriber record
Step 1: Tag Your Traffic Sources
UTM tracking only works if your marketing links carry UTM parameters. A tagged link looks like this:
https://yoursite.com/free-guide/?utm_source=google&utm_medium=cpc&utm_campaign=summer-offer&utm_content=search-ad-v1
Every paid ad, email campaign link, social post, and partnership link should be tagged. Google Analytics and Google Ads can handle auto-tagging for their own traffic, but UTM tags make source data available in your own systems, not just in Google’s dashboard.
Use Google’s Campaign URL Builder to construct tagged links without typos. Keep your naming conventions consistent — “google” is different from “Google” and “G” in any field that you’ll filter on later.
Step 2: Capture UTMs in Cookies on Landing
UTM parameters only exist in the URL on the first pageview. As a visitor navigates from the landing page to other pages, those parameters disappear from the address bar. A cookie-based capture script reads them immediately on landing and persists them across the session:
document.addEventListener('DOMContentLoaded', function() {
const params = new URLSearchParams(window.location.search);
const utmParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_content', 'utm_term'];
utmParams.forEach(function(param) {
const val = params.get(param);
if (val) {
document.cookie = param + '=' + encodeURIComponent(val)
+ '; path=/; max-age=7776000; SameSite=Lax';
}
});
// Store the first landing page URL
if (!readCookie('landing_page')) {
document.cookie = 'landing_page=' + encodeURIComponent(window.location.href)
+ '; path=/; max-age=7776000; SameSite=Lax';
}
});
function readCookie(name) {
const match = document.cookie.match(new RegExp('(^| )' + name + '=([^;]+)'));
return match ? decodeURIComponent(match[2]) : '';
}
Add this script to your WordPress site using WPCode, your theme’s functions.php (via wp_enqueue_scripts), or a custom header script. It runs on every page load and writes UTM cookies that persist for 90 days.
Step 3: Create Custom Fields in MailerLite
MailerLite supports custom subscriber fields where you’ll store the source data. In your MailerLite account, go to Subscribers > Custom Fields and create text fields for:
- Lead Source (from utm_source)
- Lead Medium (from utm_medium)
- Lead Campaign (from utm_campaign)
- Lead Content (from utm_content)
- Lead Keyword (from utm_term)
- Landing Page (the first URL the subscriber visited)
Note the field keys MailerLite assigns to each — you’ll use them when configuring the form integration.
Step 4: Connect Your WordPress Forms to MailerLite With Hidden UTM Fields
This step depends on how your opt-in forms are built.
Option A: MailerLite’s embedded forms. MailerLite has a WordPress plugin that lets you embed their forms directly on your site. In the form editor, add hidden fields for each UTM custom field and populate them with JavaScript from the cookies:
document.addEventListener('DOMContentLoaded', function() {
const fieldMap = {
'fields[lead_source]': 'utm_source',
'fields[lead_medium]': 'utm_medium',
'fields[lead_campaign]': 'utm_campaign',
'fields[lead_content]': 'utm_content',
'fields[lead_keyword]': 'utm_term',
'fields[landing_page]': 'landing_page'
};
Object.entries(fieldMap).forEach(function([fieldName, cookieName]) {
const val = readCookie(cookieName);
if (val) {
const input = document.querySelector('[name="' + fieldName + '"]');
if (input) input.value = val;
}
});
});
Replace the field names with the actual input names from your MailerLite form’s HTML.
Option B: WordPress form plugins with MailerLite integration. If you use WPForms, Gravity Forms, Fluent Forms, or similar plugins, many have native MailerLite add-ons. Add hidden fields to your form for each UTM value, use the same JavaScript to populate them from cookies, and map those fields to your MailerLite custom fields in the integration settings.
Option C: Zapier or Make.com. If you’re using a form plugin without a native MailerLite integration, route form submissions through Zapier or Make.com. Configure the Zap to add the subscriber to MailerLite with the UTM hidden field values mapped to custom fields.
Step 5: Test End to End
Before relying on the data, verify the full pipeline works:
- Open an incognito window and visit:
yoursite.com/?utm_source=test&utm_medium=cpc&utm_campaign=tracking-test - Navigate to another page (confirm UTMs are still in the cookies via DevTools > Application > Cookies)
- Submit your form with a test email address you control
- Check the subscriber in MailerLite — the Lead Source field should show “test”, Lead Medium should show “cpc”, Lead Campaign should show “tracking-test”
If the fields arrive empty, work backwards: Are the cookies being written on landing? Are the hidden fields being populated? Is the field mapping in the integration set up correctly? Each step is independently verifiable.
Using Source Data in MailerLite
Once source data arrives with each subscriber, you can put it to work:
Segments by source. Create a MailerLite segment for subscribers where Lead Source = “google” or Lead Medium = “cpc”. This lets you see the size and behavior of your paid-traffic subscriber segment, and send targeted campaigns to them.
Source-specific automation triggers. MailerLite’s automation builder supports custom field conditions as triggers. An automation that fires “when subscriber joins AND lead_source = facebook” can send a different welcome sequence than one that fires for organic subscribers. Someone who found you through a Facebook ad is in a different context than someone who found your blog through search.
Reporting and channel evaluation. Export or filter your subscriber list by source. Compare open rates, click rates, and downstream conversion rates (purchases, bookings, appointments) by channel. This analysis often surfaces surprising findings — a smaller, high-engagement organic segment may outperform a larger paid segment in revenue terms.
Campaign attribution. When you run a paid campaign and want to know if it built your list, filter MailerLite subscribers by the campaign’s utm_campaign value. You’ll see exactly how many subscribers that campaign generated, at what cost per subscriber.
A Simpler Path
The manual setup works, but it involves writing custom JavaScript, adding hidden fields to each form separately, configuring field mapping in each integration, and repeating the process whenever you add a new form or landing page to your site. A new opt-in box on a new page means starting the setup over again for that form.
Sales Provenance installs once as a WordPress plugin and handles the capture-and-pass pipeline automatically across all forms on your site. UTM data (and additional first-party attribution data beyond just UTMs) passes to MailerLite and other connected platforms without per-form configuration.
If you want lead source data flowing from your WordPress site into MailerLite without setting it up form by form, Sales Provenance is the faster path.