Mailjet
Datafly Signal delivers your first-party events to Mailjet server-side. When a visitor identifies themselves (signs up, logs in, completes an order), Signal upserts them as a contact in your chosen Mailjet contact list and keeps their contact properties — name, marketing opt-in, last order value — up to date for your email campaigns and automations.
Because delivery is server-to-server, no Mailjet tag or pixel runs in the browser. Signal calls Mailjet’s Contact Management REST API directly from your own infrastructure.
Prerequisites
- A Mailjet account with API access.
- A Mailjet API Key (public) and Secret Key (private), from Account Settings > API Key Management.
- A target contact list. Create one under Contacts > Contact lists, then note its numeric List ID (also available via
GET /v3/REST/contactslist). - Any custom contact properties you intend to map must be defined in Mailjet first, under Contacts > Contact properties, or via
POST /v3/REST/contactmetadata. Mailjet rejects writes to undefined properties with a400error. The built-infirst_nameandlast_nameproperties exist by default.
Configuration
| Field | Required | Description |
|---|---|---|
| API Key (public) | Yes | Your Mailjet API Key. Used as the Basic-auth username. |
| Secret Key (private) | Yes | Your Mailjet Secret Key. Used as the Basic-auth password. |
| Contact List ID | Yes | The numeric ID of the Mailjet contact list to sync contacts into. |
Authentication uses HTTP Basic auth: the API Key is the username and the Secret Key is the password, sent on every request.
Configure in Signal
- In your Signal management UI, go to Integrations and add Mailjet.
- Paste your API Key and Secret Key.
- Enter your Contact List ID.
- Select the Default preset, which maps the standard identity events to Mailjet contact upserts.
- Attach the integration to the pipeline that carries your identified-user events and save.
API Endpoint
Signal sends one POST per matched event to Mailjet’s single-contact management endpoint:
POST https://api.mailjet.com/v3/REST/contactslist/{Contact List ID}/managecontactThis endpoint upserts the contact, applies the subscription action against your list, and writes contact properties in a single synchronous call.
Identity Signals
Mailjet’s Contact API matches on the raw email address, so Signal sends the visitor’s email as the Email field (the mandatory match key). Mailjet does not support a hashed-email match path, so email is sent in plain form to the contact API — over TLS, server-to-server, from your own infrastructure.
The marketing-consent flag drives the subscription action:
- Consent granted →
addforce(subscribe to the list) - Consent withdrawn →
unsub(unsubscribe) - Unknown →
addnoforce(add without changing an existing subscription state)
Events without an email cannot create a Mailjet contact and are dropped.
Event Mapping
The Default preset maps these Signal events to a Mailjet contact upsert (managecontact):
| Signal event | Mailjet effect |
|---|---|
Signed Up | Upsert contact, set signup_method property |
Identified | Upsert contact with current traits |
Order Completed | Upsert contact, set last_order_value / last_order_currency |
Subscribed | Subscribe to list (addforce) |
Unsubscribed | Unsubscribe from list (unsub) |
All other events (page views, product views, and any event without an email) are dropped.
Example
A Signed Up event from Datafly.js:
datafly.track("Signed Up", {
method: "email"
}, {
traits: {
email: "jane.doe@example.com",
first_name: "Jane",
last_name: "Doe"
}
});With marketing consent granted, Signal delivers this to Mailjet:
{
"Email": "jane.doe@example.com",
"Name": "Jane Doe",
"Action": "addforce",
"Properties": {
"first_name": "Jane",
"last_name": "Doe",
"signup_method": "email"
}
}Mailjet creates or updates the jane.doe@example.com contact, subscribes them to the configured list, and stores the properties.
Testing
- Trigger an identified event (e.g. sign up) on your site with a test email.
- In Mailjet, open Contacts > Contact lists, select your list, and confirm the contact appears with the expected name and properties.
- Open the contact to verify the custom properties (e.g.
signup_method) are populated. - In Signal’s Event Debugger, confirm the delivery returned a
200and the request body matches the contact you see in Mailjet.
Troubleshooting
400“Property does not exist” — the custom property you mapped is not defined in Mailjet. Create it under Contacts > Contact properties (or via/v3/REST/contactmetadata) before mapping it.401 Unauthorized— wrong API Key or Secret Key. Re-copy both from Account Settings > API Key Management; they are sent as Basic-auth username/password.404 Not Found— the Contact List ID is wrong. Confirm the numeric ID under Contacts > Contact lists or viaGET /v3/REST/contactslist.- Contact created but not subscribed — the contact previously opted out, and the event used
addnoforce, which respects an existing unsubscribe. Use theSubscribedevent (which sendsaddforce) only where you have explicit consent to resubscribe. - Nothing delivered for page views — expected. Mailjet contacts require an email, so unidentified events are dropped by design.