You can build a Product Recommendations for Email experience that dynamically sends the filters within a recommendation strategy used in the action. This filtering performed at run time is accomplished with a pass-through parameter in the email's HTML code.
For example, you want to recommend popular products to customers via email. For the first week of the campaign, you want those recommendations filtered for brand A. For the second week you want them filtered for brand B. You can accomplish this change with a simple edit you generate for the email experience.
Adding a Run-Time Filter to a Recommendation Strategy
Follow these steps to add a run-time filter to a recommendation strategy.
- Create or navigate to the recommendation strategy you want to use in the Product Recommendations for Email experience. See Create a Recommendation Strategy for the task steps.
- Click ADD FILTER, and then select the attribute on which you want to filter the recommendations.
- Select the operator for the filter equation.
- Click USE DYNAMIC VALUE.
- Select the dynamic value option that contains with Run-Time Filter (for Email).
- Click SAVE.
The recommendation strategy is ready to add to a Product Recommendations for Email experience.
Preparing the Generated HTML
You must make a few modifications to the HTML code that appears in the Generate Email HTML modal before you can use it.
Customer ID
You must replace each $customer_id
placeholder, found in both image URLs and link URLs within the generated HTML, with your ESP's customer identifier. Often you can replace $customer_id
with a subscriber merge token that dynamically resolves to the ESP identifier.
Depending on the configuration of the recommendation strategies that you selected when creating the experience's action, the generated HTML may contain one or more pass-through parameter-and-placeholder pairs. You must also replace the placeholder with its respective attribute value(s) that you want to use in the experience.
Item Group ID
If one of the recommendation strategies is configured with Item group ID(s) in run-time parameter (for email) selected for Base Recommendation on, then pt_based_on_item_group_id=$runTimeFilter
appears in the generated HTML code for the email.
You must replace the $runTimeFilter
placeholder with at least one and no more than five item_group_id
values that you pass to Monetate.
If you use multiple values, ensure they're in a properly formed string with each comma replaced with %2C
.
Recommendation Run-Time Filters
If you selected one or more recommendation strategies configured with one or more run-time filters, then you must replace the placeholder for each run-time filter parameter (for example, pt_brand=$runTimeFilter
) with a value for that attribute that you pass to Monetate.
You cannot use multiple attribute values with a recommendation run-time filter.
Other Query String Parameters
You can configure a Product Recommendations for Email experience so that you can track page visits and product purchases that result from it by adding a query string parameter for tracking purposes to the generated HTML.
Add the query string parameter at the end of each image URL and link URL in the generated HTML.
When the email recipient clicks a link in the message, they're redirected to its corresponding page on your site as expected, with the query string parameter that you'd added preserved.
See Previewing the Email Experience in Create a Product Recommendations for Email Experience to test the experience before you send the email.