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:

Credit

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!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s