Experience APIs are a set of endpoints that you can call from your site's code. Our APIs enable the same personalization and data collection capabilities that our website script provides, but they need to be called from your codebase so that Dynamic Yield knows to return the relevant data. When you receive the data, it's up to you to do something with it in your site's code.
Experience APIs offer multiple benefits. They:
- Provide a flawless experience on the website, without flickering.
- Give users the same digital experience over different channels.
- Don’t expose your campaigns to the browser, avoiding exposure of internal strategies.
- Help protect user privacy and comply with regulations.
By definition, working with APIs requires developer resources and know-how. Consult with your dev team and Dynamic Yield account manager to make the best decisions that serve both your technical and business needs. All the technical information is available in our Developer Guides.
Prerequisites
The main things you need to make sure of to start your API personalization journey are:
- You have developer resources to work with.
- You're in an area served by one of our data centers.
- If you work with a CDN, make sure you can deliver dynamic content (vs. fully cached, static pages).
The Experience APIs
The Dynamic Yield Experience API family includes the following APIs.
Choosing Variations
Choosing Variations, or the Choose endpoint, is your primary endpoint. Choose calls activate one or more Dynamic Yield campaigns by name. The activation resolves targeting rules and test group allocations automatically and returns the correct variation for the user. Typically, you would make this call as part of your larger page and content rendering pipeline. The campaign settings are all controlled in the Experience OS console.
On pages not running the Dynamic Yield script, the Choose API can also report pageviews.
Learn more about the Choose endpoint.
For technical details, see the API Reference.
Tracking Pageviews
Use this endpoint to report a pageview, without any connected campaign. Pageview is basically an alias for Choose, but without any campaign names. Note that if you aren't using the Dynamic Yield script, the pageviews are reported implicitly in the Choose call, whereas if you have the Dynamic Yield script on your site, they are not reported in the call because the script reports the pageviews.
Learn more about the Pageview endpoint.
For technical details, see the API Reference.
Tracking Engagement
After you receive the variations from the Choose call and render them (or perform any other relevant action), the next step is to get a report of the engagement with any rendered variation. Typically, you'll measure user clicks on the page, though you can also measure impressions. These metrics enable you to analyze the success of your campaigns and improve performance.
Learn more about Tracking Engagement.
For technical details, see the API Reference.
Reporting events
Reporting meaningful user events (such as Login, Add to Cart, Purchase, Video Play, and so on) is crucial for both segmentation and experimentation: You typically want to target users based on their past actions or set an event as a primary or secondary metric for your campaigns. For more information about built-in and custom events, see Events.
For technical details, see our Developer site article about tracking events and the API reference.
Using both script-based personalization and Experience APIs
Whether you are new to Dynamic Yield or you are already using our script on your site, you can get the best of both worlds by combining API campaigns and those you create in the Experience OS console. For example, if you're used to client-side testing and personalization tools and you want to minimize time to value while keeping your future options open, you can get started quickly with the website script, and then gradually implement API-based campaigns. Use cases for which API campaigns are especially recommended include:
- You want to run performance-sensitive campaigns (for example, content above the fold).
- You have campaigns with sensitive data that you do not want to be exposed in the browser.
- You plan to run a large number of tests concurrently.
Learn more about Using Experience APIs and Dynamic Yield Script Together for Web Personalization.
Implementing campaigns
Experience APIs enable you to serve content on both web and mobile apps from the same site and create a unified user profile across devices by implementing identification events with matching values. You can create the following Experience API campaign types in Experience OS:
- Recommendation campaigns: Automatically display the most relevant items to each user.
For Web Personalization | For App Personalization -
Custom campaigns: Use the power of Dynamic Yield A/B testing and automatic allocation, while fully controlling how the campaigns are rendered on your site.
For Web Personalization | For App Personalization
Learn more about implementing Experience APIs for mobile apps.
After you create an API campaign, you can preview it in Experience OS: