Dynamic Yield collects and derives many user attributes from multiple channels. Using the unified customer profile server-side API, you can retrieve the data Dynamic Yield has on a particular user, aggregated across all sites and apps in your account. You can use this data to create custom experiences to enhance a third-party platform.
The collected attributes include:
- IDs and traits
- Transactional data (e.g. days since last purchase/visit, AOV, observed LTV)
- Session attributes (e.g. list of used devices & browsers, locations, traffic sources)
- Product engagement (e.g. recently viewed/purchased products, products in the cart)
Notes:
-
This is an early access feature. To join the early access program, contact your Customer Success Manager.
-
An API Key has to be included in the header of every API call. To enable generating a key, contact your Customer Success Manager.
API Details
The API returns the user attributes for one user (specified by a CUID) aggregated from all sites in the account.
Path
https://dy-api.com/v2/ucp/cuid
or https://dy-api.eu/ for European Data center
HTTP Method
- GET
Headers
- DY-API-key: A string.
- Content-Type: application/json
Parameters
- id (string) – The user’s identifier
- idType (string) – The user identifier type, can be 'email', 'he' (hashed email) or 'external'
- sitesIDs (string array, comma separated) – (optional) a list of site IDs from which the data should be aggregated; if this parameter is not passed – the section from which the API key was generated is used.
Return
- A JSON object including all available data attributes for the requested visitor with the name and value for each attribute.
Response codes
- 202 request acknowledged
- 400 error parsing request
- 401 invalid or missing API key
- 403 access denied for a valid API key (wrong section, illegal operation)
- 405 wrong HTTP method (not GET, in this case)
- 429 too many requests received
- 500 unspecified internal error
Request Example
curl -X GET \
https://dy-api.com/v2/ucp/cuid/?idType=he&id=715d5eec50e32a57ab6a2b0772d9b4487dffb282dfb794036e82caa7128f6b52&sitesIDs=
[xxxxxx,yyyyyyy,zzzzzzz] \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-H 'dy-api-key: 1234567890abcdef1234567890abcdef1234567890abcdef'
Response Example
{
"identified": true,
"Summary": {
"lastVisitDate": 1572794168793,
"firstVisitDate": 1572794154354,
"daysSinceLastVisit": 1,
"lastPurchaseDate":1574352804,
"firstPurchaseDate":1574352804,
"daysSinceLastPurchase": 37.0,
"numberOfPurchases": 1,
"lifetimeValue": 198.00,
"averageOrderValue": 198.0,
"productsPurchased": [1223-1,3324-4],
"lastPurchasedProducts": [1223-1,3324-4],
"averageDaysBetweenPurchases": 0.0,
"averageNumberOfItemsPerPurchase": 2.0
}
}
"online": {
"deviceList": [
"Desktop"
],
"browserList": [
"Chrome"
],
"trafficSourceList": [
"DIRECT"
],
"locationList": [
"US_VA_Ashburn"
],
"lastOnlineVisitDate": 1572794168793,
"firstOnlineVisitDate": 1572794154354,
"daysSinceLastOnlineVisit": 1,
"lastSeenLocation": "US_VA_Ashburn",
"lastSeenBrowser": "Chrome",
"lastSeenDevice": "Desktop",
"lastSeenTrafficSource": "DIRECT",
"purchases": {
"lastPurchaseDate":1574352804,
"firstPurchaseDate":1574352804,
"daysSinceLastPurchase": 37,
"numberOfPurchases": 1,
"lifetimeValue": 199.0,
"averageOrderValue": 199.0,
"productsPurchased": [1223-1,3324-4],
"lastPurchasedProducts": [1223-1,3324-4],
"productsInCart": [4990-0],
"numberOfProductsInCart": 1,
"lastPurchaseChannel": null,
"averageDaysBetweenPurchases": 0.0,
"averageNumberOfItemsPerPurchase": 2.0
},
"productsViewedInLast90Days": [
{
"sku": "1310564-600",
"timestamp": 1572794168793,
"quantity": 1
},
{
"sku": "1310564-600",
"timestamp": 1572794154354,
"quantity": 1
}
]
},
"offline" : {
"purchases": {
"lastPurchaseDate": null,
"firstPurchaseDate": null,
"daysSinceLastPurchase": null,
"numberOfPurchases": 0,
"lifetimeValue": 0.0,
"averageOrderValue": 0.0,
"productsPurchased": [],
"lastPurchasedProducts": [],
"lastPurchaseStoreId": null,
"averageDaysBetweenPurchases": 0.0,
"averageNumberOfItemsPerPurchase": 0.0
}
}
}
Attributes Returned
Type | Attribute Key | Attribute Name | Data Type | Description |
---|---|---|---|---|
Product Engagement | lastPurchased Products |
Last purchased products |
Array of Strings (SKUs) | A list of all product SKUs purchased by the user in the last purchase event. This attribute can be also be used to indicate offline purchases when placed under the attribute "offline" as seen in the example above. |
Product Engagement | numberOf Products InCart |
Number of products in cart |
Integer | The number of items in the user’s cart. |
Product Engagement | productsInCart | Products in cart |
Array of Strings (SKUs) | A list of all product SKUs in the user’s cart. |
Product Engagement | productsPurchased | Products purchased |
Array of Strings (SKUs and timestamp) | A list of all product SKUs purchased by the user. This attribute can be also be used to indicate offline purchases when placed under the attribute "offline" as seen in the example above. |
Product Engagement | productsViewedIn Last90Days |
Products viewed in last 90 days |
Array of Strings (SKUs and timestamp) | A list of all product SKUs viewed by the user in the last 90 days. |
Session Behavior | browserList | Browser List |
Array of Strings (browsers) | A list of all browsers on which the user was tracked by Dynamic Yield. |
Session Behavior | deviceList | Device List |
Array of Strings (devices) | A list of all devices on which the user was tracked by Dynamic Yield. |
Session Behavior | LastSeenBrowser | Last seen browser |
Enum value | The last browser on which the user was tracked by Dynamic Yield. |
Session Behavior | LastSeenDevice | Last seen device |
Enum value | The last device on which the user was tracked by Dynamic Yield. |
Session Behavior | LastSeenLocation | Last seen location |
Country, Region, City | The last location (Country, Region, City) where the user was tracked by Dynamic Yield. |
Session Behavior | LastSeen TrafficSource |
Last seen traffic source |
Enum value . | The last traffic source where the user was tracked by Dynamic Yield |
Session Behavior | locationList | Location list |
Array of Strings (countryCode_ regionCode_ cityName) |
A list of all locations (Country, Region, City) where the user was tracked by Dynamic Yield. |
Session Behavior | trafficSourceList | Traffic source list |
Array of Strings (traffic sources) | A list of all traffic sources on which the user was tracked by Dynamic Yield. |
Transactional | AverageDays BetweenPurchases |
Average days between purchases |
Float | The average days between purchases tracked by Dynamic Yield. This attribute can be also be used to indicate offline purchases when placed under the attribute "offline" as seen in the example above. |
Transactional | AverageNumber OfItems PerPurchase |
Average number of items per purchase |
Float | The average number of items for all purchases tracked by Dynamic Yield. This attribute can be also be used to indicate offline purchases when placed under the attribute "offline" as seen in the example above. |
Transactional | averageOrderValue | Average order value |
Float | The average value of purchases the user has performed that were tracked by Dynamic Yield. This attribute can be also be used to indicate offline purchases when placed under the attribute "offline" as seen in the example above. |
Transactional | daysSince LastPurchase |
Days since last purchase | Integer | The number of days since the last purchase event tracked by Dynamic Yield. This attribute can be also be used to indicate offline purchases when placed under the attribute "offline" as seen in the example above. |
Transactional | daysSinceLastVisit | Days since last visit |
Integer | The number of days since the last page view tracked by Dynamic Yield. |
Transactional | firstPurchaseDate | First purchase date |
Date | The date of the first purchase event tracked by Dynamic Yield. This attribute can be also be used to indicate offline purchases when placed under the attribute "offline" as seen in the example above. |
Transactional | FirstVisitDate | First visit date |
Date | The date of the first-page view tracked by Dynamic Yield. |
Transactional | LastPurchase Channel |
Last Purchase Channel | Number (site ID) | The last Dynamic Yield site where a purchase event was tracked. |
Transactional | lastPurchaseDate | Last purchase date | Date | The date of the last purchase event tracked by Dynamic Yield. This attribute can be also be used to indicate offline purchases when placed under the attribute "offline" as seen in the example above. |
Transactional | lastVisitDate | Last visit date | Date | The date of the last page view tracked by Dynamic Yield. |
Transactional | lifetimeValue | Observed Lifetime value | Float | The total value of purchases tracked by Dynamic Yield. This attribute can be also be used to indicate the value of offline purchases when placed under the attribute "offline" as seen in the example above. |
Transactional | numberOf Purchases |
Number of purchases | Integer | The purchase events tracked by Dynamic Yield . This attribute can be also be used to indicate offline purchases when placed under the attribute "offline" as seen in the example above. |