Category affinity

The category affinity feature in Adobe Target automatically captures the categories on your site that a user visits and then calculates the user’s affinity for each category so it can be targeted and segmented on. Category affinity helps to ensure that content is targeted to visitors who are most likely to act on that information.

Passing category affinity information into Target section_B0C8E46EEBAC4549AD90352A47787D04

Whenever a user visits your site, profile parameters specific to the visitor are recorded in the Target database. This data is tied to the user’s cookie. One useful parameter is user.categoryId, an mbox parameter assigned on a product page. As the visitor continues to browse, or returns for another session, the categories of products a particular user views can be recorded. You can also record category information by passing it as the mbox parameter user.categoryId in any mbox (including a nested mbox), as a URL parameter user.categoryId, or in Target page parameters with a global mbox. See your account representative for more details.

Separate categories with a comma to include an item in multiple categories. For example:

  • user.categoryId=clothing,shoes,nike,running,nike clothing,nike shoes,nike running shoes

Based on the frequency and recency of visits to your product categories, the category affinity (if any) a user has is recorded. Category affinity can be used to target populations for your activities.

You can use user.categoryAffinities[] in a profile script to return an array of the affinities that a visitor has populated. For more information, see user.categoryAffinities under Objects and methods in Profile attributes.

IMPORTANT
The user.categoryId attribute used for category affinity algorithm is distinct from the entity.categoryId attribute used for Adobe Target Recommendations’ product and content recommendations. user.categoryId is required to track a user’s favorite category. entity.categoryId is required to base recommendations on the current page’s or current item’s category. Pass both values to Target if you want to use both capabilities.

Business case for category affinity section_D6FF913E88E6486B8FBCE117CA8B253B

A visitor’s activity in one session, such as which category they view most often, can be used for targeting in subsequent visits. Each category page a visitor views during a session is captured, and his or her “favorite” category is calculated based on a recency and frequency model. Then, every time the visitor returns to the home page, the hero image area can be targeted to show content related to that user’s favorite category.

Example of using category affinity section_A4AC0CA550924CB4875F4F4047554C18

Suppose you sell musical instruments online and want to target sales promotions on bass guitars to visitors who have already expressed interest in guitars in the past. Using category affinity, you can create offers that display only to visitors with this category affinity.

Category affinity algorithm section_8B86C7FF50294208866ABF16F07D5EB9

The category affinity algorithm works as follows:

  • Ten points for the first category viewed
  • Five points for each category clicked after the first
  • When a new category is clicked, 1 is subtracted from all previously clicked categories
  • If a category was already clicked (seen), clicking it again does not subtract 1 from all other categories
  • If a sixth new category is clicked, the lowest scored category of the first five categories is dropped from the calculation
  • At end of session, divide all values by 2
NOTE
When several categories are passed within a single mbox call, the order of categories in categoryAffinities is not guaranteed. An arbitrary category is recorded first and receives a score of 10.

Example: category affinity algorithm

For example, viewing the mens-clothing category, then accessories, then jewelry, then accessories again in a session results in affinities of:

  • accessories: 9 (+5 – 1 + 5)

  • mens-clothing: 8 (+10 – 1 – 1)

  • jewelry: 5 (+5)

When the session ends, and the user later returns to the site, the scores are halved:

  • accessories: 4.5 (9/2)

  • mens-clothing: 4 (8/2)

  • jewelry: 2.5 (5/2)

Assuming the user then views, in order, jewelry, accessories, beauty, shoes, and womens-clothing:

  • accessories: 6.5 (4.5 + 5 – 1 – 1 - 1)

  • womens-clothing: 5 (+5)

  • jewelry: 4.5 (2.5 + 5 – 1 – 1 - 1)

  • shoes: 4 (+5 – 1)

  • beauty: 3 (+5 – 1 - 1)

  • mens-clothing is dropped after the final click of womens-clothing as the lowest-scoring category with a score of 1 (4 – 1 – 1 - 1)

When the session ends, and the user later returns to the site, the scores are halved:

  • accessories: 3.3 (6.5/2)

  • womens-clothing: 2.5 (5/2)

  • jewelry: 2.3 (4.5/2)

  • shoes: 2 (4/2)

  • beauty: 1.5 (3/2)

Use category affinity for targeting concept_5750C9E6C97A40F8B062A5C16F2B5FFC

The following sections contain information to help you use a category affinity audience for targeting in an activity.

Create an audience to use category affinity section_A27C600BBA664FE7A74F8FE076B78F40

  1. From the Audiences list, click Create Audience.

    Or

    To copy an existing audience, from the Audiences list, hover over the desired audience, then click the Copy icon. You can then edit the audience to create a similar audience.

  2. Type a descriptive audience name.

  3. Click + Add Rule > Visitor Profile.

  4. From the Visitor Profile drop-down list, select Category Affinity.

    Visitor Profile > Category Affinity

  5. Select the desired category:

    Category Affinity > Category

    Categories include:

    • Favorite Category
    • First Category
    • Second Category
    • Third Category
    • Fourth Category
    • Fifth Category

    The “Favorite Category” and “First Category” options are equivalent.

  6. Choose the Evaluator:

    • Contains (case insensitive)
    • Does Not Contain (case insensitive)
    • Equals
  7. Specify each new value in a separate line (for example, “shoes”).

  8. Click Save.

Use the category affinity audience in an activity section_91526B942D1B4AEBB8FCDF4EBFF931CF

You can use category affinity audiences in any activity. During the three-step guided workflow, on the Target step, choose the desired audience.

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: The category affinity feature in Adobe Target automatically captures the categories on your site that a user visits and calculates the user’s affinity for each category so it can be targeted and segmented on.

Intents:

  • Pass category information into Target with the user.categoryId parameter.
  • Understand how the category affinity algorithm scores categories.
  • Return the affinities a visitor has populated with user.categoryAffinities[] in a profile script.
  • Create an audience that uses category affinity.
  • Use a category affinity audience in an activity.

Glossary:

  • Category affinity (product-specific): the affinity a user has for a category, recorded based on the frequency and recency of visits to your product categories.
  • user.categoryId (product-specific): an mbox parameter assigned on a product page that records the categories of products a user views; it can also be passed as a URL parameter or in Target page parameters with a global mbox.
  • user.categoryAffinities[] (product-specific): used in a profile script to return an array of the affinities that a visitor has populated.
  • Favorite category: the category calculated for a visitor based on a recency and frequency model, from each category page the visitor views during a session.

Guardrails:

  • When several categories are passed within a single mbox call, the order of categories in categoryAffinities is not guaranteed. An arbitrary category is recorded first and receives a score of 10.
  • If a sixth new category is clicked, the lowest scored category of the first five categories is dropped from the calculation.

Prerequisites and permissions:

  • user.categoryId is required to track a user’s favorite category.

Applicability:

  • Category affinity audiences can be used in any activity.

Terminology:

  • “Favorite Category” = “First Category” (the two options are equivalent when you select a category in the Category Affinity rule of an audience).
  • Do not confuse: user.categoryId (used for the category affinity algorithm) ≠ entity.categoryId (used for Adobe Target Recommendations’ product and content recommendations). Pass both values to Target if you want to use both capabilities.

FAQ:

  • How does Target record category affinity? Based on the frequency and recency of visits to your product categories, the category affinity (if any) a user has is recorded, and it can be used to target populations for your activities.
  • How can category information be passed to Target? You can pass it as the mbox parameter user.categoryId in any mbox (including a nested mbox), as a URL parameter user.categoryId, or in Target page parameters with a global mbox.
  • How do I include an item in multiple categories? Separate the categories with a comma.
  • Which categories can I select in a Category Affinity rule? Favorite Category, First Category, Second Category, Third Category, Fourth Category and Fifth Category.
  • Which evaluators are available in a Category Affinity rule? Contains (case insensitive), Does Not Contain (case insensitive) and Equals.
  • Where can I use a category affinity audience? You can use category affinity audiences in any activity, by choosing the audience on the Target step of the three-step guided workflow.

Examples:

  • Passing several categories for one item with user.categoryId, separated by commas to include the item in multiple categories: user.categoryId=clothing,shoes,nike,running,nike clothing,nike shoes,nike running shoes.
  • Business case: a visitor’s activity in one session, such as which category they view most often, can be used for targeting in subsequent visits. Every time the visitor returns to the home page, the hero image area can be targeted to show content related to that user’s favorite category.
  • Selling musical instruments online: to target sales promotions on bass guitars to visitors who have already expressed interest in guitars in the past, create offers that display only to visitors with this category affinity.
  • Algorithm scoring: ten points for the first category viewed and five points for each category clicked after the first; when a new category is clicked, 1 is subtracted from all previously clicked categories; clicking an already clicked (seen) category again does not subtract 1 from all other categories; at the end of the session, all values are divided by 2. Viewing mens-clothing, then accessories, then jewelry, then accessories again results in accessories: 9 (+5 – 1 + 5), mens-clothing: 8 (+10 – 1 – 1) and jewelry: 5 (+5); when the session ends and the user returns, the scores are halved to 4.5, 4 and 2.5.

Related pages:

  • Return the array of affinities a visitor has populated in a profile script: user.categoryAffinities under Objects and methods in Profile attributes (c-target/c-visitor-profile/profile-parameters.md)

Personas:

  • marketer: Can create an audience that uses category affinity by adding a Visitor Profile rule with Category Affinity, selecting a category (Favorite Category, First Category, Second Category, Third Category, Fourth Category or Fifth Category), choosing an evaluator (Contains, Does Not Contain or Equals) and specifying each value on a separate line. The page states that the Favorite Category and First Category options are equivalent. Where: “Create an audience to use category affinity”.
  • developer: Can pass category information to Target with the user.categoryId mbox parameter, which can also be passed as a URL parameter or in Target page parameters with a global mbox. Can use user.categoryAffinities[] in a profile script to return an array of the affinities that a visitor has populated. Where: “Glossary”.

Onboarding:

  • Level: Intermediate
  • First minimal step: From the Audiences list, select Create Audience, then add a rule with Visitor Profile and select Category Affinity.
  • Next: Return the array of affinities a visitor has populated in a profile script: user.categoryAffinities under Objects and methods in Profile attributes (c-target/c-visitor-profile/profile-parameters.md)
recommendation-more-help
target-help-main