JavaScript API Integration Guide
JavaScript API
The JavaScript API consists of two independent components JSON tracking To get the best recommendations from the algorithms, track all pages relevant to a customer’s purchasing experience on your site. JSON tracking lets clients provide user journey and user details to Optimizely.
PeeriusCallbacks variable
The PeeriusCallbacks JavaScript variable must be present before the Optimizely Recommendations script (detailed in JSON tracking https //docs. developers.
JSON tracking
Optimizely Recommendations models the user journey as several pages (product, category, basket, and so on). The JSON data should include all relevant information, so that Optimizely's algorithms can infer user preference.
JSON tracking requests
Elements are mandatory unless they are labeled as optional, and the data type for each value is assumed to be string unless otherwise noted. Indentation and extra whitespace in the JSON response examples are added for readability of the JSON data; spaces are not required in the actual JSON responses.
JSON recommendations
Recommendations callback https //docs. developers.
A/B testing
To run A/B tests that compare your existing recommendations with supplied recommendations, you can request additional A/B test information that will be supplied in the info callback. You should always include this to ensure that you know which group a user is in when in A/B testing.
JSON integration for Promote (legacy)
Promote content (legacy) is provided by Optimizely in the form of a JavaScript callback method. When the content is ready, it is passed to this callback function in the form of JSON data.
Migrate JavaScript API 1.3 to 1.4
JavaScript API version 1. 4 replaces email address with a pseudonymized user ID in the tracking request.