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:
- In the left navigation panel, click the Personalize icon.
- You will be redirected to the Personalize Projects landing page. Click the project for which you want to add the custom attribute.
- 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.
- On the Audience page, provide a suitable Name and an optional Description for the audience.
- In the Rules section, click the click the + Add Rule button.
- To add the custom attribute:
- Click the Select attribute dropdown.
- Scroll and click the preferred custom attribute from the drop-down list.
- Click Select operator to select an attribute-specific operator.
- Enter a matching criterion for the condition in the Enter a value field.
Additional Resource: You can use the Personalize Edge API to set and update user attributes.
- Once you have done that, click the Save button.
- To add the custom attribute:
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.