En esta página: Obtenga información sobre cómo enviar datos de varios valores a Adobe Target Recommendations y cómo usarlos en reglas de inclusión con operadores de varios valores.
Un campo de varios valores contiene varios valores para el mismo artículo o visitante. Por ejemplo:
- Películas ofrecidas a los usuarios: una película determinada tiene varios actores.
- Entradas vendidas para conciertos: un usuario dado tiene múltiples bandas favoritas.
- Ropa vendida: una camisa está disponible en múltiples tallas.
Para controlar las recomendaciones en estos casos, se pueden pasar datos de varios valores a Target Recommendations y utilizarlos con operadores especiales de varios valores.
Envío de datos de varios valores send
Para permitir que Recommendations identifique datos de varios valores, deben enviarse como una matriz JSON.
Para un parámetro de varios valores en JavaScript (targetPageParams), vea Implementación de atributos de varios valores.
En un archivo CSV, se envía un atributo de entidad de varios valores como una matriz JSON en la celda del atributo, como en el siguiente ejemplo.
| code language-none |
|---|
|
Cuando se proporciona un atributo de entidad, un atributo de perfil o un parámetro de mbox como varios valores en este formato, Recommendations infiere automáticamente que el campo es de varios valores.
Uso de atributos de varios valores en reglas de inclusión multi-value-inclusion-rules
Los siguientes operadores están disponibles para su uso con atributos de entidad, perfil y mbox de varios valores:
- está en la lista
- no está en la lista
Ejemplo: Excluir elementos vistos recientemente
Para evitar que se recomienden películas de las últimas diez películas vistas del usuario, escriba primero un script de perfil denominado user.lastWatchedMovies que registre las últimas diez películas vistas como una matriz JSON. Los elementos se pueden excluir con la siguiente regla de inclusión:
Profile Attribute Matching
id - is not contained in list - user.lastWatchedMovies
Representación de la regla de inclusión en la API JSON:
{
"attribute": "id",
"operation": "isNotContainedInList",
"source": {
"name": "user.lastWatchedMovies",
"type": "PROFILE"
}
}
Ejemplo: Recomendar elementos de los favoritos del usuario
Para recomendar entradas para conciertos únicamente cuando la banda que toca es una de las bandas favoritas del usuario, se requieren dos elementos: una variable de perfil llamada profile.favoriteBands que contiene las bandas favoritas del usuario y un atributo entity.artistPerforming en el catálogo que contiene la artista que actúa en el concierto. A continuación, se puede utilizar la siguiente regla de inclusión:
Profile Attribute Matching
artistPerforming - is contained in list - profile.favoriteBands
Representación de la regla de inclusión en la API JSON:
{
"attribute": "artistPerforming",
"operation": "isContainedInList",
"source": {
"name": "profile.favoriteBands",
"type": "PROFILE"
}
}
Ejemplo: creación de API de criterios que recomiendan elementos de los favoritos de un usuario
Los criterios que utilizan reglas de filtrado de varios valores se pueden crear mediante las API Adobe Target, como todos los criterios. La siguiente llamada de API de ejemplo crea un criterio en el que el atributo de entidad id está contenido en la lista de parámetros de mbox favorites:
curl -X POST \
https://<serverhost>/api/recs/<client>/criteria/item \
-H 'Accept: application/vnd.adobe.target.v1+json' \
-H 'Accept-Encoding: gzip, deflate' \
-H 'Cache-Control: no-cache' \
-H 'Connection: keep-alive' \
-H 'Content-Type: application/json' \
-H 'User-Agent: <from API client>' \
-H 'X-Target-user-email: <email address>' \
-H 'cache-control: no-cache' \
-d '{
"name": "viewed criteria",
"criteriaTitle": "test title",
"type": "VIEWED_CF",
"key": "CURRENT",
"daysCount": "TWO_WEEKS",
"aggregation": "NONE",
"backupDisabled": false,
"partialDesignAllowed": true,
"configuration": {
"inclusionRules": [
{
"attribute": "id",
"operation": "isContainedInList",
"source": {
"name": "mbox.favorites",
"type": "MBOX"
}
}
]
}
}'
Esta llamada está emparejada con JavaScript en la página que pasa el contenido de los favoritos:
<!-- pass in the value of mbox parameter "favorites" as JSON array -->
<script type="text/javascript">
mboxCreate('myMbox','entity.id=<key>','favorites=["a","b","c"]');
</script>
This section contains structured knowledge intended to support interpretation, retrieval, and question answering related to this topic.
For complete understanding, this information should be combined with the documentation on this page. Neither source is intended to stand alone; the page describes the feature, while this section provides additional context that helps disambiguate terminology, intent, applicability, and constraints.
- TL;DR: Explains how to send multi-value data to Adobe Target Recommendations and how to use it in inclusion rules with the multi-value operators.
Intents:
- Understand what a multi-value field is and when to use one.
- Send multi-value data to Target Recommendations as a JSON array, including in a CSV file.
- Use the operators is contained in list and is not contained in list in inclusion rules.
- Exclude recently watched items from recommendations with a profile script.
- Recommend items from the favorites of a user.
- Create criteria that use multi-value filtering rules through the Adobe Target APIs.
Glossary:
- Multi-value field: a field that holds several values for the same item or visitor.
- is contained in list (product-specific): an operator available for multi-value entity, profile, and mbox attributes.
- is not contained in list (product-specific): an operator available for multi-value entity, profile, and mbox attributes.
Guardrails:
- Support for dynamic matching to multi-value attributes is currently available only in criteria that use a profile attribute matching or parameter (mbox) attribute matching rule that compares a single value on the left side to a multi-value on the right side.
- Multi-value attributes are not currently supported in promotions, entity attribute matching, or for lists on the left side of inclusion rules.
Terminology:
- Canonical name: multi-value attributes (variants: multi-value field, multi-value data)
- Product name: Adobe Target Recommendations (variants: Target Recommendations, Recommendations)
FAQ:
- How does Recommendations identify multi-value data? It should be sent as a JSON array, and when an entity attribute, profile attribute, or mbox parameter is provided as multi-value in this format, Recommendations automatically infers that the field is multi-value.
- How is a multi-value entity attribute sent in a CSV file? As a JSON array in the cell of the attribute.
- Which operators can be used with multi-value entity, profile, and mbox attributes? is contained in list and is not contained in list.
- Can multi-value attributes be used in promotions? No, multi-value attributes are not currently supported in promotions.
- Can criteria that use multi-value filtering rules be created through the APIs? Yes, they can be created through the Adobe Target APIs, like all criteria.
Examples:
- Exclude recently watched items: to prevent any movies in the last ten watched movies of the user from being recommended, write a profile script called
user.lastWatchedMoviesthat tracks the last ten viewed movies as a JSON array, then use the inclusion rule Profile Attribute Matchingid - is not contained in list - user.lastWatchedMovies. Its JSON API representation uses the operationisNotContainedInListwith a source of typePROFILE. - Recommend items from the favorites of the user: to recommend concert tickets only when the band playing is one of the favorite bands of the user, two items are required, a profile variable called
profile.favoriteBandsand an attributeentity.artistPerformingin the catalog. The inclusion rule is Profile Attribute MatchingartistPerforming - is contained in list - profile.favoriteBands. Its JSON API representation uses the operationisContainedInListwith a source of typePROFILE. - API creation of criteria recommending items from the favorites of a user: an API call to
https://<serverhost>/api/recs/<client>/criteria/itemcreates a criteria where the entity attributeidis contained in the mbox parameter listfavorites(operationisContainedInList, source of typeMBOX). This call is paired with JavaScript on the page that passes in the content of the favorites withmboxCreate, as a JSON array. - Scenarios for a multi-value field: movies offered to users (a given movie has multiple actors), tickets sold for concerts (a given user has multiple favorite bands), clothing sold (a shirt is available in multiple sizes).
Related pages:
- For a multi-value parameter in JavaScript (
targetPageParams): Implementing multi-value attributes (c-recommendations/c-products/custom-entity-attributes.md)
Personas:
- marketer: Can use the operators is contained in list and is not contained in list with multi-value entity, profile, and mbox attributes in inclusion rules. The page states that support for dynamic matching to multi-value attributes is currently available only in criteria that use a profile attribute matching or parameter (mbox) attribute matching rule that compares a single value on the left side to a multi-value on the right side. Where: “Use multi-value attributes in inclusion rules”.
- developer: Can send multi-value data to Recommendations as a JSON array, send a multi-value entity attribute in a CSV file as a JSON array in the cell of the attribute, and create criteria that use multi-value filtering rules through the Adobe Target APIs. The page states that Recommendations automatically infers that the field is multi-value when an entity attribute, profile attribute, or mbox parameter is provided in this format. Where: “FAQ”.
Onboarding:
- Level: Intermediate, Experienced
- First minimal step: Send multi-value data to Recommendations as a JSON array.