Dynamic Yield
Datafly Signal delivers events directly to the Dynamic Yield (Mastercard) Experience API from your own server. Purchases, cart activity, product views, identification, and engagement signals reach Dynamic Yield over a first-party server-to-server call, so personalisation, product recommendations, and affinity modelling keep working even when the browser blocks the Dynamic Yield client script.
Prerequisites
- A Dynamic Yield account with an active Section (the site/app container).
- A Server Side data source API key. Create one in the Dynamic Yield admin under Settings → API Keys and select the Server Side type. Client/section keys are rejected by this endpoint.
- A product feed uploaded to Dynamic Yield whose product IDs match the
product_idvalues your site sends. Recommendations and affinity attribution depend on this match. - Knowing whether your account is on the global stack (
dy-api.com) or the EU data-residency stack (dy-api.eu).
Configuration
| Field | Required | Description |
|---|---|---|
| Server-Side API Key | Yes | Your Dynamic Yield Server Side data source key. Sent on every request as the DY-API-Key header. |
Configure in Signal
- In Signal, add the Dynamic Yield integration to your pipeline.
- Paste your Server-Side API Key.
- If your account is on the EU stack, select the EU endpoint variant so requests go to
dy-api.eu. - Choose the Retail / Ecommerce preset, then enable the events you send.
- Save and publish the pipeline.
API Endpoint
POST https://dy-api.com/v2/collect/user/eventEU data-residency accounts use https://dy-api.eu/v2/collect/user/event.
Authentication is a single static header:
DY-API-Key: <your server-side API key>
Content-Type: application/jsonThe request body wraps one or more events alongside the user, session, and context objects:
{
"user": { "dyid": "7282320792394869879", "dyid_server": "7282320792394869879", "active_consent_accepted": true },
"session": { "dy": "e3xi77qrxbsxxxmi18d8kxek6tdd12qj" },
"context": { "device": { "ip": "203.0.113.10", "userAgent": "Mozilla/5.0 ..." } },
"events": [ { "name": "Purchase", "properties": { "dyType": "purchase-v1", "value": 129.99, "currency": "USD" } } ]
}Identity Signals
Dynamic Yield identifies a visitor by dyid_server — the server-side Dynamic Yield user id. Signal sends:
user.dyid_serveranduser.dyid— sourced from the Dynamic Yield_dyidvalue. Mirror the browser_dyidcookie into Signal so server-side and client-side events stitch to the same user. If unavailable, a stable pseudonymous id is used and identity is merged on the next Identify event.session.dy— the session id, so behaviour groups into the same session Dynamic Yield sees client-side.context.device.ip(forwarded asX-Forwarded-For) andcontext.device.userAgent— used for geo/device targeting and bot filtering on server-side calls.cuid— your customer id for the Identify, Login, Signup, and Newsletter events. The blueprint hashes email with SHA-256 (trim → lowercase → sha256) and setscuidType: "he"(hashed email).
Consent maps from your CMP’s canonical marketing category to user.active_consent_accepted (true/false).
Event Mapping
Signal’s GA4-style event names map to Dynamic Yield predefined event schemas (selected by the versioned dyType property).
| Signal event | Dynamic Yield event | dyType |
|---|---|---|
page | Pageview | (page type) |
Product Viewed | Page Viewed | PRODUCT |
Product Added | Add to Cart | add-to-cart-v1 |
Product Removed | Remove from Cart | remove-from-cart-v1 |
Cart Viewed | Sync Cart | sync-cart-v1 |
Product Added to Wishlist | Add to Wishlist | add-to-wishlist-v1 |
Order Completed | Purchase | purchase-v1 |
Products Searched | Keyword Search | keyword-search-v1 |
Products Filtered | Filter Items | filter-items-v1 |
Products Sorted | Sort Items | sort-items-v1 |
Identified | Identify User | identify-v1 |
Logged In | Login | login-v1 |
Signed Up | Signup | signup-v1 |
Newsletter Subscribed | Newsletter Subscription | newsletter-subscription-v1 |
Example: a purchase
A Datafly.js call on your site:
datafly.track("Order Completed", {
order_id: "T-10042",
revenue: 129.99,
currency: "USD",
cart: [
{ productId: "SKU-991", quantity: 1, itemPrice: 99.99 },
{ productId: "SKU-204", quantity: 2, itemPrice: 15.00 }
]
});Resulting payload to Dynamic Yield:
{
"user": { "dyid_server": "7282320792394869879", "active_consent_accepted": true },
"session": { "dy": "e3xi77qrxbsxxxmi18d8kxek6tdd12qj" },
"context": { "device": { "ip": "203.0.113.10", "userAgent": "Mozilla/5.0 ..." } },
"events": [
{
"name": "Purchase",
"properties": {
"dyType": "purchase-v1",
"value": 129.99,
"currency": "USD",
"uniqueTransactionId": "T-10042",
"cart": [
{ "productId": "SKU-991", "quantity": 1, "itemPrice": 99.99 },
{ "productId": "SKU-204", "quantity": 2, "itemPrice": 15.00 }
]
}
}
]
}Testing
- Send a test event from your site (or replay one in the Signal Event Debugger).
- In the Dynamic Yield admin, open Experience API Logs and confirm the call appears with no schema errors.
- Confirm
dyid_servermatches the value Dynamic Yield assigns the browser, so server and client events resolve to one user. - For a purchase, confirm the
cartproduct IDs match products in your Dynamic Yield feed and that the value/currency are correct.
Troubleshooting
| Symptom | Likely cause |
|---|---|
401 / 403 | API key is missing, wrong, or a client/section key rather than a Server Side key. |
404 | Wrong regional host. EU accounts must use the dy-api.eu endpoint variant. |
400 | Malformed body or an unknown dyType schema. Check the event’s properties against the Events reference in your account. |
| Events arrive but no personalisation/recommendations | Product IDs don’t match the Dynamic Yield product feed, or dyid_server isn’t the visitor’s real Dynamic Yield id. |
| Revenue not attributed | Purchase missing value, currency, or the cart array. |
| User never identified | Identify/Login not firing, or cuid/cuidType mismatch with the format configured in your account. |