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 computing the subscriber hash with Klaviyo's sha_256 filter (or a stored profile property), 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
MailAdx's eh parameter needs the SHA-256 of the subscriber's lower-cased email address, written as 64 lowercase hex characters. Klaviyo's template language documents a sha_256 filter and a lower filter, and the profile's email address is {{ email }}. So Klaviyo can compute the value at send time:
{{ email|lower|sha_256 }}Klaviyo's filter glossary doesn't say how sha_256 encodes its output. Before you go live, check that a test send renders 64 lowercase hex characters (see testing). If it doesn't, use the alternative: store the hash as a profile property and reference it with {{ person.email_sha256|default:'' }}. That takes a one-time backfill plus a way to set the property for new subscribers, as described in Step 1.
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)
- Only if you use the stored-property alternative: Python, Node.js or similar to compute the hashes for the initial backfill
- Optionally: a Klaviyo integration with Shopify or your commerce platform (for e-commerce audience targeting)
Step 1: Setting Up the Email Hash in Klaviyo
If the {{ email|lower|sha_256 }} filter passes the test send check, you can skip this step entirely, because there is nothing to store. The rest of this step covers the stored-property alternative, which has two parts: 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 an HTML block. Paste the open-time tag from Dashboard → Ad Tags, and make sure every eh= in it carries your Klaviyo value. The core of the tag looks like this:
<a href="https://mailadx.com/adserver/click?pub=YOUR_PUBLISHER_ID&pk=header&eh={{ email|lower|sha_256 }}"
rel="nofollow" target="_blank">
<img src="https://mailadx.com/adserver/display?pub=YOUR_PUBLISHER_ID&pk=header&eh={{ email|lower|sha_256 }}"
style="display:flex;max-width:100%" width="auto" />
</a>If you use the stored-property alternative, use {{ person.email_sha256|default:'' }} in place of the filter expression. A profile without the property then sends an empty eh, gets no ad, and shows on Tag Health as “Email hash missing”. Copy the full tag from your dashboard rather than typing it, so it carries your real publisher ID, placement key and ad domain.
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 be 64 characters of 0–9 and a–f. It should also equal the SHA-256 of your own lower-cased address, which you can get with printf '%s' 'you@example.com' | shasum -a 256. If it is upper-case, a different length, or empty, switch to the stored property (or fix it). If you use the stored property and the value is empty, the test profile doesn't have email_sha256 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 Klaviyo compute the hash itself?
Yes. Klaviyo's documented sha_256 filter computes it at send time: {{ email|lower|sha_256 }}. Check one test send for 64 lowercase hex characters before relying on it. The stored email_sha256 property is the alternative if the filter's output doesn't match. Don't use the md5_hash filter, because MailAdx accepts SHA-256 only.
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 · 0% on direct-sold · Works with all Klaviyo plans



