[Premium]{class="badge positive" title="See what's included in Target Premium."}
Integrate Recommendations with email integrate-recs-email
On this page: Learn about the methods to integrate Target Recommendations with an Email Service Provider (ESP) for send-time personalization of recommendations in email.
Adobe Target supports send-time personalization of recommendations in email. Open-time personalization of recommendations is not supported.
Three methods are available to integrate Target Recommendations with an ESP. The capabilities of the ESP determine which method to use, and the account manager or consultant can help choose the best option.
Methods 1 and 2 require the ESP to make calls to an external API on a per-customer, per-email basis, and to wait for the content to be returned. Not all ESPs support these methods, so the ESP must be contacted to determine whether it is compatible with this integration pattern.
Method 3 requires the ESP to join a list of recommendations by product ID or category ID to the list of emails. This join can be based on an attribute such as the last viewed product, the last purchased product, or the most viewed category of the customer. The ESP must have access to this data in its customer profile to perform the join, so the ESP must be contacted to determine whether it has access to this data and is compatible with this integration pattern.
- Requests should be rate-limited to the lower of 1,000 requests per second or 25 times the peak daily traffic.
- Traffic should be ramped in steps of 200 requests per second each minute.
Method 1: Use the Delivery API (Preferred) delivery-api
The Delivery API is a POST request that works with build-time email. This option is the preferred method for build-time email.
Most email clients do not allow POST requests, so this API is not recommended for open-time use cases. Some email clients, such as Gmail or Outlook, can cache the content or block the image, and require the recipient to proactively allow the image to render.
Default content cannot be returned with the Delivery API.
The following code is a sample API delivery request, where clientcode is the Target client code:
curl -X POST \
'https://clientcode.tt.omtrdc.net/rest/v1/mbox/?client=clientcode' \
-H 'authorization: Bearer 3423614b-4843-4664-83c4-c6c3f6c8869b' \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-d '{
"mbox" : "email-mbox",
"tntId" : "111499796294071-449025.28_44",
"requestLocation" : {
"host" : "prod"
},
"profileParameters" : {
},
"mboxParameters" : {
"at_property": "b468a242-64a4-32a0-ca0c-890bddd78789",
"entity.id": "article-123",
"entity.event.detailsOnly" : "true"
}
"contentAsJson": true
}'
sessionId and one of tntId or thirdPartyId for each email recipient (for each API call). Without unique values for these fields, the API response can slow or fail because of the many events generated within a single profile.For more information, see the Delivery API documentation.
Method 2: Use a rawbox email template rawbox
A rawbox is similar to an mbox request, but for non-web environments, such as email service providers (ESPs). The Adobe Experience Platform Web SDK and at.js are not available for rawbox requests, so the requests must be created manually. The following examples explain how to work with rawbox requests in email.
This approach allows tracking the performance of recommendations in emails, testing them in the normal way with a recommendation, and continuing the tracking on the site.
-
Set up a Recommendations activity in Target, with the Form-Based Experience Composer option.
-
For the location, select the name of the mbox that is used in the rawbox request coming from the ESP.
-
Select a design with the look and feel wanted for the email.
At email build time, the ESP makes a call to the Target servers for each rawbox in each email being generated. The ESP must have a way to include the returned HTML in the email when it is sent.
The email system must be able to handle the following scenarios.
A valid response is received, but no recommendations are present
- The response is the value set in the
mboxDefaultparameter. See the description of this parameter in the table of required parameters. - The email provider should have a default HTML block of recommendations to use in this case.
The Target server times out and returns without data
-
The Target server returns the following content:
//ERROR: application server timeout -
The email application should search for that text and must be able to handle the error. The email provider has multiple options for handling this case:
- Try another server call immediately (recommended, perhaps with an attempt counter).
- Discard that particular email and continue to the next one.
- Queue that particular email and rerun the failed emails as a batch at the end of the initial run.
Sample request URL
https://client_code.tt.omtrdc.net/m2/client_code/ubox/raw?mbox=mbox_name&mboxSession=1396032094853-955654&mboxPC=1396032094853-955654&mboxXDomain=disabled&entity.event.detailsOnly=true&mboxDefault=nocontent&mboxNoRedirect=1&entity.id=2A229&entity.categoryId=5674
Required parameters reqparams
entity.id or the entity.categoryId, or both, depending on the type of recommendation criteria. The sample call above includes both.client_codembox250 character limit.
Cannot contain any of the following characters:
', ", %22, %27, <, >, %3C, %3EmboxXDomainentity.id(Required for certain types of criteria: view/view, view/bought, bought/bought)
If required by the criteria, the rawbox call must include the
entity.id.entity.event.detailsOnlyentity.id is passed, passing this parameter is highly recommended, to prevent the request from incrementing the number of tallied page views for an item, so as not to skew product view-based algorithms.entity.categoryId(Required for certain types of criteria: most viewed by category and top sellers by category)
If required by the criteria, the rawbox call must include the
entity.categoryId.mboxDefaulthttps://www.default.commboxNoRedirect parameter is not present, mboxDefault should be an absolute URL that returns default content if no recommendation is available. This URL can be an image or other static content.If the
mboxNoRedirect parameter is present, mboxDefault can be any text that indicates there are no recommendations, for example no_content.The email provider must handle the case where this value is returned, and insert default HTML into the email.
See the security best practice below the tables.
mboxHostmboxPCIf no “thirdPartyId” was provided, a new tntId is generated and returned as part of the response. Otherwise, the value remains empty.
See the note on unique values below the tables.
Cannot contain more than a single “.” (dot).
The only dot allowed is for the profile location suffix.
Optional parameters
mboxPC(Optional)
This value must be the actual Adobe Target PCID of the user, which is exported from the website to the CRM. The email provider retrieves this ID from the CRM or data warehouse, and uses it as the value of this parameter.
The
mboxPC value is also useful for tracking visitor site behavior across multiple visits for metrics tracking, when a recommendation is part of an A/B activity.See the note on unique values below the tables.
Cannot contain more than a single “.” (dot).
The only dot allowed is for the profile location suffix.
mboxNoRedirect(Optional)
mbox3rdPartyIdFor mboxSession and mboxPC, provide a unique value for each email recipient (for each API call). Without unique values for these fields, the API response can slow or fail because of the large number of events generated within a single profile.
As a security best practice for mboxDefault, use authorized hosts to allowlist the default redirect URL domains. If the domain used in the mboxDefault URL is not allowlisted, a risk of an Open Redirect Vulnerability can be exposed. Authorized hosts avoid the unauthorized use of Redirector links or mboxDefault by third parties. Target uses hosts to allowlist the domains to which redirects are allowed. For more information, see the security notice at the beginning of this section.
Potential Target server responses
mboxNoRedirect parameter is set to ‘true’ and the server does not return any recommendations (there is no match for the mbox, or the server cache is not initialized).The mbox parameter is missing.
- Either
mboxDefaultor themboxNoRedirectparameter is not specified. - The
mboxTracerequest parameter is specified butmboxNoRedirectis not. - The
mboxTargetparameter is not specified when mbox names end with the-clickedsuffix.
Cannot redirect to default content, please specify mboxDefault parametermboxDefault is not specified when no match for the request exists and the mboxNoRedirect parameter is not specified.Invalid mbox name:= MBOX_NAMEmbox parameter contains invalid characters.Mbox name [MBOX_NAME] is too longmbox parameter is longer than 250 characters.Method 3: Use the Recommendations Download API download-api
Set up a recommendation as usual, but choose download only in the presentation section instead of a template and mbox combination. Then provide the ESP with the ID of the recommendation that was created. The ESP accesses the recommendation data through the API. This data shows which items should be recommended for a particular category or key item, such as items in an abandoned cart. The ESP stores this data, connects it with its own look and feel, displays information about each item, and delivers it in the emails.
With this option, the recommendations server cannot directly track the performance of a recommendation or split traffic across multiple algorithm and template combinations. Also, the recommendations are not tied to a visitor profile.
For more information about the download API, see Legacy APIs > Download.
This section contains structured knowledge intended to support interpretation, retrieval, and question answering related to this topic.
For complete understanding, this information should be combined with the documentation on this page. Neither source is intended to stand alone; the page describes the feature, while this section provides additional context that helps disambiguate terminology, intent, applicability, and constraints.
- TL;DR: This page describes the three methods to integrate Target Recommendations with an Email Service Provider (ESP) for send-time personalization of recommendations in email: the Adobe Target Delivery API, the Adobe Target Rawbox API (rawbox email template) and the Recommendations Download API.
Intents:
- Choose among the three methods to integrate Target Recommendations with an ESP.
- Use the Delivery API to make per-customer, per-email requests for recommendations at email build time.
- Use a rawbox email template, including its required and optional parameters.
- Handle the scenarios a rawbox email system must handle, such as a response with no recommendations or a Target server timeout.
- Use the Recommendations Download API to request bulk recommendations for a list of products or categories in CSV format.
Glossary:
- Rawbox (product-specific): similar to an mbox request, but for non-web environments, such as email service providers (ESPs).
Guardrails:
- Adobe Target supports send-time personalization of recommendations in email. Open-time personalization of recommendations is not supported.
- Capacity guidelines for the Delivery API and rawbox email template methods (methods 1 and 2): requests should be rate-limited to the lower of 1,000 requests per second or 25 times the peak daily traffic, and traffic should be ramped in steps of 200 requests per second each minute. To use higher rate limits, contact the account manager.
- Delivery API: default content cannot be returned with the Delivery API.
- Delivery API: provide a unique value for both
sessionIdand one oftntIdorthirdPartyIdfor each email recipient (for each API call). Without unique values for these fields, the API response can slow or fail because of the many events generated within a single profile. - Rawbox: the Adobe Experience Platform Web SDK and at.js are not available for rawbox requests, so the requests must be created manually.
- Rawbox: to use Recommendations in email, the rawbox call must usually include either
entity.idorentity.categoryId, or both, depending on the type of recommendation criteria.entity.idis required for the criteria view/view, view/bought and bought/bought.entity.categoryIdis required for the criteria most viewed by category and top sellers by category. - Rawbox: the
mboxparameter has a 250 character limit and cannot contain any of the following characters:', ", %22, %27, <, >, %3C, %3E. - Rawbox:
mboxXDomainis set to disabled to prevent the response from setting a cookie in non-web environments. - Rawbox:
mboxPCis required for recommendations that use a visitor’s profile. Its validation is 1 < Length < 128, and it cannot contain more than a single “.” (dot); the only dot allowed is for the profile location suffix. - Rawbox: for
mboxSessionandmboxPC, provide a unique value for each email recipient (for each API call). Without unique values for these fields, the API response can slow or fail because of the large number of events generated within a single profile. - Recommendations Download API: the recommendations server cannot directly track the performance of a recommendation or split traffic across multiple algorithm and template combinations. The recommendations are not tied to a visitor profile.
Prerequisites and permissions:
- Methods 1 and 2 require the ESP to make calls to an external API on a per-customer, per-email basis, and to wait for the content to be returned. Not all ESPs support these methods, so the ESP must be contacted to determine whether it is compatible with this integration pattern.
- Method 3 requires the ESP to join a list of recommendations by product ID or category ID to the list of emails. The ESP must have access to this data in its customer profile to perform the join, so the ESP must be contacted to determine whether it has access to this data and is compatible with this integration pattern.
Terminology:
- Acronym: ESP (Email Service Provider)
- Synonyms: “Delivery API” = “Adobe Target Delivery API”
FAQ:
- Which integration methods are available for Target Recommendations with an ESP? Three methods are available: Method 1, the Adobe Target Delivery API (Preferred); Method 2, the Adobe Target Rawbox API; and Method 3, the Recommendations Download API.
- Which method should be used? The capabilities of the ESP determine which method to use, and the account manager or consultant can help choose the best option.
- Is open-time personalization of recommendations supported? No. Adobe Target supports send-time personalization of recommendations in email.
- What is the Recommendations Download API used for? It is used to request bulk recommendations for a list of products or categories in CSV format.
- How is a recommendation set up for the Recommendations Download API? Set up a recommendation as usual, but choose download only in the presentation section instead of a template and mbox combination, then provide the ESP with the ID of the recommendation that was created.
Troubleshooting:
//ERROR: application server timeout(the Target server times out and returns without data): the email application should search for that text and must be able to handle the error. The email provider has multiple options: try another server call immediately (recommended, perhaps with an attempt counter); discard that particular email and continue to the next one; or queue that particular email and rerun the failed emails as a batch at the end of the initial run.- A valid response is received, but no recommendations are present: the response is the value set in the
mboxDefaultparameter. //ERROR:: generated by the load balancer when it cannot return content.bad request: listed conditions are that themboxparameter is missing; eithermboxDefaultor themboxNoRedirectparameter is not specified; themboxTracerequest parameter is specified butmboxNoRedirectis not; themboxTargetparameter is not specified when mbox names end with the-clickedsuffix.Cannot redirect to default content, please specify mboxDefault parameter:mboxDefaultis not specified when no match for the request exists and themboxNoRedirectparameter is not specified.Invalid mbox name:= MBOX_NAME: themboxparameter contains invalid characters.
Examples:
- Delivery API (Method 1): a sample API delivery request, a POST to
https://clientcode.tt.omtrdc.net/rest/v1/mbox/?client=clientcode, whereclientcodeis the Target client code. - Rawbox (Method 2): a sample request URL that includes both
entity.idandentity.categoryId:https://client_code.tt.omtrdc.net/m2/client_code/ubox/raw?mbox=mbox_name&mboxSession=1396032094853-955654&mboxPC=1396032094853-955654&mboxXDomain=disabled&entity.event.detailsOnly=true&mboxDefault=nocontent&mboxNoRedirect=1&entity.id=2A229&entity.categoryId=5674
Best practices:
- Delivery API (Method 1) is the preferred method for build-time email. It is not recommended for open-time use cases, because most email clients do not allow POST requests, and some email clients, such as Gmail or Outlook, can cache the content or block the image, and require the recipient to proactively allow the image to render.
- Rawbox: the email provider should have a default HTML block of recommendations to use when a valid response is received but no recommendations are present.
- Rawbox: if
entity.idis passed, passingentity.event.detailsOnlyset to true is highly recommended, to prevent the request from incrementing the number of tallied page views for an item, so as not to skew product view-based algorithms. - Rawbox: if the
mboxNoRedirectparameter is not present,mboxDefaultshould be an absolute URL that returns default content if no recommendation is available. IfmboxNoRedirectis present,mboxDefaultcan be any text that indicates there are no recommendations, for exampleno_content. - Rawbox: as a security best practice for
mboxDefault, use authorized hosts to allowlist the default redirect URL domains. If the domain used in themboxDefaultURL is not allowlisted, a risk of an Open Redirect Vulnerability can be exposed.
Related pages:
- Using a rawbox and Target, for the important security notice: Create allowlists that specify hosts that are authorized to send mbox calls to Target (administrating-target/hosts.md)
- Setting up a Recommendations activity in Target for a rawbox: Form-Based Experience Composer (c-experiences/form-experience-composer.md)
Personas:
- developer: Can build rawbox requests with the parameters mbox, mboxXDomain set to disabled, entity.id, entity.event.detailsOnly, entity.categoryId, mboxDefault, mboxHost and mboxPC. The page states that the mbox parameter has a 250 character limit and cannot contain ', ", %22, %27, <, >, %3C or %3E. Where: “Required parameters”.
Onboarding:
- Level: Experienced
- First minimal step: Set up a Recommendations activity in Target with the Form-Based Experience Composer option, when using a rawbox email template.