Deliver Personalized Experiences

If you have not read my first two blogs on this series of combining two awesome platforms to deliver a personalized experiences, you should start there. Below are the links to the same. This post is the third step of the series that talks about how we can use Personalize to tie everything together.

How it all started!
CDP to capture events

Now, lets roll!

This is step is all about key functionality of Sitecore Personalize such as web experiments, variants, decisioning and data connections. Lets start getting in to each step here:

  • Create a web experiment – This is not mandatory, one can also choose experiences, but, we wanted to prove some theories on analytics front, so, we used this. You can read more on how to do this straight in Sitecore documentation.
  • Add POS filter based on what was sent to CDP. More info on sitecore documentation here as well.
  • Now, create a decisioning model that has a programmable to read what was sent on custom events from CDP. Have input as Guest and sessions both so we can read what we need on programmable. Also, connect to Data system, in our case it is chat gpt/open AI. I will talk about how to set that up in next post. Below is how the decisioning would look like. Learn how to set them up from Sitecore documentation.

Programmable is a javascript snippet here is used to construct prompt that will then be passed to Data system (Chat GPT) as completion call input. It extracts below information

  • Custom Event extension data that is added when end user clicks on Landing page link on their email
  • Current Session data extension that carries geo information on user such as city and country.

Code on programmable looks like below. No, it is not production quality code as I did this for hackathon. 🙂 Please make sure yours is though. LOL

function getLastButtonClickEventText() {
    var lastButtonClickedText  = '';
    
    for (var i = 0; i < guest.sessions.length; i++) {
        var currentSession = guest.sessions[i];
        
        if (currentSession.sessionType === 'WEB') {
            var events = currentSession.events;
             var geoCity = currentSession.dataExtensions[0].values.geoLocationCity;
             var geoCountry =  currentSession.dataExtensions[0].values.geoLocationCountry;
             
            for (var j = 0; j < events.length; j++) {
                var currentEvent = events[j];

                if (currentEvent.type === 'vodkabyte:CLICKED_HERO_CTA' && currentEvent.arbitraryData && currentEvent.arbitraryData.ext.PersonalizationPrompt) {
                    lastButtonClickedText = currentEvent.arbitraryData.ext.PersonalizationPrompt+" "+ geoCity +"," + geoCountry ;
                    break;
                }
            }
        }

        if (lastButtonClickedText) {
            break;
        }
    }

    return lastButtonClickedText;
}

(function () {
  // Add statements here
  
 var lastButtonClickEvent = getLastButtonClickEventText();

    return lastButtonClickEvent;
  
})();

Custom event information is available inside the events on the session and looks like below

Next step is to feed this programmable data in to data system. But, first, we have to learn how to set that up. I will talk about that in my next post. Hang tight!

Custom Events to CDP

This is part 2 of my series I promised on how to connect Sitecore with chat GPT. If you did not read my first post, please check it out here

Now, to make this happen first we need our events based on user interactions. This is the key to proceed with our next steps to achieve one to one personalization to the end user using chat gpt.

It required below steps in order. I tried to jot down everything I remember.

  • Create a POS (point of sale)
  • Integrate and start capturing events using Engage SDK script. This was very simple and super detailed on Sitecore documentation, so, check here
  • Verify basic page view events are now shown on CDP in guests section. This should be good if you did good with steps noted above.
  • Ensure custom events when sent should also be visible on user. In our case, we sent a special event that signifies the user clicked on a link from Email for instance. This event is basically our glue and also contains personalization prompt, brand names and anything else that is needed to tailor the experience. Below is a snippet of code that goes any where you would like it to send the event and load up extension data.
const handleClick = async () => {
      const eventData = { channel: "WEB", currency: "USD", pointOfSale: "brandname", language: "EN", page: "landing page"}; 
      const extensionData = {
        CTAText:"xyz",
        PersonalizationPrompt: "This would be used some where in personalization as prompt for Chat GPT"
      };
      await engage.event("brand:CLICKED_HERO_CTA", eventData, extensionData);
    }

Now that we have all the events and information on the events we need, next step is to either use web experiments or experiences in Sitecore Personalize. I will explain that on my next blog. We will also see where exactly chat gpt comes in to play in the flow.

Innovating with Chat GPT and Sitecore: A Modern Remix

I’ve had this on my mind since September, but it’s been a hectic period, and I couldn’t find the time to kickstart this series. If I hadn’t delved into connecting Chat GPT and Sitecore, I’d be experiencing major FOMO. Indeed, if you’re in the tech world and haven’t dabbled in the innovation of the decade, you’re missing out.

Verndale, the company I work for, organized an internal AI hackathon program that motivated me to sign up and work on something related to Sitecore.

So, the first step was brainstorming, as always. I had a team for this, but I had a soft spot for my favorite combo, Sitecore + Chat GPT. I started gathering ideas from existing resources. I came across some cool videos demonstrating the integration of Chat GPT with Content Hub, but it didn’t quite align with our project’s objectives. Our project was all about creating landing pages, and my part was to enhance these pages that were already rapidly generated. Then, a lightbulb moment occurred – how could I incorporate CDP/Personalization into these landing pages to attempt one-to-one personalization scenarios using Chat GPT? Bingo!

I believed the idea made a lot of sense and added value, so I delved deeper into the whole workflow. Here are my thoughts, a brain dump, if you will:

Imagine I know this user – perhaps they clicked on an email link. Remember, this is a hackathon, not a real project, so imagination is the key.

Now, I know this user, and since it’s CDP, I potentially know their location out of the box. Can I do something with that?

So, based on this context and location, can I create a one-to-one personalization variant using Chat GPT? I directly experimented with some examples on the completion endpoint using Postman, and the answer was a resounding YES. Chat GPT was able to provide the nearest dealerships based on the user’s brand affiliation. Bingo!

It’s as simple as that but scalable across various scenarios.

In my next post, I’ll discuss how I implemented all of this.