Learn how to create custom targeting attributes in Builder to go beyond built-in targeting options.
Define custom attributes to tailor content delivery based on user roles, preferences, or other unique conditions for a more dynamic and personalized user experience.
- Make sure you're familiar with the basics of Targeting Content.
- You make custom targeting attributes in the Settings and apply them in the Visual Editor.
- In your code, pass custom targeting attributes to Builder’s API or set them globally using
setUserAttributes()
.
- Go to Space Settings.
- Under the Targeting section, click Edit button for Custom Targeting.
- Click + New Target Attribute button.
- Define targeting properties, such as
Name
,Type
, andEnum
in the Custom targeting attributes dialogue. - Click Save.
The targeting properties:
- Name specifies the name of the custom targeting attribute.
- Type determines how values are entered. A
String
type provides a text box as an input, while aboolean
type includes a toggle switch to selecttrue
orfalse
. - Enum is available only for
String
types. This option replaces the text box with a dropdown menu, requiring users to select from predefined options when targeting content.
This video below shows how to create custom targeting attributes in Settings.
Target content using custom targeting attributes by setting conditions with the defined attributes.
The process is similar to targeting with built-in attributes, with custom targeting attributes included in the list of options for creating targeting conditions.
- Open the content entry you want to target.
- Click the Targeting icon at the top of the Visual Editor.
- Click + Add Target.
- Choose a targeting attribute from the dropdown and set its value based on the attribute type.
The video below covers setting up custom targeting attributes in the Visual Editor.
Targeting attributes store user input based on their type and determine how values are defined in content API requests. The API request must include the exact value to properly display the targeted content.
For example, userType
with the value premium
is passed to the Content API request.
You can create and use custom types with plugins like Shopify, Cloudinary, BigCommerce, Magento, and others. These plugins provide rich interfaces for inputs such as colors, forms, or products. The stored values depend on the editor and may not always be immediately clear.
For more details on stored values, see Extending the UI with custom types in the Making a Plugin.
Take your targeting a step further by scheduling your content and creating A/B tests to measure your Page or Section engagement.