[Premium]{class="badge positive" title="查看Target Premium中包含的内容。"}

实体属性 entity-attributes

在此页面上:​了解哪些实体属性将产品或内容信息传递给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。 有关示例,请参阅计划和实施推荐。

传递实体属性的mbox示例
code language-javascript
<div class="mboxDefault"></div><script language="JavaScript1.2">

mboxCreate('productPage',

'entity.id=67833',

'entity.name=GIANTS VS ROCKIES 5/12',

'entity.categoryId=BASEBALL, GIANTS, SF BAY AREA',

'entity.pageUrl=/help/baseball/giants-tix/giantsvrockies5.12.2000-67833',

'entity.venue=AT&T PARK',

'entity.secondary=ROCKIES',

'entity.thumbnailUrl=/help/baseball/giants-tix/giants-136px.gif',

'entity.message=FAMILY SPECIAL',

'entity.value=15.99',

'entity.inventory=1'

);

</script>
NOTE
pageUrl 和 thumbnailUrl 首选使用相对 URL,而非绝对 URL,因为“推荐”会接收从您网站上的所有环境发送的数据。 使用相对 URL 可避免硬编码链接指向临时服务器或开发服务器。

如果mbox位于产品页面上,则您可以同时包含产品ID和类别ID。 所选的算法决定了要显示的内容。 产品 ID 用于亲和算法,类别 ID 用于分类算法。

可用变量

下表列出了可用的变量。 该表后面的子部分提供了有关需要它的变量的更多信息。

变量
值
描述
示例
entity.id
仅限单个值。 必需。
标识产品。 请参阅entity.id。
'entity.id=67833'
entity.name
仅限单个值。
推荐产品时网站上显示的产品名称。
'entity.name=Giants& vs& Rockies& 5/12'
entity.categoryId
多值(逗号分隔列表)。
当前页面的类别。 请参阅entity.categoryId。
'entity.categoryId=womens:sweaters'
entity.brand
仅限单个值。
显示项目的品牌名称。
'entity.brand=brandxyz'
entity.pageUrl
仅限单个值。
为能购买该项目的页面定义相关的 URL。
'entity.pageUrl=baseball/giants-tix/giantsvrockies5.12.2000-67833'
entity.thumbnailUrl
仅限单个值。
将相关的 URL 定义到显示该项目的缩略图图像。
'entity.thumbnailUrl=baseball/giants-tix/giants-136px.gif'
entity.message
仅限单个值。
与推荐中显示的产品相关的消息,例如“打折”或“清仓”。 消息通常比产品名称更详细。 使用entity.message定义要在模板中与产品一起显示的附加信息。
'entity.message=Family&nbsp;special'
entity.inventory
仅限单个值。 必须为整数或长整型值。
显示项目的库存水平。 请参阅entity.inventory。
'entity.inventory=1'
entity.value
仅限单个值。
定义项目的价格或价值。 仅支持小数格式(例如,15.99)。 不支持逗号格式(15,99)。
'entity.value=15.99'
entity.margin
仅限单个值。
项目的利润率或其他价值。
'entity.margin=1.00'
entity.custom
多值(JSON数组)。
提供有关项目的其他信息的自定义变量。 请参阅实体。自定义。
'entity.secondary=Rockies'
entity.event.detailsOnly
仅限单个值。
防止mbox调用递增算法的行为数据计数器。 请参阅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个字符。

NOTE
要基于​ 类别 ​页面中的类别显示推荐,则只有一个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 并排除产品。

NOTE
已知问题:​产品搜索与未设置的库存值属性的交付不一致。 例如,对于具有entity.inventory = 0的规则,产品搜索不显示未设置库存值的产品。

实体。自定义 entity-custom

您最多可以定义100个自定义变量。 您可为每个自定义属性指定任意一个未使用过的属性名称。 例如,您可以创建一个名为entity.genre的自定义属性来定义书籍或电影。 票务供应商可以为活动场地创建属性以用于辅助表演,例如体育活动中的客队或音乐会中的开场表演。

限制:

  • 您无法将预定义实体属性的名称用于自定义实体属性。
  • entity.environment 属性由系统保留,该属性不能用于自定义实体属性。 尝试使用targetPageParams、信息源或API传递entity.environment的操作将被忽略。

示例:

'entity.venue=AT&T&nbsp;Park'

'entity.secondary=Rockies'

自定义实体属性支持多个值。 有关字符和值限制,请参阅自定义实体属性。

示例: 'entity.secondary=["band1",&nbsp;"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' )
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: 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, and entity.inventory correctly.
  • 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 the productId or productPurchasedId that 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.id must match the productPurchasedId sent to the order confirmation page and the productId used 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 categoryId parameter is the exception.
  • entity.id is 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 an entity.id value causes some Recommendations functionality to fail.
  • entity.categoryId accepts a comma-delimited list of categories. New categoryId values do not overwrite existing values but are appended during entity update. The categoryId value is limited to 250 characters.
  • To show a recommendation based on a category in a Category page, only one categoryId can be passed into the mbox used to display that particular recommendation, and its value must match exactly the value of entity.categoryId passed on the Product Detail page.
  • entity.inventory requires 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.environment is reserved by the system and cannot be used for custom entity attributes. Attempts to pass entity.environment using targetPageParams, 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: mboxCreate is no longer supported. To pass product or content information to Recommendations, use targetPageParams.

Terminology:

  • Canonical name: entity attributes (variant: entity parameter attributes)
  • Canonical name: Adobe Target Recommendations (variant: Recommendations)
  • Synonyms: “productId or productPurchasedId” = “entity.id” (the page says the former is referred to as entity.id in 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.id is 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.environment as a custom entity attribute? No. entity.environment is reserved by the system, and attempts to pass it using targetPageParams, feed, or API are ignored.
  • What does entity.event.detailsOnly do? It prevents an mbox call from incrementing behavioral data counters for an algorithm.
  • What happens to products with entity.inventory not set in delivery? If an inclusion rule, collection rule, or criteria setting uses entity.inventory > 0 or entity.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 with entity.id, entity.name, entity.categoryId, entity.pageUrl, entity.venue, entity.secondary, entity.thumbnailUrl, entity.message, entity.value, and entity.inventory (for at.js 1.x).
  • Category values for entity.categoryId: a Product Detail page passes womens, womens:sweaters, womens:sweaters:cardigans; a Category page for Sweaters passes womens:sweaters; a Category page for Cardigans passes womens:sweaters:cardigans.
  • Subcategories in entity.categoryId: a colon (:) can separate subcategories within the category value, as in Womens, Womens:Outerwear, Womens:Outerwear:Jackets, Womens:Outerwear:Jackets:Parka, Womens:Outerwear:Jackets:Caban.
  • Custom entity attributes: entity.genre can 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",&nbsp;"band2"]'.
  • entity.event.detailsOnly: with mboxCreate('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 pageUrl and thumbnailUrl rather 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.inventory and entity.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)
recommendation-more-help
target-help-main