Multiple Server-Side Campaign Responses in a Single Call
It is possible to include multiple campaign responses in a single call. The Event API returns campaign responses for all server-side campaigns that meet the campaign targeting criteria. For example, if you have three personalizations on a single page, you can return multiple campaign responses at once as long as you ensure the following.
- All three campaigns are published
- A user qualifies for all three campaigns
On meeting the preceding criteria, the Event API returns three campaign responses in a single call. The client is responsible for parsing the campaign response data and determining which campaign response to display and where to display it on the page or end system.
As the number of campaigns a client is running increases, it is essential to understand that the number of campaigns returned in a single response can impact latency. Factors that can affect latency include:
- The number of campaigns being returned in a single call
- The amount of data being returned by each campaign
- The complexity of the queries leveraged within each campaign (Einstein Recipes, Einstein Decisions, and so on)
Consider the following best practices when returning multiple campaigns in a single request.
- Limit the campaigns to be returned to what can be visibly rendered to the end user
- Load campaigns that are below the fold in subsequent calls as they come into view
Additionally, to ensure that you are only ever returning the necessary campaigns for a response, we strongly recommend validating that your campaigns use appropriate targeting logic (like page targeting). Without proper targeting logic, you risk unnecessarily returning more campaigns than required and ultimately negatively impacting overall performance.