Creating a target audience begins with defining specific characteristics or behaviors known as attributes. In the Attribute Builder, you can group related attributes to create an attribute group. For example, you might have an attribute group named "E-commerce", which contains attributes like "cart_abandoned". "cart_add", and "Wishlist_items".
Let’s walk through the different parts of the Attribute Builder screen and see how we can use them to define attributes.
Datasets
On the left side of the screen, you will find all the datasets available under the data layer. These datasets contain the information we need to define attributes. When you select a dataset, it opens up a list of its columns (which are like fields containing specific types of data).
You can drag and drop any of these column names into the attribute’s fields (like the Left Value or Right Value) to create rules for the attribute you’re building.
Note: When you drag and drop or select a column in rule conditions, the associated dataset is automatically selected. However, in code mode, you must manually select the dataset by checking the box before saving the Attribute Group.
Attribute Group
On the Attribute Builder screen, you will see a field by the name Attribute Group Name. This is the name you give to your set of attributes. It should clearly describe what kind of attribute values are included in the group.
- Examples: You could name your group "Brand" (to track specific brands), "Product Purchases" (to track items bought), 'Payment Methods" (to track what payment method was used to purchase an item), or "Cart Actions" (to track cart-related activities like adding or removing items).
Note: Since all attributes for a single data layer write results to the shared attribute result tables, the attribute group name should be unique across all groups for the data layer.
There are two ways to create an Attribute Group:
- Manual Creation: You define the attributes by manually setting up the rules. For this, the 'Auto Extract' toggle on the screen should be OFF.
- Auto Extract: You let the system automatically extract the attributes based on predefined rules. Enabling this will hide the option to define the attributes manually.
In this article, we'll guide you through the process of manually creating an attribute group, where you'll define attributes by setting specific rules. If you're looking to create an attribute group using the auto-extract feature, please refer to the article Creating Attribute using Auto Extract for detailed instructions. Now, let's dive into the key fields and steps required to manually create an attribute group.
Recency
Recency defines the number of days that should be considered for the calculation of the attribute values. This field is also available when you create an attribute group using the Auto Extract feature.
There are two ways to define the Recency:
-
Within n Days:
This option checks whether the attribute condition has been met in the past n days. For example, If today is 6th Feb 2024 and you set the recency to Within 3 days, the system will check if the condition happened at any time between 4th-6th Feb 2024
So, if you want to know who purchased an "LG TV" in the last 7 days, you should set the recency to within 7 days.
-
More than m Days ago for n Days:
This means the condition has to be met more than a certain number of days ago but within a timeframe.
Example: If today is 6th Feb 2024 and you set the recency to More than 5 days for 30 days, the system will look back from 5 days ago i.e. from 1st Feb 2024, and consider data from the last 30 days i.e. from 3rd Jan 2024 to 1st Feb 2024)
Attribute Values
Once you've entered the Attribute Group Name and set the Recency value, the next step is to define the individual Attribute Values. If the Auto-Extract feature is disabled, you will need to manually configure each attribute, including naming it, setting its frequency, and specifying the conditions under which the attribute will be considered as "met."
Let’s walk through each component of the Attribute Value configuration:
Attribute Name
This should be a unique name within the attribute group that clearly describes the condition it checks.
- Example: To check users who purchased TVs, you could name the attribute value "TV Purchases".
Attribute Rules
Attribute rules define the conditions under which the attribute is triggered. These conditions can range from simple (like matching a single column value) to complex combinations of multiple conditions using AND/OR logic.
-
Requirements:
- At least one rule must be created to define an attribute.
- You cannot create an Attribute Group without at least one attribute and its associated rules.
-
How to Add Rules:
- You can select column names from any dataset available in the Data Layer.
- You also have the option to use the Function Editor to input custom values or logic.
- Use operators like equals (=), greater than (>), or contains to build conditions.
-
Drag-and-Drop Functionality:
- You can drag and drop column names from the dataset (shown on the left) directly into the fields for easy rule creation.
-
Auto-Generated Query:
- As you create or modify the attribute’s condition, an auto-generated query appears at the top, showing the current logic being applied.
Frequency
This means the reoccurrence of the attribute within the Recency period. In other words, This determines how often the attribute condition must be met within the defined Recency period for the attribute to be considered valid.
- Example: If the Frequency is set to 2, the condition must be met twice within the recency period for the attribute to be counted in the results.
Switch to code
The 'Switch to code' option allows you to manually edit the query logic by switching from the basic mode to code mode. You can click the "Switch to Code" icon to make the query editable in code format. In this mode, the simple column interface disappears, and you can directly write or modify the query.
Note: If you switch back to Basic Mode after editing the query in Code Mode, all changes made in Code Mode will be reversed. This happens because Code Mode allows for more complex queries than Basic Mode can handle.
Test icon
The Test icon allows users to execute the attribute’s query to preview how it will perform and estimate how many records meet the specified conditions before finalizing the attribute. This feature provides valuable insights and helps ensure that the attribute is working as expected. The system uses the date range specified in the Test Date Range field, frequency, and condition to evaluate the query. Here are the key benefits of using the Test feature:
- It helps to understand the impact of the query.
- Allows refinement of the conditions based on the test results.
- Ensures the attribute is accurate and effective before it is applied.
Note: When testing an attribute using the 'Test' icon, the 'Test Date Range' field(not the 'Recency' field) is used to evaluate the query. The 'Recency' field is only considered during job execution.
Example
The screenshot below shows an example of a complete Attribute Builder containing multiple attributes with various rules. Here is the explanation:
- Dataset by name tb_product is used to create an Attribute Group named Product Purchases.
- The Recency period is set to "More than 3 days ago for 2 days."
- Attribute group Product Purchases includes two attributes: TV Purchases and Laptop Purchases.
-
TV Purchases:
- Configured in Basic Mode with two conditions linked by an AND rule.
- Frequency is set to "2". This means the system will search for visitor IDs in the table tb_product that meet the specified condition twice within the selected date range. The column representing the visitor ID is mapped to the data layer as the identifier column. For more details, please refer to the Data Layer article.
-
Testing against the selected test date range yields 9 results, signifying that 9 attributes (or visitors) met the condition with at least 2 occurrences within the specified date range. In simpler terms, this indicates that 9 visitors purchased a TV twice during the specified period.
-
Laptop Purchases:
- Configured in Code Mode.
- Frequency is set to '1'. This means the system will search for visitor IDs in the table tb_product that meet the specified condition at least once within the selected date range.
-
Testing against the selected test date range yields 10 results, indicating that 10 attributes (or visitors) satisfied the condition with at least one occurrence within the specified date range. Simply put, this means 10 visitors purchased at least one laptop during the specified period.
Input & Output Datasets
The Attribute Builder screen includes two additional screens—Input Datasets and Output Datasets—accessible from the left side menu. The Input Datasets screen provides a preview of the input data with limited records, which can serve as a reference for decision-making when creating an attribute.
The Output Datasets screen displays the results table of the attribute generated after job execution. For more details on the output results table, see the article Attribute Results Table.