Compliant with GDPR, CCPA, COPPA, LGPD, PECR, PDPA, PIPEDA, and more.
Tracking whether recipients open your emails (tracking pixels) is covered by the same ePrivacy rules as cookies, and data protection authorities in Europe, such as France's CNIL and Italy's Garante, expect a separate consent for it, independent from the consent to receive email marketing. Check the guidance of the authorities in the countries where you send email. This guide shows how to collect that consent next to your email platform's subscribe checkbox, keep a record of it, and pass it to your email platform.
email_open_tracking, the name and the description are filled in, with Italian, French, German and Spanish translations. Adjust the text if needed, but keep the Purpose ID.The purpose now appears in the consent banner, where visitors can grant or withdraw it at any time.
Keep your email platform's own subscribe checkbox for email marketing, and add a second, unticked checkbox for open tracking:
<form id="newsletter-form">
<input type="email" name="email" required>
<!-- your email platform's subscription consent -->
<label><input type="checkbox" name="subscribe"> Send me the newsletter</label>
<!-- separate consent for email open tracking -->
<label><input type="checkbox" name="open_tracking"> I agree that you record whether and when I open your emails (tracking pixel). Optional, separate from the newsletter.</label>
<button type="submit">Subscribe</button>
</form>
When the form is submitted, give UniConsent the email address and the open tracking choice:
<script>
window._unicData = window._unicData || [];
document.getElementById('newsletter-form').addEventListener('submit', function (e) {
var form = e.target;
// link the consent record to this subscriber
_unicData.push({ user_ids: { email: form.email.value }, event: 'send_identity' });
// record the open tracking choice
if (typeof window.__unicapi === 'function') {
__unicapi('setCustomConsent', 2, null, { email_open_tracking: form.open_tracking.checked });
}
});
</script>
email_hash. The address itself is not stored by UniConsent.email_hash in the Consent DB.uniconsent:update event is sent. If it is the same, for example after the visitor accepted all in the banner, the existing record stands.setTimeout, so the record can be sent. Forms that submit in the background need nothing extra.Your email platform must only add the open tracking pixel for subscribers who agreed.
Send the checkbox value to your email platform together with the subscription, for example as a field, tag or custom property of the contact. This is the reliable way to set it for a new subscriber.
When a visitor later grants or withdraws email_open_tracking, in the banner or with setCustomConsent, UniConsent sets a profile property of the same name on the email platforms it finds on the page:
| Platform | Property set | Requirement |
|---|---|---|
| Klaviyo | email_open_tracking | The email was given with _unicData on the page |
| Segment | trait email_open_tracking | — |
| Braze | custom attribute email_open_tracking | — |
| Brevo | attribute EMAIL_OPEN_TRACKING | The email was given with _unicData on the page; create a Boolean attribute EMAIL_OPEN_TRACKING in Brevo first |
Use this property in your email platform to send emails with open tracking only to subscribers where it is true.
This works on websites where the platform's script is loaded on the page. In mobile apps, read the choice with getCustomConsents() and pass it to your email platform's app SDK.
For other platforms, listen for the update event to follow changes made in the banner:
document.addEventListener('uniconsent:update', function (e) {
var allowed = e.detail['UNIC_CP_email_open_tracking'];
// update the subscriber in your email platform
});
Visitors can withdraw open tracking at any time from the consent banner. The change is recorded in the Consent DB and passed on as in Step 4. If subscribers can also change it in your email platform's preference page, update UniConsent there too with setCustomConsent, so the consent record stays accurate.
Contact us: support@uniconsent.com