Sur cette page : Découvrez comment envoyer des données à plusieurs valeurs à Adobe Target Recommendations et comment les utiliser dans des règles d’inclusion avec les opérateurs à plusieurs valeurs.

Un champ à plusieurs valeurs contient plusieurs valeurs pour le même élément ou visiteur. Par exemple :

  • Films proposés aux utilisateurs : un film donné compte plusieurs acteurs.
  • Billets vendus pour des concerts : un utilisateur donné a plusieurs groupes préférés.
  • Vêtements vendus : une chemise est disponible en plusieurs tailles.

Pour gérer les recommandations dans ces scénarios, les données à plusieurs valeurs peuvent être transmises à Target Recommendations et utilisées avec des opérateurs spéciaux à plusieurs valeurs.

Envoi de données à plusieurs valeurs

Pour permettre à Recommendations d’identifier des données à plusieurs valeurs, elles doivent être envoyées sous la forme d’un tableau JSON.

Pour un paramètre à plusieurs valeurs dans JavaScript (targetPageParams), consultez Implémentation des attributs à plusieurs valeurs.

Dans un fichier CSV, un attribut d’entité à plusieurs valeurs est envoyé sous la forme d’un tableau JSON dans la cellule de l’attribut, comme dans l’exemple suivant.

Exemple de fichier CSV avec un attribut à plusieurs valeurs
## RECSRecommendations Upload File,,,,,,,,,,,,,,,,,,,
## RECS''## RECS'' indicates a Recommendations pre-process header. Please do not remove these lines.,,,,,,,,,,,,,,,,,,,
## RECS,,,,,,,,,,,,,,,,,,,
## RECSUse this file to upload product display information to Recommendations. Each product has its own row. Each line must contain 19 values and if not all are filled a space should be left.,,,,,,,,,,,,,,,,,,,
## RECSThe last 100 columns (entity.custom1 - entity.custom100) are custom. The name 'customN' can be replaced with a custom name such as 'onSale' or 'brand'.,,,,,,,,,,,,,,,,,,,
## RECSIf the products already exist in Recommendations then changes uploaded here will override the data in Recommendations. Any new attributes entered here will be added to the product''s entry in Recommendations.,,,,,,,,,,,,,,,,,,,
## RECSentity.id ,entity.name,entity. categoryId ,entity. message ,entity.thumbnailUrl ,entity.value ,entity.pageUrl ,entity.inventory ,entity.margin ,entity.custom1 ,entity.custom2 ,entity.custom3 ,entity.custom4,entity.custom5,entity.custom6,entity.custom7,entity.custom8,entity.custom9,entity.custom10,
1,Sample Product 1,category1,Save 10%,http://sample.store/products/images/product1_th.jpg,325,http://sample.store/products/product_detail.jsp?productId=1,1000,48,a,"[ ""v1"", ""v2"" ]",, , , , , , , ,
2,Sample Product 2,category1,Save 10%,http://sample.store/products/images/product2_th.jpg,369,http://sample.store/products/product_detail.jsp?productId=2,1000,52,a,"[ ""v1"", ""v2"" ]",, , , , , , , ,
3,Sample Product 3,category1,Save 10%,http://sample.store/products/images/product3_th.jpg,479,http://sample.store/products/product_detail.jsp?productId=3,1000,78,a,"[ ""v1"", ""v2"" ]",,,,,,,,,
4,Sample Product 4,category1,Save 10%,http://sample.store/products/images/product4_th.jpg,409,http://sample.store/products/product_detail.jsp?productId=4,1000,66,a,"[ ""v1"", ""v2"" ]",,,,,,,,,
5,Sample Product 5,category1,Save 10%,http://sample.store/products/images/product5_th.jpg,325,http://sample.store/products/product_detail.jsp?productId=5,1000,45,a,"[ ""v1"", ""v2"" ]",,,,,,,,,

Lorsqu’un attribut d’entité, un attribut de profil ou un paramètre de mbox est fourni en tant que paramètre à plusieurs valeurs dans ce format, Recommendations en déduit automatiquement que le champ est à plusieurs valeurs.

Utilisation d’attributs à plusieurs valeurs dans les règles d’inclusion

Les opérateurs suivants peuvent être utilisés avec les attributs d’entité à plusieurs valeurs, de profil et de mbox :

  • est contenu dans la liste
  • n’est pas contenu dans la liste
REMARQUE
La prise en charge de la correspondance dynamique avec les attributs à plusieurs valeurs n’est actuellement disponible que dans les critères qui utilisent une règle de correspondance d’attributs de profil ou de paramètre (mbox) qui compare une seule valeur sur le côté gauche à une valeur à plusieurs valeurs sur le côté droit. Les attributs à plusieurs valeurs ne sont actuellement pas pris en charge dans les promotions, la correspondance d’attributs d’entité ou pour les listes sur le côté gauche des règles d’inclusion.

Exemple : exclure les éléments récemment surveillés

Pour éviter que les dix derniers films visionnés par l’utilisateur ne soient recommandés, commencez par écrire un script de profil appelé user.lastWatchedMovies qui suit les dix derniers films visionnés sous la forme d’un tableau JSON. Les éléments peuvent ensuite être exclus avec la règle d’inclusion suivante :

Profile Attribute Matching
id - is not contained in list - user.lastWatchedMovies

Représentation de la règle d’inclusion par l’API JSON :

{
    "attribute": "id",
    "operation": "isNotContainedInList",
    "source": {
        "name": "user.lastWatchedMovies",
        "type": "PROFILE"
    }
}

Exemple : recommander des éléments à partir des favoris de l’utilisateur

Pour recommander des billets de concert uniquement lorsque le groupe joué est l’un des groupes préférés de l’utilisateur, deux éléments sont requis : une variable de profil appelée profile.favoriteBands qui contient les groupes préférés de l’utilisateur, et un attribut entity.artistPerforming dans le catalogue qui contient l’artiste jouant dans le concert. La règle d’inclusion suivante peut ensuite être utilisée :

Profile Attribute Matching
artistPerforming - is contained in list - profile.favoriteBands

Représentation de la règle d’inclusion par l’API JSON :

{
    "attribute": "artistPerforming",
    "operation": "isContainedInList",
    "source": {
        "name": "profile.favoriteBands",
        "type": "PROFILE"
    }
}

Exemple : création par l’API de critères recommandant des éléments des favoris d’un utilisateur

Les critères qui utilisent des règles de filtrage à plusieurs valeurs peuvent être créés via les API Adobe Target, comme tous les critères. L’exemple d’appel API suivant crée un critère dans lequel l’attribut d’entité id est contenu dans la liste des paramètres 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"
                }
            }
        ]
    }
}'

Cet appel est associé à JavaScript sur la page qui transmet le contenu des favoris :

<!-- 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>
AI Knowledge Reference

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.lastWatchedMovies that tracks the last ten viewed movies as a JSON array, then use the inclusion rule Profile Attribute Matching id - is not contained in list - user.lastWatchedMovies. Its JSON API representation uses the operation isNotContainedInList with a source of type PROFILE.
  • 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.favoriteBands and an attribute entity.artistPerforming in the catalog. The inclusion rule is Profile Attribute Matching artistPerforming - is contained in list - profile.favoriteBands. Its JSON API representation uses the operation isContainedInList with a source of type PROFILE.
  • API creation of criteria recommending items from the favorites of a user: an API call to https://<serverhost>/api/recs/<client>/criteria/item creates a criteria where the entity attribute id is contained in the mbox parameter list favorites (operation isContainedInList, source of type MBOX). This call is paired with JavaScript on the page that passes in the content of the favorites with mboxCreate, 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.
Traduit automatiquement
Utilisez le sélecteur de langue pour afficher la version anglaise de cette page.
La traduction vous a-t-elle été utile ?

Ask AI

Not sure where to start?
Ask me anything about Adobe products.

Type your question or pick a suggestion below.

Use of this AI chatbot is subject to Adobe's Privacy Policy. Don't share sensitive data. AI responses are not your Content, may be inaccurate, and any offers provided are non-binding. Generative AI Terms.