Seamlessly Update Sitecore CDP Guest Profile Extended Properties via Sitecore Connect by Triggering Personalize Experiences with Custom Events


In today’s data-driven world, real-time updates to your guest profiles are essential for creating personalized experiences. This blog will walk you through how to update the Sitecore CDP Guest Profile Extended Properties using Sitecore Connect, all triggered by custom events in Sitecore Personalize. By the end of this guide, you'll have a seamless flow that automatically updates guest data every time a user interacts with a form on your site.


Objective:

The goal is to set up an automated system where, upon a custom event trigger, Sitecore Connect updates specific properties of the Sitecore CDP Guest Profile Extended Model. This ensures that the guest profile is dynamically updated based on real-time interactions. This approach minimizes the code required in your Next.js application while giving you greater control over the CDP (Customer Data Platform) side. By centralizing the logic in Sitecore Connect, you can easily manage updates to the Guest Profile Extended Model based on custom events. Additionally, should you need to halt the flow, you can simply disable the event trigger in Sitecore Connect, ensuring no downtime or disruption to the user experience. Here’s the flow:





  1. User submits a form on your website.

  2. The form submission triggers a custom event in Sitecore Personalize.

  3. Sitecore Personalize then triggers a triggered experience.

  4. Sitecore Connect(Recipe) receives the payload   triggered by the Sitecore Personalize event and updates the Guest Profile Extended Model in Sitecore CDP through the  Recipe work flow

This process ensures that user interactions, like form submissions, automatically update relevant guest profile information in real-time within Sitecore CDP.

For more details on how to trigger a triggered experience using a custom event, refer to my earlier blog:

Triggered Experiences Using Custom Events


1. Sitecore Personalization Configuration Changes

Step 1: Create a Triggered Experience

Start by creating a triggered experience in Sitecore Personalize and link it to a custom event.

  • Triggered Experience Name: Name the experience something meaningful. In this case, we’ll call it “Sitecore Connect”.





Here’s how to configure the Webhook Composer section:

a. Webhook Composer Configuration






  • CDP to Connect: This is the connection set up to communicate with Sitecore Connect’s recipe (Connection Type - Destination).Refer my previous blog on how to create connection

                
  • Connect URL: This URL will be automatically generated when you create a webhook inside Sitecore Connect. You’ll need to copy this URL and use it in Sitecore Personalize while configuring the webhook.

  • API Body: The body of the API request. For this example, we’ll pass the Guest ID and Guest Created Date, which will be used to identify and update the guest profile.





b. Custom Event Configuration

  • Custom Event: Set up the custom event that will trigger the experience. For our demo, we’ll use the event PERSONAL_DETAILS_FORM_SUBMITTED. This event will be triggered when a user submits a form on your website.





Once all the above  set up is done, make sure to pause the triggered experience until Sitecore Connect is configured.


2. Sitecore Connect Configuration

Next, let’s configure Sitecore Connect to process the data received from Sitecore Personalize.

Step 1: Create a Project in Sitecore Connect

Create a new project in Sitecore Connect:

  • Project Name: For our demo, we’ll name the project “CDPGuestUpdate”.





Step 2: Create a Recipe Inside the Project

Create a new recipe within this project. The recipe name should ideally match the project name, so we’ll call it “CDPGuestUpdate”.





Step 3: Configure the Recipe Workflow

The recipe workflow will define the logic for handling the payload and updating the guest profile. Here’s a breakdown of the steps in the recipe:






a. Webhook Trigger

This is where Sitecore Connect receives the API payload triggered by Sitecore Personalize.



  • Webhook Endpoint: Copy the Webhook URL provided by Sitecore Connect. This is the URL that will be used to receive the event from Sitecore Personalize.



  • Payload Schema: Define the structure of the payload. In this case, we’re receiving Guest ID and Guest Created Date from the triggered experience.







b. API  Trigger

Once Sitecore Connect receives the webhook data, the next step is to make an API call. This will  wait for the response from the API.











c. Sitecore CDP Trigger Step

In the final step of the recipe, Sitecore Connect updates the Sitecore CDP Guest Profile Extended Model with the API response. This is a partial update, meaning only the fields specified in the response will be updated.

  • Guest ID: The Guest ID from the webhook is used to identify the guest profile to update.

  • Guest Extension JSON Payload: This is where the API response data is passed, containing the fields which need to be updated in Sitecore CDP  guest profile property.The Guest property which will be updated is "Risk Decisionconnect"






Verification Steps

Once everything is configured, it’s time to test and verify the setup.

  1. Start the Recipe and Triggered Experience: Activate the recipe in Sitecore Connect and the triggered experience in Sitecore Personalize.

  2. Submit the Form: Test the form submission on your website. This should trigger the custom event in Sitecore Personalize.

  3. Verify in Sitecore CDP: Check Sitecore CDP to confirm that the triggered experience was called successfully. You can do this by reviewing the logs or the event details.



  1. Check Recipe Logs: Go to Sitecore Connect and verify that the event appears in the recipe’s workflow logs.



  1. Check Guest Profile: Finally, search for the Guest ID in Sitecore CDP and inspect the guest profile. The updated fields should reflect the changes made by the API response.Please check the property "Risk Decisionconnect"

    





Conclusion

With the steps outlined above, you can seamlessly integrate Sitecore Personalize with Sitecore Connect to update the Sitecore CDP Guest Profile Extended Model based on real-time user interactions. This automated flow ensures your guest profiles are always up-to-date, delivering a more personalized experience for your users.



Comments

Popular posts from this blog

Solrcloud With Zookeeper -Single server setup

Render Sitecore Experience Forms Using Sitecore XP 10.4 with a Headless Approach (Next.js + JSS SDK)

Next.js with XM Cloud EDGE and GraphQL