cs-icon.svg

Add a Custom Attribute to an Audience

After successfully creating the custom attribute in Personalize, you can add it to an Audience for better content targeting.

Prerequisites

  • Contentstack account
  • Access to the Contentstack Organization that has Personalize enabled
  • Access to a project in Personalize
  • A custom attribute already created in Personalize

Steps for Execution

Note: For this guide, we have assumed that you have already created a Personalize project. If not, please follow this guide and create a project in Personalize.

After creating a custom attribute, you can add it to an Audience. Log in to your Contentstack account and perform the following steps:

  1. In the left navigation panel, click the Personalize icon.
  2. You will be redirected to the Personalize Projects landing page. Click the project for which you want to add the custom attribute.
  3. Click the Audiences tab in the left navigation panel, and then click the + New Audience button to create a new audience if you have not created one already.

    Note: If you have an existing Audience in your Personalize project, open it or click the corresponding vertical ellipses under the Actions section, select Edit, and jump directly to step 5.

  4. On the Audience page, provide a suitable Name and an optional Description for the audience.
  5. In the Rules section, click the click the + Add Rule button.
    1. To add the custom attribute:
      1. Click the Select attribute dropdown.
      2. Scroll and click the preferred custom attribute from the drop-down list.
      3. Click Select operator to select an attribute-specific operator.
      4. Enter a matching criterion for the condition in the Enter a value field.
      Similarly, you can add multiple attributes (preset and custom) to an Audience.

      Additional Resource: You can use the Personalize Edge API to set and update user attributes.

    2. Once you have done that, click the Save button.

This adds the new custom attribute to your audience.

Additional Resource: You can use the Personalize Management API to create or update audiences with a custom attribute, delete, and retrieve all existing attributes.

Was this article helpful?
^