在此页面上:了解哪些实体属性将产品或内容信息传递给Adobe Target Recommendations,以及如何定义每个实体属性。
使用实体属性将产品或内容信息传递到Adobe Target Recommendations,可在其中显示产品或内容信息并将其用于包含规则、收藏集和排除项。 实体是您要推荐的项目,例如产品、内容(文章、幻灯片、图像、电影和电视节目)、工作列表、餐厅等。 Recommendations发送在算法中使用的productId或productPurchasedId(在代码中称为entity.id)。
请考虑以下事项:
entity.id必须与发送至订单确认页面的productPurchasedId以及Adobe Analytics产品报表中使用的productId匹配。- 您传递到Recommendations的实体属性值会在61天后过期。 Adobe建议您每月至少为目录中的每个项目向Recommendations传递一次每个实体属性的最新值。
大多数预定义参数仅接受单个值,且新值会覆盖旧值。 categoryId参数为异常(请参阅entity.categoryId)。
通常,如果您将at.js 1.x与mboxCreate一起使用,则显示信息mbox类似于以下示例。 所有实体参数属性都区分大小写。
如果您使用的是at.js 2.x,则不再支持mboxCreate(如以下示例中所用)。 要使用at.js 2.x将产品或内容信息传递给Recommendations,请使用targetPageParams。 有关示例,请参阅计划和实施推荐。
| code language-javascript |
|---|
|
pageUrl 和 thumbnailUrl 首选使用相对 URL,而非绝对 URL,因为“推荐”会接收从您网站上的所有环境发送的数据。 使用相对 URL 可避免硬编码链接指向临时服务器或开发服务器。如果mbox位于产品页面上,则您可以同时包含产品ID和类别ID。 所选的算法决定了要显示的内容。 产品 ID 用于亲和算法,类别 ID 用于分类算法。
可用变量
下表列出了可用的变量。 该表后面的子部分提供了有关需要它的变量的更多信息。
entity.name'entity.name=Giants& vs& Rockies& 5/12'entity.brand'entity.brand=brandxyz'entity.pageUrl'entity.pageUrl=baseball/giants-tix/giantsvrockies5.12.2000-67833'entity.thumbnailUrl'entity.thumbnailUrl=baseball/giants-tix/giants-136px.gif'entity.messageentity.message定义要在模板中与产品一起显示的附加信息。'entity.message=Family special'entity.value'entity.value=15.99'entity.margin'entity.margin=1.00'entity.event.detailsOnly'entity.event.detailsOnly=true'entity.id entity-id
字母数字ID必须在使用的所有Adobe Experience Cloud产品(包括Analytics)中均相同,以便各个产品能够识别该项目并共享与其相关的数据。
entity.id值必须 不 包含空格、斜杠、&符号、问号、百分比符号、逗号或其他在REST API调用中传递时需要URL编码的标点字符。 允许使用连字符和下划线。 在 entity.id 值中包含无效标点符号会导致某些 Recommendations 功能失败。
entity.categoryId entity-category-id
entity.categoryId值可以包含多个类别,例如羊毛衫子节(例如,womens、womens:sweaters、womens:sweaters:cardigans)。 多个类别必须以逗号分隔。 新的categoryId值不会覆盖现有值,而是在实体更新期间附加。 categoryId值限制为250个字符。
categoryId可以传递到用于显示该特定推荐的mbox中。 categoryId的值必须与 产品详细信息 页面上传递的entity.categoryId的值完全匹配。示例:
- 产品详细信息页面示例:
womens,womens:sweaters,womens:sweaters:cardigans - 示例类别页面毛衣:
womens:sweaters - 示例类别页面Cardigans:
womens:sweaters:cardigans
对于基于类别的推荐,使用逗号分隔类别值。 以逗号分隔的任意值都会变成类别。 您也可以使用不同的分隔符(例如冒号 (:))来分隔类别值中的子类别,从而定义子类别。
例如,在以下代码中,妇女类别分为几个子类别:
mboxCreate('mboxName', 'entity.id=343942-32', 'entity.categoryId= Womens, Womens:Outerwear, Womens:Outerwear:Jackets, Womens:Outerwear:Jackets:Parka, Womens:Outerwear:Jackets:Caban', 'entity.thumbnailUrl=...', 'entity.message=...');
对于 mbox 提交,会对键值使用最长的属性名称。 如果属性名称长度相同,则使用最后一个属性。 在上述示例中,类别键值为Womens:Outerwear:Jackets:Caban。
entity.inventory entity-inventory
空库存属性处理:对于交付,如果您具有包含规则、集合规则或标准设置,其中entity.inventory > 0或entity.inventory = 0,并且产品未设置库存,则Target会将此值计算为TRUE,并包含未设置库存的产品。 因此,未设置库存的产品将显示在推荐结果中。
同样,如果您具有全局排除规则,其中 entity.inventory = 0,并且产品未设置 entity.inventory,则 Target 会将此规则计算为 TRUE 并排除产品。
entity.inventory = 0的规则,产品搜索不显示未设置库存值的产品。实体。自定义 entity-custom
您最多可以定义100个自定义变量。 您可为每个自定义属性指定任意一个未使用过的属性名称。 例如,您可以创建一个名为entity.genre的自定义属性来定义书籍或电影。 票务供应商可以为活动场地创建属性以用于辅助表演,例如体育活动中的客队或音乐会中的开场表演。
限制:
- 您无法将预定义实体属性的名称用于自定义实体属性。
entity.environment属性由系统保留,该属性不能用于自定义实体属性。 尝试使用targetPageParams、信息源或API传递entity.environment的操作将被忽略。
示例:
'entity.venue=AT&T Park'
'entity.secondary=Rockies'
自定义实体属性支持多个值。 有关字符和值限制,请参阅自定义实体属性。
示例: 'entity.secondary=["band1", "band2"]'
多值自定义实体属性需要使用有效的 JSON 数组。 有关正确的语法信息,请参阅自定义实体属性。
entity.event.detailsOnly entity-event-details-only
使用此参数可阻止mbox调用递增算法的行为数据计数器。
在以下示例中,第一个mbox调用会更新目录和行为数据。 第二个mbox调用仅更新目录。
mboxCreate('myMbox', 'profile.geo.city = new york', 'profile.geo.state = new york', 'entity.id = 123', 'entity.inventory = 4' )
mboxCreate('myMbox', 'profile.geo.city = new york', 'profile.geo.state = new york', 'entity.id = 123', 'entity.inventory = 4', 'entity.event.detailsOnly=true' )
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: Entity attributes pass product or content information to Adobe Target Recommendations, and the page lists the available variables and how to define each one.
Intents:
- Pass product or content information to Recommendations with entity attributes.
- Find which entity variables are available, whether each accepts a single value or multiple values, and an example of each.
- Define
entity.id,entity.categoryId, andentity.inventorycorrectly. - Define custom entity attributes.
- Prevent an mbox call from incrementing behavioral data counters for an algorithm with
entity.event.detailsOnly.
Glossary:
- Entity: an item you want to recommend, such as a product, content (articles, slide shows, images, movies, and television shows), a job listing, or a restaurant.
entity.id: the name in the code of theproductIdorproductPurchasedIdthat Recommendations sends and that is used in the algorithms.- Custom entity attribute (product-specific): an
entity.custom variable that provides additional information about the item. entity.event.detailsOnly: a parameter that prevents an mbox call from incrementing behavioral data counters for an algorithm.
Guardrails:
entity.idmust match theproductPurchasedIdsent to the order confirmation page and theproductIdused in Adobe Analytics product reports.- Entity attribute values that you pass to Recommendations expire after 61 days.
- All entity parameter attributes are case-sensitive.
- Most predefined parameters accept a single value only, with new values overwriting old values. The
categoryIdparameter is the exception. entity.idis required and accepts a single value only. Its values must not contain spaces, slashes, ampersands, question marks, percentage symbols, commas, or other punctuation characters that require URL encoding when passed in a REST API call. Hyphens and underscores are allowed. Including invalid punctuation in anentity.idvalue causes some Recommendations functionality to fail.entity.categoryIdaccepts a comma-delimited list of categories. NewcategoryIdvalues do not overwrite existing values but are appended during entity update. ThecategoryIdvalue is limited to 250 characters.- To show a recommendation based on a category in a Category page, only one
categoryIdcan be passed into the mbox used to display that particular recommendation, and its value must match exactly the value ofentity.categoryIdpassed on the Product Detail page. entity.inventoryrequires an integer or long value.entity.value: only the decimal format is supported (for example, 15.99). The comma format (15,99) is not supported.- You can define up to 100 custom variables. You cannot use predefined entity attribute names for custom entity attributes.
- The attribute
entity.environmentis reserved by the system and cannot be used for custom entity attributes. Attempts to passentity.environmentusingtargetPageParams, feed, or API are ignored. - Multi-value custom entity attributes (JSON array) require valid JSON arrays.
Applicability:
- at.js 1.x with
mboxCreate: the display information mbox looks like the example on the page. - at.js 2.x:
mboxCreateis no longer supported. To pass product or content information to Recommendations, usetargetPageParams.
Terminology:
- Canonical name: entity attributes (variant: entity parameter attributes)
- Canonical name: Adobe Target Recommendations (variant: Recommendations)
- Synonyms: “
productIdorproductPurchasedId” = “entity.id” (the page says the former is referred to asentity.idin the code)
FAQ:
- How long do entity attribute values last? Entity attribute values that you pass to Recommendations expire after 61 days.
- Which entity variable is required?
entity.idis required and accepts a single value only. - How many custom variables can I define? You can define up to 100 custom variables, and you can specify any unused attribute name for each custom attribute.
- Can I use
entity.environmentas a custom entity attribute? No.entity.environmentis reserved by the system, and attempts to pass it usingtargetPageParams, feed, or API are ignored. - What does
entity.event.detailsOnlydo? It prevents an mbox call from incrementing behavioral data counters for an algorithm. - What happens to products with
entity.inventorynot set in delivery? If an inclusion rule, collection rule, or criteria setting usesentity.inventory> 0 orentity.inventory= 0, Target evaluates the value to TRUE and includes the products where the inventory is not set.
Troubleshooting:
- Known issue: Product Search is inconsistent with delivery for inventory value attributes that are not set. For example, for a rule with
entity.inventory= 0, Product Search does not display products where the inventory value is not set.
Examples:
- Example of an mbox that passes entity attributes: an
mboxCreate('productPage', ...)call withentity.id,entity.name,entity.categoryId,entity.pageUrl,entity.venue,entity.secondary,entity.thumbnailUrl,entity.message,entity.value, andentity.inventory(for at.js 1.x). - Category values for
entity.categoryId: a Product Detail page passeswomens,womens:sweaters,womens:sweaters:cardigans; a Category page for Sweaters passeswomens:sweaters; a Category page for Cardigans passeswomens:sweaters:cardigans. - Subcategories in
entity.categoryId: a colon (:) can separate subcategories within the category value, as inWomens, Womens:Outerwear, Womens:Outerwear:Jackets, Womens:Outerwear:Jackets:Parka, Womens:Outerwear:Jackets:Caban. - Custom entity attributes:
entity.genrecan define a book or movie. A ticket vendor can create attributes for an event venue and for a secondary performer, such as a visiting team in a sporting event or an opening act in a concert (for example,'entity.secondary=Rockies'). A multi-value example is'entity.secondary=["band1", "band2"]'. entity.event.detailsOnly: withmboxCreate('myMbox', ..., 'entity.id = 123', 'entity.inventory = 4'), the mbox call updates the catalog and behavioral data. With'entity.event.detailsOnly=true'added, the mbox call updates only the catalog.- Product page mbox: if the mbox is on a product page, you can include both the product ID and category ID. The selected algorithm determines which displays: the product ID is used for affinity algorithms and the category ID is used for category algorithms.
Best practices:
- Adobe recommends that you pass the latest value of each entity attribute to Recommendations at least once per month for each item in your catalog.
- Relative URLs are preferred for
pageUrlandthumbnailUrlrather than absolute URLs because recommendations receive data being sent from all environments on your site. Using relative URLs avoids hardcoded links to a staging or development server.
Related pages:
- For character and value limits of custom entity attributes: Custom entity attributes (c-recommendations/c-products/custom-entity-attributes.md)
- For correct syntax of multi-value custom entity attributes (valid JSON arrays): Custom entity attributes (c-recommendations/c-products/custom-entity-attributes.md)
Personas:
- developer: Can pass product or content information to Recommendations with entity attributes such as
entity.id,entity.categoryId,entity.inventoryandentity.value. Can define up to 100 custom variables. The page states that entity attribute values that you pass to Recommendations expire after 61 days. Where: “Guardrails”.
Onboarding:
- Level: Intermediate, Experienced
- First minimal step: If you use at.js 2.x, pass product or content information to Recommendations with targetPageParams.
- Next: For character and value limits of custom entity attributes: Custom entity attributes (c-recommendations/c-products/custom-entity-attributes.md)