--- title: "How to Categorize Contacts by Engagement or Purchase Recency Using Profile-Based Automation" slug: "recipient-activity-mapping" updated: 2024-03-07T13:04:05Z published: 2024-03-07T13:04:05Z canonical: "docs.mapp.com/recipient-activity-mapping" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.mapp.com/llms.txt > Use this file to discover all available pages before exploring further. # How to Categorize Contacts by Engagement or Purchase Recency Using Profile-Based Automation You can use a mapping to assign one of several possible values to a contact, based on an analysis of the data in his profile. A mapping allows you to create more complex selections than the ​Selections​ or the ​Selection Builder​. This topic contains the following examples: - Hot / Warm / Cold (based on the date when a contact last clicked on a message link) - Gold / Silver / Bronze (based on the date when a contact last completed a purchase) ## Hot / Warm / Cold (Based on Last Click)​ This example creates a mapping that categorizes contacts based on their most recent click date. - **Hot:** The contact made a purchase within the last 2 weeks. - **Warm:** The contact made a purchase between 4 weeks and 2 weeks ago. - **Cold:** The contact made a purchase between 8 weeks and 4 weeks ago. ### Procedure 1. Create an event-based automation to store the date of your contact's last purchase in a custom user attribute with the name ​LastClickDate​. The data type is **Date**. 2. Create a new custom user attribute with the name ​**Category**​. The date type is string. Enumerate the 3 values in advance: Hot, Warm and Cold. 3. Create a mapping with three conditions. From the ​**Target Attribute​** drop-down list, select the attribute ​**Category**​. **Tab. : Mapping** | Condition | When | Then | | --- | --- | --- | | 1 | ${ecm:greater(user.CustomAttribute.LastClickDate, ecm:addInterval(date.today, '-2W'))} | Hot | | 2 | ${ecm:between(user.CustomAttribute.LastClickDate, ecm:addInterval(date.today, '-4W'), ecm:addInterval(date.today, '-2W'))} | Warm | | 3 | ${ecm:between(user.CustomAttribute.LastClickDate, ecm:addInterval(date.today, '-8W'), ecm:addInterval(date.today, '-4W'))} | Cold | 4. Click the ​**Save**​ button. 5. Select the profile-based automation and click the ​**Activate**​ button. ⇒ The profile-based automation is now active. 6. Click the ​**Apply Automations​** button. ⇒ Engage applies the automation to all contacts in the system. This can take a long time. An email notifies you when the automation is finished. ## Gold / Silver / Bronze (Based on Last Purchase)​ This example creates a mapping that categorizes contacts based on their most recent purchase on your website. Contacts are categorized as gold, silver or bronze. - **Gold:** The contact made a purchase within the last 6 weeks. - **Silver:** The contact made a purchase between 6 months and 6 weeks ago. - **Bronze:** The contact made a purchase between 12 months and 6 months ago. ### Procedure 1. Create an event-based automation to store the date of your contact's last purchase in a custom user attribute with the name ​LastPurchaseDate​. The date type is **Date**. 2. Create a new custom user attribute with the name ​**Category**​. The date type is string. Enumerate the 3 values in advance: Gold, Silver and Bronze. 3. Create a mapping with three conditions. From the ​**Target Attribute**​ drop-down list, select the attribute ​**Category**​. **Tab. : Mapping** | Condition | When | Then | | --- | --- | --- | | 1 | ${ecm:greater(user.CustomAttribute.LastPurchaseDate, ecm:addInterval(date.today, '-6W'))} | Gold | | 2 | ${ecm:between(user.CustomAttribute.LastPurchaseDate, ecm:addInterval(date.today, '-6M'), ecm:addInterval(date.today, '-6W'))} | Silver | | 3 | ${ecm:between(user.CustomAttribute.LastPurchaseDate, ecm:addInterval(date.today, '-12M'), ecm:addInterval(date.today, '-6M'))} | Bronze | 4. Click the ​**Save**​ button. 5. Select the profile-based automation and click the ​**Activate**​ button. ⇒ The profile-based automation is now active. 6. Click the ​**Apply Automations**​ button. ⇒ Engage applies the automation to all contacts in the system. This can take a long time. An email notifies you when the automation is finished.