SitecoreAI personalization and A/B/n testing
SitecoreAI page-level personalizations and A/B/n tests are typically created by marketers, and they run automatically in Content SDK and JSS apps, with no coding required.
Behind the scenes, the Personalize Middleware runs these personalizations, and the Cloud SDK enables the personalization process in the following ways:
-
The Cloud SDK stores the
sc_cid_personalizecookie in the web browser. This cookie is required for A/B/n tests to run. -
The Personalize Middleware runs the
personalizefunction of theservermodule of the Cloud SDKpersonalizepackage.When the function runs, the Cloud SDK sends a payload to Sitecore. The payload contains a list of page variant IDs and other personalization data. Then, if a matching page variant ID is found, it is returned in the response. The Personalize Middleware then uses that page variant ID to display the personalized page variant to the site visitor.
Although SitecoreAI personalizations automatically run with no coding required, you can manually configure them. For example, you can exclude routes from personalization or disable personalization altogether.
Certain SitecoreAI personalizations run at the edge.
Example payloads
Here's some Cloud SDK debug logs showing examples of the payload the Cloud SDK sends to Sitecore, together with the example response returned.
The following is a payload that contains a list of two page variant IDs. A matching page variant ID is found and returned in the response:
The following is a payload that contains one page variant ID. No matching page variant ID is found, so the "No matching variant" message is returned in the response: