Implement Email Recommendations
Constructor has two methods for implementing email recommendations: data feed templates and HTML snippets.
Data feed templates
Many email service providers (ESPs) have data feed templates, which are email templates that dynamically populate content like recommendations using data returned from API calls.
Rather than adding fixed, general recommendations in an email, companies can use data feed templates to insert personalized recommendations based on data retrieved from Constructor’s Offsite Discovery API.
You can implement data feed templates if your ESP supports data or web feeds with external URLs. Please note that the setup will vary by ESP. Please refer to your ESP’s documentation for specific instructions on setting up a feed. Both Braze and Movable Ink offer dedicated documentation for integrating with Constructor.
Note: Companies are responsible for the HTML and CSS styling of emails and specifying how item recommendations appear to recipients.
Example API call
https://offsite-discovery.cnstrc.com/v1/recommendations/pods/bestseller_pod?key=key_abCDefGHijkLM&ui=0&campaign_id=campaign_24&num_results=8
Example response
Responses can be modified to include other required properties.
{
"data": {
"id": "P455989",
"variation_id": "2745245",
"url": "/product/fashion-athletic-sneaker-P455989?skuId=2745245",
"image_url": "<https://www.examplestore.com/productimages/sku/s2745289-main-zoom.jpg?imwidth=62">
},
"value": "Fashion Athletic Sneaker"
}
Required and optional inputs
Calls to Constructor’s Offsite Discovery API should include the inputs below to return personalized recommendations for each email recipient. Companies can include optional inputs based on their strategy.
Input | Description |
---|---|
ui | This represents a user’s identifier, which is crucial for personalizing recommendation results. This ID should be the exact same user ID provided for Constructor’s tracking API. Some ESPs may a placeholder, such as {{customer_id}}, that will dynamically populate the user ID. |
pod_id | This is the pod identifier generated from the pod name given when creating a recommendation pod. The ID dictates what strategy is used to recommend items. For example, if a pod has a Bestseller strategy, then the recommendation service will generate personalized bestsellers for the email recipient. |
key | This is the index key for a specific Constructor index (i.e. a production or specific language index often stylized as key_abCDefGHijkLM ) and is necessary to interact with Constructor API endpoints. |
campaign_id | The unique ID for the particular email campaign in Constructor. This is not the campaign ID in the ESP (unless you name the Constructor campaign the same as the ESP campaign). |
item_id (optional) | This represents the seed item. A seed item serves as the starting point for generating recommendations of additional items. It could be an item the user purchased, clicked, or added to their cart. This parameter is required for the following pod strategies: alternative items , complementary items , and bundles . |
num_results (optional) | The total number of recommended items shown in an email. The default is ten (10) with a max of 100. |
HTML snippet
An HTML snippet allows a company to render the image of a recommendation pod item in an email campaign and have that image link to the corresponding item description page (PDP) on the company’s website.
HTML snippets will call Constructor’s Offsite Discovery API and return results at open time, ensuring recipients receive the most up-to-date personalized recommendations.
You can paste an HTML snippet in one of two places:
- Drag-and-drop email builder: Many ESPs have a visual builder that allows merchants to drag and drop different modules, such as images, text boxes, and social links, to an email design. You can select the HTML module and paste the snippet code in the field provided.
- Email HTML editor: Some companies will design an email entirely in an HTML editor. If this is the case with your campaigns, you can paste the HTML snippet where it makes sense for the item to appear in the design.
Regardless of which option you choose, you will need to add an HTML snippet for each item you wish to have in the email. For example, if you want to display four (4) recommendations, then you will paste four HTML snippets, each with an updated position
value.
Example HTML snippet
The below snippet references a single recommended item within a recommendation set inside an email.

<a href="https://offsite-discovery.cnstrc.com/v1/product/url?position=1&ui=0&pod_id=pdp-alternative&key=key_abCDefGHijkLM&style_id=standard&campaign_id=campaign_1" target="_blank">
<img
src="<https://offsite-discovery.cnstrc.com/v1/product/image?position=1&ui=0&pod_id=pdp-alternative&key=key_abCDefGHijkLM&style_id=standard&campaign_id=campaign_1" width="200"> border="0" alt="Shop Now" />
</a>
A note on images
Images with restricted access will not appear in emails. Please ensure the item images are accessible.
Required and optional inputs
Each HTML snippet will contain the inputs listed below. This ensures personalized recommendations for each email recipient are returned. Companies can include optional inputs based on their strategy.
Input | Description |
---|---|
position | This refers to a recommended item’s placement within the suggested list. A position value of 3 indicates that the item will be the third item shown. |
ui | This represents the user’s identifier, which is crucial for personalizing recommendation results. This ID should be the exact same user ID provided for other API calls. |
pod_id | This is the pod identifier generated from the pod name given when creating a recommendation pod. The ID dictates what strategy is used to recommend items. For example, if a pod has a Bestseller strategy, then the recommendation service will generate personalized bestsellers for the email user. |
key | This is the index key for a specific Constructor index (i.e. a production of specific language index often stylized as key_abCDefGHijkLM ) and is necessary to interact with Constructor API endpoints. |
style_id | This ID specifies which style of item card to display. Styles will vary by company and requirements should be shared with the Constructor team to ensure correct appearance. For example, style1 shows the item sale price with the regular price struck through, while style2 shows the price and brand. These are two different options and will each have a unique style_id . |
campaign_id | The unique ID for the particular email campaign in Constructor. This is not the campaign ID in the ESP (unless you name the Constructor campaign the same as the ESP campaign). |
item_id | This represents the seed item. A seed item serves as the starting point for generating recommendations of additional items. It could be an item the user purchased, clicked, or added to their cart. This parameter is required for the following pod strategies: alternative items , complementary items , and bundles . |
num_results (optional) | The total number of recommended items shown in an email. The default is ten (10) with a max of 100. |
filter_name or filter_value (optional) | At this time, the API supports only one filter name and value. However, you can set multiple filters using rules. These rules will help you to shortlist the product types, boost or bury items, etc. |
Updated 3 days ago