0

I want to personalize sitefinity content blocks which are outside sitefinity environment i.e. They are embedded blocks(blocks which are powered by sitefinity using an API) in a website page (a page that is not a sitefinity page)

My use case of personalization is based on past browsing history of consumer.

1 Answers1

1

The best case scenario would be to use the Digital Experience Cloud(DEC) and personas to see if a user falls into a persona(configured to your specific rules). You can use the javascript SDK to log interactions (pageviews ...) the also use the SDK to check which persona they fall into then grab a different content block.

https://docs.sitefinity.com/dec/api-v2/for-developers-leverage-the-javascript-sdk-to-capture-client-side-behavior

Hopefully the two example methods will help you get going.

var sendLoginInteraction = function () {
    global.DecClient.writeInteraction({
        S: CurrentUser.Id,
        P: 'View',
        O: 'Page Name'
    });

    global.DecClient.writeSubjectMetadata(CurrentUser.Id, {
        Email: CurrentUser.Email
    });

    global.DecClient.flushData();
};

var checkIfUserIsInPersona = function () {
    var personaIds = [ManagerPersonaId];
    global.DecClient.isInPersonas(personaIds, CurrentUser.Id).then(function (data) {
        var personas = data.toJSON().items;
        if (personas.length) {
            personas.forEach(function (persona) {
                if (persona.Id === ManagerPersonaId) {
                    isInManagerPersona = true;
                    personalizationReportSegment = 'IT Manager';
                }
            }, this);
        }
    });
Jon R.
  • 977
  • 6
  • 12