Run-Time Context for Recommendations Email Experiences

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.

  1. 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.

    A recommendation strategy named 'Brand Run-Time Filter'

  2. Click ADD FILTER, and then select the attribute on which you want to filter the recommendations.

    Callout of the ADD FILTER button in the 'Recommendation Filters' section of the recommendation strategy configuration page

  3. Select the operator for the filter equation.

    Callout of the operator selector

  4. Click USE DYNAMIC VALUE.

    Callout of the USE DYNAMIC VALUE button

  5. Select the dynamic value option that contains with Run-Time Filter (for Email).

    Callout of the dynamic value option that includes 'with Run-Time Filter (for Email)'

  6. Click SAVE.

    Callout of the SAVE button

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.

The ESP's customer identifier must be sent to the Monetate platform as part of the Web Track process or some equivalent means.

Callouts of the customer_id value placeholder that must be replaced in the generated HTML code

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.

Callout of the pass-through parameter for item group IDs and the parameter's placeholder within the HTML code for a Product Recommendations for Email experience

You must replace the $runTimeFilter placeholder with at least one and no more than five item_group_id values that you pass to Monetate.

The item_group_id value(s) that you use must be in the product catalog associated with each recommendation strategy that is configured with the Item group ID(s) in run-time parameter (for email) setting that you selected when configuring the experience's action. This requirement applies to the recommendation strategies you selected for recommendation strategies A through D in the action template as well as for the optional fallback recommendation strategies. Otherwise, no results will be returned.

If you use multiple values, ensure they're in a properly formed string with each comma replaced with %2C.

Callout of a item group ID parameter with three values

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.

Callout of each occurence of the $runTimeFilter placeholder in the email experience HTML code

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.

Animated demonstration of a user adding a query string parameter in the email 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.

Table of Contents