Sur cette page : Trouvez des réponses aux questions fréquentes sur les conceptions Adobe Target Recommendations.

Comment le prix d'un article recommandé peut-il afficher les deux chiffres à droite de la décimale ?

Par défaut, les valeurs numériques (telles que entity.value) renvoyées dans les conceptions n’affichent pas de zéros de fin après la décimale. Par exemple, si un article coûte 35,00 $, entity.value est égal à 35 et seul 35 est affiché sur la page, et non 35,00 $.

Deux solutions permettent de résoudre ce problème:

  • Les scripts Velocity ou JavaScript peuvent mettre en forme la valeur renvoyée.

  • Le prix de l’article peut être transmis dans deux attributs d’entité distincts. Le premier, entity.value, peut être utilisé pour les comparaisons numériques (comme les règles de comparaison de prix). Le second doit être un attribut personnalisé, tel que entity.displayValue, qui stocke la valeur de l’entité sous la forme d’une chaîne pour permettre un rendu correct.

    Par exemple :

    "entity.value" : 35.00, "entity.displayValue" : "$35.00"

Pourquoi la catégorie n’est-elle pas affichée dans la conception lorsque $entity1.categoryId est utilisé ?
L’ID de catégorie ne peut pas être affiché dans une conception. Plusieurs catégories peuvent être stockées. Par conséquent, le système ne sait pas quelle catégorie afficher.
Comment modifier une conception pour obtenir une mise à jour instantanée ?
La modification d’une conception en cours d’utilisation prend du temps. Pour modifier la conception instantanément, créez une nouvelle conception, puis sélectionnez-la dans l’activité et enregistrez la recommandation.
Comment les informations clés, telles que la catégorie du produit clé, peuvent-elles être affichées dans une conception ?
Les paramètres $key capturent la plupart des informations du produit clé pour les afficher dans la conception. Par exemple, pour afficher la miniature du produit clé, utilisez $key.thumbnailURL.
Quelle version de Velocity est utilisée ?
Version 1.7, sans outils ni bibliothèques supplémentaires ajoutés. La fonctionnalité de base de Velocity est disponible.
Comment une valeur d’entité existante peut-elle être remplacée par une valeur vide, par exemple lorsque le paramètre entity.message d’un élément doit être effacé à la fin d’une promotion ?
L’envoi d’un espace insécable JavaScript semble réaliser l’opération. Les développeurs envoient \u00A0 comme valeur, par exemple entity.message=\u00A0. L’utilisation de cette valeur comme valeur par défaut lorsqu’aucune valeur n’est présente, au lieu d’une valeur nulle, peut également être prise en compte.
Un script de profil peut-il être utilisé dans une conception Recommendations ?
Oui. Pour utiliser un script de profil dans une conception Recommendations, encapsulez le nom dans \${...}. Par exemple, si le script de profil s’appelle user.basket, faites-lui référence en tant que \${user.basket} dans la conception. La barre oblique inverse implique que le script de profil n’est pas rendu par Velocity, de sorte qu’aucune opération ne peut être effectuée sur le script de profil dans un modèle Velocity. La valeur est imprimée directement sur la page.
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: Gives answers to frequently asked questions about Adobe Target Recommendations designs.

Intents:

  • Display both digits to the right of the decimal point for the price of a recommended item.
  • Change a design to get an instant update.
  • Display key information, such as the category of the key product, in a design.
  • Replace an existing entity value with a blank.
  • Use a profile script in a Recommendations design.

Glossary:

  • entity.value: a numeric value returned in designs. (product-specific)
  • entity.displayValue: a custom attribute, given as an example, that stores the value of the entity as a string to allow for proper rendering. (product-specific)
  • $key parameters: parameters that capture most of the information of the key product for display within the design. (product-specific)

Guardrails:

  • Velocity version 1.7 is used, with no additional tools or libraries added. Basic Velocity functionality is available.
  • When a profile script is wrapped in \${...}, the backslash implies that it is not rendered by Velocity, so no operations can be performed on it in a Velocity template. The value is printed directly on the page.

Terminology:

  • Canonical name: Adobe Target Recommendations
  • Variants: Recommendations

FAQ:

  • How can the price of a recommended item display both digits to the right of the decimal point? By default, numeric values (such as entity.value) returned in designs do not display any trailing zeroes after the decimal point, so an item that costs $35.00 displays only 35. Two options are available: Velocity scripting or JavaScript can apply formatting to the returned value, or the price of the item can be passed into two separate entity attributes, entity.value for numeric comparisons (such as price comparison rules) and a custom attribute, such as entity.displayValue, that stores the value of the entity as a string.
  • Why is the category not displayed in the design when $entity1.categoryId is used? The category ID cannot be displayed in a design.
  • How can a design be changed to get an instant update? Create a new design, select it in the activity, and save the recommendation.
  • How can key information, such as the category of the key product, be displayed in a design? Use the $key parameters, which capture most of the information of the key product for display within the design. For example, use $key.thumbnailURL to display the thumbnail of the key product.
  • How can an existing entity value be replaced with a blank, for example when the entity.message of an item must be cleared at the end of a promotion? Sending a JavaScript non-breaking space appears to do this. The developers send \u00A0 as the value, for example entity.message=\u00A0. Using that value as the default when no value is present, instead of a null, can also be considered.
  • Can a profile script be used in a Recommendations design? Yes. Wrap the name of the profile script in \${...}. For example, if the profile script is named user.basket, refer to it as \${user.basket} in the design.

Troubleshooting:

  • The category is not displayed in the design when $entity1.categoryId is used. Multiple categories can be stored, so the system does not know which category to display.
  • Altering the design that is currently in use takes a while to update. To change the design instantly, create a new design, select it in the activity, and save the recommendation.

Examples:

  • Passing the price of an item into two separate entity attributes so that entity.value can be used for numeric comparisons and the custom attribute can be used for proper rendering: "entity.value" : 35.00, "entity.displayValue" : "$35.00"
  • Displaying the thumbnail of the key product in a design: $key.thumbnailURL
  • Sending a JavaScript non-breaking space, which appears to replace an existing entity value with a blank, for example when the entity.message of an item must be cleared at the end of a promotion: entity.message=\u00A0
  • Referring to a profile script named user.basket in a design: \${user.basket}

Personas:

  • developer: Can apply formatting to a returned value with Velocity scripting or JavaScript, or pass the price of an item into entity.value and a custom attribute such as entity.displayValue. Can use $key.thumbnailURL to display the thumbnail of the key product, and refer to a profile script named user.basket as \${user.basket} in a design. Where: “FAQ”.
  • marketer: Can create a new design, select it in the activity, and save the recommendation to change a design instantly. The page states that altering the design currently in use takes a while to update. Where: “FAQ”.

Onboarding:

  • Level: Intermediate, Experienced
  • First minimal step: Create a new design, select it in the activity, and save the recommendation to change a design instantly.
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.