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_id values 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

FieldRequiredDescription
Server-Side API KeyYesYour Dynamic Yield Server Side data source key. Sent on every request as the DY-API-Key header.

Configure in Signal

  1. In Signal, add the Dynamic Yield integration to your pipeline.
  2. Paste your Server-Side API Key.
  3. If your account is on the EU stack, select the EU endpoint variant so requests go to dy-api.eu.
  4. Choose the Retail / Ecommerce preset, then enable the events you send.
  5. Save and publish the pipeline.

API Endpoint

POST https://dy-api.com/v2/collect/user/event

EU 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/json

The 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_server and user.dyid — sourced from the Dynamic Yield _dyid value. Mirror the browser _dyid cookie 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 as X-Forwarded-For) and context.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 sets cuidType: "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 eventDynamic Yield eventdyType
pagePageview(page type)
Product ViewedPage ViewedPRODUCT
Product AddedAdd to Cartadd-to-cart-v1
Product RemovedRemove from Cartremove-from-cart-v1
Cart ViewedSync Cartsync-cart-v1
Product Added to WishlistAdd to Wishlistadd-to-wishlist-v1
Order CompletedPurchasepurchase-v1
Products SearchedKeyword Searchkeyword-search-v1
Products FilteredFilter Itemsfilter-items-v1
Products SortedSort Itemssort-items-v1
IdentifiedIdentify Useridentify-v1
Logged InLoginlogin-v1
Signed UpSignupsignup-v1
Newsletter SubscribedNewsletter Subscriptionnewsletter-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

  1. Send a test event from your site (or replay one in the Signal Event Debugger).
  2. In the Dynamic Yield admin, open Experience API Logs and confirm the call appears with no schema errors.
  3. Confirm dyid_server matches the value Dynamic Yield assigns the browser, so server and client events resolve to one user.
  4. For a purchase, confirm the cart product IDs match products in your Dynamic Yield feed and that the value/currency are correct.

Troubleshooting

SymptomLikely cause
401 / 403API key is missing, wrong, or a client/section key rather than a Server Side key.
404Wrong regional host. EU accounts must use the dy-api.eu endpoint variant.
400Malformed body or an unknown dyType schema. Check the event’s properties against the Events reference in your account.
Events arrive but no personalisation/recommendationsProduct IDs don’t match the Dynamic Yield product feed, or dyid_server isn’t the visitor’s real Dynamic Yield id.
Revenue not attributedPurchase missing value, currency, or the cart array.
User never identifiedIdentify/Login not firing, or cuid/cuidType mismatch with the format configured in your account.