Showing posts with label Sitecore tutorial. Show all posts
Showing posts with label Sitecore tutorial. Show all posts

Monday, 27 October 2025

Exploring the Sitecore CDP Data Model: Guests, Sessions, Events, and Orders

October 27, 2025 0

Sitecore CDP offers a flexible and extensible data model that enables organizations to manage their data as per their needs. CDP captures, unifies, and activates customer data in real time across multiple channels. Its purpose is to build single and coherent customer profiles, which then allow for more targeted personalization. If an organization has custom data models that need to be managed in CDP, they can be easily handled using data extensions.



In the above image, a Guest, which is a customer/user, can have multiple orders as well as multiple sessions. An order can also have multiple order items, and similarly, a session can have multiple events.

Core Entities

Guests 

 A Guest profile is created in CDP whenever a guest interacts with the brand using any channel. A Guest is the central object in the data model that represents a single customer. A guest data extension in Sitecore CDP allows an organization to specify custom attributes with key-value pairs.

A Guest profile can have the below attributes:

  1. Name

  2. Guest Type (Known or Anonymous)

  3. Email

  4. Phone Number

  5. Identifiers – List of identifiers (e.g., email, loyalty ID, browser ID)

  6. Gender

  7. Custom attributes



Guest Type

There are 3 types of guests in CDP, as below:



Visitor – A visitor is a guest who has not provided enough identity information or has provided partial identity information but not enough to meet the organization’s identity rules. So anyone coming to the website as an anonymous user is considered a visitor in CDP.

Customer – A customer is a guest who has provided enough identity information according to your organization's identity rules. In CDP, you can create identification rules like customer ID, email, or phone number, but the only condition is that it should be unique. That means when a guest comes to the site and provides the information you have set up for CDP identification rules (for example, email or customer ID), that visitor becomes a customer.

Retired – A retired guest profile is archived because it contained data that was migrated to another guest profile. You cannot access a retired guest profile.

Sessions

A session represents a user’s interaction data — a group of events over a period of time. The Timeline tab in a Guest Profile offers a detailed vertical timeline featuring the guest's last 100 sessions of interactions with your organization. You can scroll through this timeline to follow each guest's chronological engagement history.


Below are some basic interactions in CDP:

  • Open Session – If a user is visiting the site and, at the same time, we check the interaction in the Timeline tab of the guest, we can find open sessions in the interaction.

  • Browsed Session – After visiting some pages, if the user leaves the site, the open session is converted into a browsed session.

  • Converted Session – When a user visits the page and purchases some product after adding them to the cart, that session becomes a converted session.

  • Abandoned Session – When a user visits some pages on the site and adds products to the cart but leaves the site without completing the purchase, that session becomes an abandoned session.

Events

An event captures interactions and behaviors like page views, button click events, API call events, purchase data, login data, etc.



Event Attributes:

  • Type: Type of event

  • Timestamp: When the event occurred

  • Channel: Source of event (e.g., web, mobile)

  • Properties: Event-specific details (e.g., page URL, revenue)

Order & Order Items

Sitecore CDP captures orders and purchase details using events. All the information related to order transactions, individual order items, payment history, and guest association is represented using events.

Conclusion 

Understanding Sitecore CDP data model is important to manage the customer data effectively. In my next blog, I'll discuss about Identity Resolution.

References

Wednesday, 17 September 2025

Getting Started with Sitecore Content SDK for XM Cloud

September 17, 2025 0

 


Sitecore has announced the release of the Content SDK. The Content SDK helps developers integrate XM Cloud content with their front-end applications. It is set to replace the existing JSS SDK for XM Cloud. This new Content SDK will exclusively support XM Cloud, providing a cleaner and more streamlined solution.

In this blog, I’ll discuss the key features of the Content SDK, how to install it locally, and how to connect it with an XM Cloud instance for local development.


Key Features

  • Starter Template: Provides a ready-to-use Next.js template for fast project setup and seamless integration.

  • Framework-Specific Support: Leverages Next.js features like locale-based routing for multilingual sites, plus multiple rendering modes including SSR (server-side rendering) and SSG (static site generation).

  • GraphQL Utilities: Includes prebuilt queries to fetch content, layouts, site information, and dictionary data directly from Sitecore APIs.

  • Multi-Site Capabilities: Supports running and managing multiple independent websites from a single environment.

  • Personalization & Testing: Enables audience-based personalization and A/B/n component testing without custom code, making it simple to deliver tailored experiences and run experiments across visitor segments.

  • Analytics Integration: Offers built-in analytics and event tracking through the Sitecore Cloud SDK.

  • XM Cloud Pages Integration: Works seamlessly with XM Cloud Pages for visual authoring, component editing, and experience testing.

Prerequisites

  • Access to an XM Cloud instance.

  • Ensure you have the latest version of Node.js installed on your machine. It’s recommended to use the latest Long-Term Support (LTS) version.

  • A suitable IDE, such as Visual Studio Code.

Getting Started with Content SDK Installation

  1. Create a folder where you want to install the Content SDK.

    • For example: create a folder named Content SDK POC.

    • Open your terminal and execute the following command:
      npx @sitecore-content-sdk/create-sitecore-jss nextjs


  2. If prompted to install the create-sitecore-jss package, type Y to confirm.


  3. When asked, provide the folder path for your new app. You’ll also be asked to choose a rendering strategy between SSG (Static Site Generation) and SSR (Server-Side Rendering).


  4. Installed Successfully. 


Install Content SDK CLI

The Content SDK CLI provides various commands to work with Content SDK applications. By installing this tool globally, you can use these commands while developing any Content SDK applications on your local machine, such as when creating new components.

To install, run:

npm install -g @sitecore-content-sdk/cli



Once installed, the following folder structure will be generated on your file system.



Connecting to an XM Cloud Instance

To connect the app to the XM Cloud instance:

  1. Retrieve the required environment variables from the deployment portal.

  2. Create a .env.local file in the root folder of your newly created app.

  3. Add the environment variables into the .env.local file.


After setting up the environment variables, open a terminal, navigate to the Content SDK app’s folder, and run the following commands:

npm install

npm run start

Conclusion

The Sitecore Content SDK for XM Cloud offers a streamlined way to bring XM Cloud content into modern front-end applications. With its Next.js starter template, GraphQL utilities, CLI support, and seamless integration with XM Cloud Pages, it empowers developers to deliver scalable, personalized, and high-performing digital experiences. Whether using static generation or server-side rendering, the Content SDK provides a strong foundation to accelerate your headless Sitecore development journey.

References