The React Sitecore Personalize npm module is a wrapper for Sitecore CDP/Personalize Direct Client Script allowing you to easily add the script to react-based apps. The goal of this project is to make it even easier for those developers who might be new to React or Next.js and are learning how to integrate Sitecore Personalize by providing a simple wrapper for the direct client script. Allowing you to easily add the script to your projects and send events to Sitecore Personalize to track user behavior with just a few lines of code. The project is available on GitHub so please use it to help you get up-to-speed quickly, and contribute to the project if you have any suggestions for improvement.
The Sitecore CDP Blueprints library created by the Sitecore team contains useful configurations and snippets. You can either use as a reference to help understand key concepts or adapt and use in your own implementations. Which can help you get up and running quicker with Sitecore CDP.
Web Experience Snippets
OnExit – Triggers the experience when user moves their mouse out of the browser window.
OnHover – Triggers the experience when user moves their mouse over the specified HTML element.
OnScroll – Triggers the experience when the user has scrolled a certain percentage of the page.
SpaTargeting – This function can be used in Advanced Page Targeting to allow an experience to trigger on every virtual page load, rather than only on full page loads. It can be used along with other page targeting functions to trigger experiences after a delay or on hover over an element etc.
Decision Model Snippets
Most Viewed Page Decision Model – This decision model will get the most viewed page from your customer’s sessions and return relevant content for you to display.
getNumberOfEvents – This function will return the number of events of the specified type in the provided session.
getTriggerEvent – This function will return the order that triggered the execution of the experience. This is for use in triggered experiences where the trigger is Custom Trigger.
getTriggerOrder – This function will return the order that triggered the execution of the experience. This is for use in triggered experiences where the trigger is Order Created or Order Updated.
getTriggerSession – This function will return the session that triggered the execution of the experience. This is for use in triggered experiences where the trigger is Session Closed or Abandoned Cart.
Audience Filter Snippets
In this post, I will introduce the Sitecore CDP REST APIs and the postman collection I created for working with the APIs. I’m a huge fan of postman it’s an essential developer tool when it comes to working with a REST API.
Sitecore CDP does not currently provide a standard document like OpenAPI (swagger) for describing the APIs, which can be used to generate a postman collection. Therefore I’ve started a collection based on the Sitecore documentation and examples they’ve provided. The Sitecore docs are an excellent resource for developers, to help you understand the various APIs and attributes. I highly recommend checking these out as they are constantly evolving since the acquisition of Boxever.
My postman collection is available on GitHub as a json file. You can import it into Postman and use it when working with your own Sitecore CDP sandbox. I hope you find it useful, please share any feedback.
In a previous post, I’ve introduced Sitecore CDP with some tips and tricks to help you get started with this awesome platform. While there are a few different ways you can integrate Sitecore CDP with your site:
Direct client-side integration
Client-side integration via GTM (Google Tag Manager)
I thought it would be helpful to demonstrate how to add CDP to the Next.js Commerce App via GTM. One of the benefits of this approach is it allows marketers to manage and deploy the CDP script to their site without having to modify the code. As the majority of sites already have GTM set up it should be relatively easy to add Sitecore CDP without getting the dev team involved. “Yey! we can do this ourselves, we don’t need any developers!” I hear you marketers holler!!
Now I’m not advocating you start adding scripts to your live site via GTM, as it does require some technical resources. Most marketing teams have analytic pros who understand the impact and risk of adding scripts and perform rigorous testing before publishing anything on a live site, to ensure there is no detrimental impact on performance or worse bring the entire site down. With great power comes great responsibility.
Having recently completed the Sitecore CDP Developer Deep Dive training I discovered a few tips and tricks and wanted to share some learnings as you start to explore the platform for yourself. I hope you find this useful and maybe even save you some time.
Sitecore CDP actually consists of two products: Sitecore CDP & Sitecore Personalize. Depending on the client’s requirements they can opt to have either product or both. This will determine which features your client will have access to within the CDP platform.
Sitecore CDP & Sitecore Personalize combined
Having taken the free online Boxever training offered by Sitecore I was expecting the UI to be similar. However, it has since been rebranded and is now more Sitecore-esque.
As you can see from above the interval is simple yet intuitive with the various features easily accessible from the main navigation pane on the left. Here is a quick overview of those features accessible from the navigation pane:
Customer Data Tab
Guests – provides access to a list of guests including current online guests, with the most recent appearing first. The list is searchable to help you locate guests easily and view their profile. Note to search by the unique browser if assoicated with a visit you need to enter bid: Enter the browser id retrived from your browser assigned by CDP.
Connections – allow you to create and manage connections to third party systems. These can be used for sending email or ingesting data.
NOTE: Experiences vs Experiments – there were a few occasions during the training when these two were mixed up. Experiments is A/B testing while Experiences allow you to design and implement user interactions and capture user data.