Information for: DEVELOPERS   PARTNERS

Personalization methods

Method Description
customize Triggers a Decision API call to retrieve decisions, and then broadcast the customized section of the response data to the webpage. The function can take a configuration object as an optional argument. The JavaScript event acquiaLiftContentCustomizable broadcasts all result decisions of customized slots. See JavaScript API event notifications.
personalize Triggers a Decision API call to run personalization for the webpage or for a list of slots on the webpage. Contained in the window.AcquiaLiftPublicApi namespace. The function can take a configuration object as an optional argument. When not specified, the decisions return for all slots on the current URL.

Personalization examples

You can use personalization code for an entire page, or for specific parts of a page, as shown in the following examples:

Personalizing an entire page

Use the following code to personalize an entire page:

window.AcquiaLiftPublicApi.personalize();

Personalizing one or more slots

To personalize a specific slot or an array of slots, use the following:

window.AcquiaLiftPublicApi.personalize({slots: ['744bffce-66b3-4f4a-8ea9-b481a556c3f8']});

In the previous example, 744bffce-66b3-4f4a-8ea9-b481a556c3f8 is an example slot ID you want to use. The slot ID is an auto-generated UUID (Universally Unique Identifier).

Personalizing from another URL

To retrieve the decisions of the slots from another URL, and then apply the personalization on the current webpage, use code like the following:

window.AcquiaLiftPublicApi.personalize({url: 'http://mysite.com/another-page'});

Personalizing based on a segment

To personalize based on a single segment:

window.AcquiaLiftPublicApi.personalize({segments: ['<segment id>']});

Or on multiple segments:

window.AcquiaLiftPublicApi.personalize({segments: ['<segment id>','<segment id2>']});