A React Sitecore Personalize NPM module

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.


npm install react-sitecore-personalize


yarn add react-sitecore-personalize

Continue reading

Utilizing the Sitecore CDP Blueprints Library

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

These snippets can be used to create web templates for your marketing team in their Web Experiences. Simply copy and paste the provided HTML, CSS, and JavaScript into the corresponding tabs when creating a new template.

The library contains the following examples:

Advanced Page Targeting Snippets

The following scripts can be used with your web experiences by copying the snippet into the Advanced Page Targeting block to ensure the web experience is only executed when the specific event occurs:

  • OnClick – Triggers the experience when user clicks the specified HTML element.
  • OnDelay – Triggers the experience after a delay.
  • 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.

Sitecore Personalize decision models enable users to model and run decisions using business rules. You can create reusable programmable decision templates using JavaScript for use within your models. The following are examples of programmable functions you might use as a decision template:

  • 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

Sitecore CDP allows you to target an audience in a triggered experiment and there are a few different ways you can achieve this. If you want to target a real-time audience you can apply JavaScript either via a reusable Audience template or direct JavaScript that can be added to the Experiment. The following JavaScript snippets are included in the library:


Thanks to the team at Sitecore for pulling this awesome collection of snippets together. They provide lots of insight and certainly help stir some creativity.

Have Fun!

Generating Leads with Sitecore Personalize and Sitecore Send (Moosend)

Lead generation is such an important marketing practice for every business or brand and it comes in many different forms. Take the simple subscribe to receive discount offers email, almost every e-commerce site I’ve landed on recently has displayed one of these pop-ups. Sitecore Personalize makes it possible for your marketing team to easily add these lead generation experiences. While Sitecore Send (Moosend) allows marketing to stimulate and nurture visitor engagement through targeted and relevant communications. With the ultimate goal of converting visitors into lifelong consumers.

In a previous post, I showed how to easily integrate Sitecore CDP/Personalize with your existing site using GTM. In this post, I’ll show you how to capture the visitor’s name and email address using a Sitecore Personalize web experience, once a guest submits their information we’ll add them to a mailing list configured in Sitecore Send (Moosend).

To achieve this we will complete the following:

  1. Create a offers mailing list in Sitecore Send (Moosend) for customers so they can subscribe to receive offer emails.
  2. Take a look at the Sitecore Send REST API we will use to add a user to the mailing list.
  3. Create Data Connection in Sitecore Personalize for the API method.
  4. Create a Web Experience prompting user to enter name and email to subscriber to the email campaign that only displays when user has not previously subscribed.
  5. Create a Triggered Experience that will send user data to Sitecore Send using a data Connection to subscribe the user to the mailing list when the user submits the subscription pop up.
  6. Start the Experiences and Test.

At first glance, this might seem like a lot of steps to go through but it’s relatively straightforward to accomplish with Sitecore Personalize and Sitecore Send. Once you understand the various components involved, which I’ll guide you through, your marketing team will be able to re-use for similar scenarios.

Lots of good stuff!

Continue reading

Creating a Postman Collection for Sitecore Send (Moosend)

When working with various REST APIs it’s nice to be able to manage your sample and test requests in a single location. In a previous post, I introduced the Sitecore CDP REST APIs and shared my Postman collection. In this post, I will show you how to create a collection for Sitecore Send (Moosend). The good news Moosend provides an API Blueprint specification available here. However, you are not able to import this document directly into Postman. In this post, I will show you how you can convert this Blueprint spec so it can be imported into postman and automatically generate a collection of requests for testing and development with Moosend.

Continue reading