Using both the Dynamic Yield script on your website and our Experience APIs can provide you the control and fast time-to-value you need today while keeping your future options open. For example, you might already be using client-side testing and personalization tools that provide business value, but you might also want to gain the fast performance of APIs that aren’t affected by script loading time.
Use cases
This approach gives you the opportunity to gradually implement API-based campaigns. Here are some use cases especially suited for APIs, which we recommend starting with:
- Content above the fold: For page elements at the top of the page that are immediately visible when the page loads, you want to ensure minimal latency and no flicker. This is easier to achieve when calling our API from your server, as the personalized content is already included in your markup when serving the page back to the browser.
- Campaigns based on sensitive business information: For example, testing different pricing models. Traditionally, such tests are not done using client-side A/B testing at all, to avoid exposing this information in the browser. When running campaigns via API, only the chosen variation is sent to the client.
- Running a large number of tests: As your adoption of the platform grows, you might run dozens of campaigns concurrently, each with its own targeting rules and multiple variations. Because the details of API campaigns are not included in our client-side script (specifically, api_dynamic.js, which holds this data), the script can remain light and loads faster.
To learn how, see Using Experience APIs with Site Personalization.
Limitations
Note some limitations of the using script and server-side APIs together:
- The full performance benefits of the API are not achieved during the time the Dynamic Yield scripts are still loading in the heads of all pages.
- Because the management of user and session IDs relies on cookies in this mode, it is not suitable for non-web environments: Mobile apps, retail locations, and so on. See Experience APIs in Mobile Apps to learn more about getting all the advantages of Experience APIs on mobile apps.
- One potential caveat when considering this approach: If your servers are in the EU but your account in Dynamic Yield uses our US-based data center rather than our EU server, API calls you make from your servers will incur the network latency of going over the ocean.
This may or may not be an issue for you depending on the use cases in your roadmap and the actual network latency you experience from your servers.