Inform Affinity
Report an array of product attributes to use in affinity personalization
The Inform Affinity event enables you to report multiple product attributes in an array, with up to 10 values per attribute. This event is intended to temporarily boost affinity scores for "zero-party data," or data explicitly and voluntarily supplied by the user (through a survey, onboarding experience, setting notification preferences on apps or websites, and so on).
Parameters
- name: Human-readable name, not used to identify an event type
- properties: A container for the event properties as specified in the following table:
Property | Description | Type |
---|---|---|
dyType | Must be "inform-affinity-v1" | String |
source Optional | The source of the user data | String |
data | An array of attributes and values. Important: Reported attributes and values must be an exact match to the product feed Each item in the array includes an attribute and up to 10 values: - attribute: "name of attribute" - values: ["value1", "value2"...] | Object |
If you pass the attribute "categories", the values must be single attributes, not the full product feed hierarchy.
Example: Implementation via script
DY.API("event", {
name: "Inform Affinity",
properties: {
dyType: "inform-affinity-v1",
source: "registration-form", // optional
data: [{
attribute: "categories",
values: ["shoes", "tops","accessories"],
},
{
attribute: "brand",
values: ["adidas"],
}
]
}
});
Example: Implementation via API (server-side)
"events": [
{
"name": "Inform Affinity",
"properties": {
"dyType": "inform-affinity-v1",
"source": "survey",
"data": [{
attribute: "color",
values: ["purple","black"],
},
{
attribute: "material",
values: ["cotton","spandex","microfiber"],
},
{
attribute: "brand",
values: ["puma"],
}
]
}
}
]
Go to the API reference for the Events endpoint to learn more.
Updated 4 months ago