Klaviyo is built for e-commerce brands and DTC publishers, with subscriber segmentation, flow-based automation, and deep integrations with Shopify and other commerce platforms. These same capabilities make Klaviyo one of the more capable ESPs for newsletter advertising — particularly for advertisers who want to target e-commerce audiences or exclude existing customers from ad campaigns. This guide covers the complete MailAdx integration for Klaviyo, including the profile property approach for subscriber hashing, flow-compatible ad tags, and how Klaviyo's segmentation interacts with MailAdx's audience targeting system.
What this guide covers:
- How Klaviyo's architecture affects integration
- What you need before starting
- Step 1: Setting up the email hash in Klaviyo
- Step 2: Create your MailAdx placement
- Step 3: Add the ad tag to Klaviyo templates
- Ad serving in Klaviyo flows vs campaigns
- Using Klaviyo segments with MailAdx targeting
- Testing and verifying the integration
- Frequently asked questions
How Klaviyo's Architecture Affects Integration
Klaviyo handles email hashing differently from Mailchimp. Rather than a native merge tag that computes the hash on the fly at send time, Klaviyo's recommended approach is to store the hash as a profile property on each subscriber record, then reference that property in the ad tag URL.
This means there's a one-time setup step to populate the hash property across your subscriber list — and an ongoing process to ensure new subscribers receive the hash on join. Once configured, the merge variable syntax is straightforward: {{ person.email_sha256 | default:'' }}in Klaviyo templates pulls the stored hash for each subscriber.
The architectural reason Klaviyo uses stored properties rather than on-the-fly computation: Klaviyo's templating engine is designed for personalisation from stored attributes rather than real-time computation. The stored property approach is actually more flexible — it allows you to pre-verify hash accuracy and supports more complex use cases where the hash needs to match against external systems.
For the privacy rationale behind email hashing in newsletter advertising, see audience targeting with email hashes.
What You Need Before Starting
- A Klaviyo account with access to profile properties and template editing
- A MailAdx publisher account (create one here)
- Either Python, Node.js, or a spreadsheet tool capable of SHA-256 hashing for initial population
- Optionally: a Klaviyo integration with Shopify or your commerce platform (for e-commerce audience targeting)
Step 1: Setting Up the Email Hash in Klaviyo
There are two parts to this step: creating the custom property, and populating it across your subscriber list.
Creating the profile property
In Klaviyo, navigate to Data and Privacy → Custom Properties. Create a new property namedemail_sha256 of type String. This is where the SHA-256 hash of each subscriber's email address will be stored.
The property name email_sha256 is a convention — you can use any name, as long as you reference the same name in your ad tag template. Keeping it as email_sha256makes it self-documenting.
Populating the hash for existing subscribers
For your existing subscriber list, you need to compute the SHA-256 hash for each email address and upload it as a bulk property update. The process:
1. Export your subscriber list from Klaviyo (Profiles → Export).
2. Compute SHA-256 hashes. Key requirements: lowercase the email address before hashing.User@Example.com and user@example.com produce different hashes — always normalise to lowercase first. In Python: import hashlib; hashlib.sha256("user@example.com".lower().encode()).hexdigest(). In Node: require('crypto').createHash('sha256').update(email.toLowerCase()).digest('hex').
3. Add a new column email_sha256 to the exported CSV with the computed hash for each row.
4. Re-import the CSV into Klaviyo (Profiles → Import). Map the email_sha256 column to the custom property you created. Klaviyo will update the profile property for each matched record.
Populating the hash for new subscribers
For new subscribers joining after your initial bulk update, set the hash at signup time. If you're using Klaviyo's forms, add a hidden field or post-submission webhook that computes and stores the hash immediately on profile creation. Alternatively, use a Klaviyo flow trigger on "Profile Created" to compute and set the property via API within seconds of signup.
The MailAdx getting started documentation and the full Klaviyo integration docs include code snippets for the webhook and flow-based approaches.
Step 2: Create Your MailAdx Placement
In the MailAdx publisher portal, navigate to Placements and create a new placement. Configure:
Placement key: e.g. klaviyo_header or header
Ad sizes: Klaviyo newsletters default to 600px width. Standard sizes: 600×90px for header, 600×150px for mid-content.
Floor CPM: For e-commerce publishers in DTC/retail categories, starting floors of $10–14 CPM are appropriate. For B2B Klaviyo users, start at $16–20 CPM. See the floor CPM guide for calibration strategy.
Save the placement and copy the generated ad tag.
Step 3: Add the Ad Tag to Klaviyo Templates
In Klaviyo's template editor, locate the position where you want the ad to appear. Click "Add Block" and choose a Custom HTML block. Paste the following, replacing the publisher ID and adjusting dimensions:
<!-- MailAdx ad placement -->
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td align="center" style="padding:12px 0 8px;">
<img
src="https://ads.mailadx.com/serve
?pub=YOUR_PUBLISHER_ID
&pk=header
&eh={{ person.email_sha256 | default:'' }}"
width="600"
height="90"
alt=""
style="display:block;border:0;max-width:100%;"
/>
</td>
</tr>
</table>
<!-- End MailAdx -->The | default:'' filter ensures the template renders cleanly even for subscribers whose email_sha256 property hasn't been populated yet. Without the default filter, Klaviyo may render the literal variable name in the URL for those subscribers.
Save the template. This ad tag will work for both one-time campaigns and automated flows.
Ad Serving in Klaviyo Flows vs Campaigns
One of MailAdx's structural advantages in the Klaviyo context is that open-time ad serving works identically in both campaign sends and flow emails — without any additional configuration.
With send-time ad platforms, flow emails present a challenge: an automated email that sends on a trigger (abandoned cart, welcome sequence day 3, post-purchase follow-up) fires at unpredictable times relative to the ad platform's campaign schedule. Ad creative that was relevant when the flow was configured may be months out of date when a subscriber triggers it.
With MailAdx's open-time architecture, the ad decision runs at the moment the subscriber opens the email — regardless of when the email was sent. A welcome sequence email sent on a Tuesday carries an ad tag that selects the best available campaign when the subscriber opens it, whether that's Tuesday afternoon or Saturday morning. The ad is always current, always within budget, and always relevant to that specific subscriber.
For Klaviyo users with complex flow architectures — multi-touch welcome sequences, win-back campaigns, post-purchase nurture flows — this means ad revenue from flow emails is no different in quality or mechanics from campaign emails. Every open earns.
Using Klaviyo Segments with MailAdx Targeting
Klaviyo's subscriber segmentation is one of its strongest features — and it creates an opportunity that most newsletter ad platforms can't support.
Because MailAdx identifies subscribers via their SHA-256 email hash, and Klaviyo stores purchase history, product interest, and behavioural attributes per profile, you can build audience segments based on first-party commerce data and use them in MailAdx campaigns.
Practical examples:
Advertiser customer exclusion: An advertiser who wants to exclude their existing customers from a newsletter campaign can provide a hashed customer list. You match those hashes against your Klaviyo subscriber profiles and configure the exclusion in MailAdx. Existing customers don't see the acquisition ad; budget goes only to prospects.
High-intent segments for premium CPM: Klaviyo profiles with purchase history in specific categories (bought in the last 90 days, high average order value) represent a more valuable advertising audience than cold subscribers. This data can support higher CPM negotiations in direct sponsorship deals — and potentially in private marketplace arrangements.
Category-relevant targeting: A publisher with Klaviyo segments for "interested in software tools" vs "interested in physical products" can work with MailAdx to ensure software advertisers reach software-interested subscribers and product advertisers reach product buyers. This audience quality improvement supports higher CPMs.
See how email hash-based audience segments work and the audience targeting guide for implementation detail.
Testing and Verifying the Integration
Send a Klaviyo test email to yourself. Open it and verify:
The hash property was substituted: In your email client, view the image source for the ad tag. The eh= parameter should show a 64-character hex string. If it shows an empty value or the literal variable text, the profile property isn't populating correctly — check that your subscriber profile has the email_sha256 property set.
An impression appears in MailAdx: After opening the test email, check the MailAdx reporting dashboard. A test impression should appear within a few minutes. Initial impressions typically show your house ad (paid demand is thin at account creation) — this is expected and improves as demand targeting learns your audience over subsequent sends.
Frequently Asked Questions
Can I use Klaviyo's built-in computed property for the hash?
Klaviyo doesn't natively compute SHA-256 as an on-the-fly merge tag the way Mailchimp does. You need to store it as a profile property populated externally. Some Klaviyo users use a Segment integration or a custom Klaviyo API script to keep the property current automatically. The Klaviyo integration docs include a reference implementation.
Does the integration work with Klaviyo A/B tests?
Yes. When Klaviyo runs an A/B test on email variants, both variants can contain the same ad tag. The ad selection happens at open time based on subscriber identity — each subscriber who opens either variant receives the appropriate programmatic ad independent of which variant they're in. The A/B test and the ad serving are parallel, independent processes.
What happens if a subscriber hasn't had their hash property set?
The | default:'' filter in the template renders an empty eh parameter for these subscribers. MailAdx handles empty hash parameters gracefully: it serves an ad without subscriber-level targeting (no frequency cap, no audience segment matching), but the impression still runs and earns revenue. The quality of targeting is reduced, but revenue is not lost.
Is there a way to automatically hash new subscribers in Klaviyo without manual CSV updates?
Yes — use a Klaviyo flow triggered by "Profile Created." In the flow, use Klaviyo's webhook action to call a small serverless function that computes the hash and posts it back to the Klaviyo profile via API. This automates the process for all new subscribers going forward. Code for this webhook function is in the Klaviyo integration docs.
Monetise your Klaviyo newsletter with MailAdx
Open-time ads in both campaigns and flows. Full control over floor prices, blocklists, and demand configuration from the publisher portal.
No minimum subscribers · No revenue share · Works with all Klaviyo plans



