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

Tuesday, 21 April 2026

Sitecore AI + Netlify: A Real Issue with Geo Personalization

April 21, 2026 0

 


Problem Statement

We recently faced an issue while working on a Sitecore AI implementation hosted on Netlify.

Our setup was simple. We had deployed the frontend application on Netlify and enabled Sitecore AI embedded personalization. As part of the personalization strategy, we created different page variants based on the user’s country. The expectation was users from different countries should see personalized content to their location.

However, things did not work as expected.

No matter where the user was accessing the site from, the same version of the page was being shown. The personalization rules were not getting applied correctly. At first, it looked like a configuration issue in Sitecore AI, but after checking the rules and setup multiple times, everything seemed fine.


Root Cause Analysis

After digging deeper, we found the real problem.

Sitecore AI was not receiving the actual user’s country information. Instead, it was always picking up the country of the Netlify hosting server. In our case, the site was hosted in the UAE, so every request appeared as if it was coming from the UAE.

Because of this, even if a user accessed the site from Saudi Arabia (or any other country), Sitecore AI still treated them as a UAE user. As a result, the country-based personalization never triggered correctly.

In short, the personalization logic was working, but the input data (user location) was wrong. And because of that, the entire experience broke.


Solution

After understanding the problem, we focused on how Netlify was handling request headers.

We noticed that Netlify always sets the x-forwarded-for header using its edge network IP. Because of this, our logic was always picking that value and skipping any further checks. This caused a bigger issue — Sitecore was reading different edge node IPs on every request. As a result, the detected location kept changing, and users were getting different personalized variants on every page refresh.

To fix this, we changed our approach.

Instead of relying on x-forwarded-for, we decided to always use x-nf-client-connection-ip when it is available. This header gives the actual client IP. This small change ensured that the correct user location is passed every time.

Along with this, we added a middleware in our Next.js application.

We extended the existing PersonalizeMiddleware provided by Sitecore and It overrides one method — getExperienceParams — which is responsible for building the data object sent to Sitecore to decide which personalized variant to show.

class GeoPersonalizeMiddleware extends PersonalizeMiddleware {
  protected getExperienceParams(req: NextRequest) {
    const params = super.getExperienceParams(req);
    const country = req.headers.get('x-country');
    if (country) {
      return { ...params, geo: { country } };
    }
    return params;
  }
}

super.getExperienceParams(req) — first calls the original Sitecore method to get the default params (referrer, UTM, etc.)

req.headers.get('x-country') — reads a header called x-country which Netlify automatically injects on every request with the visitor's detected country code (e.g. "AE", "SA")

If the x-country header exists, it adds a geo: { country } field into the params before sending to Sitecore

This made a big difference. Now Sitecore gets the correct country information on the very first request itself. Because of this, the geo-based personalization rules start working immediately, even before any cookies or user profile data are created.

We also handled one more important case.

Netlify sometimes sends requests from its own prerender system. These are not real users, but background requests used for caching and performance. Netlify marks these requests using a header called netlify-agent-category.

function isNetlifyPrerender(req: NextRequest): boolean {
  const agentCategory = req.headers.get('netlify-agent-category') || '';
  return agentCategory.includes('tooling') || agentCategory.includes('prerender');
}

We added a simple check to detect such requests. If the request is coming from Netlify’s prerender system, we prevent caching for that response. This avoids serving incorrect or cached personalized content to real users.

if (isNetlifyPrerender(req)) {
    response.headers.set('x-middleware-cache', 'no-cache');
    response.headers.set('netlify-cdn-cache-control', 'no-store');
  }

x-middleware-cache: no-cache — tells Next.js middleware layer not to cache this response

In short, the fix had three key parts:

  1. Use the correct client IP instead of the edge IP
  2. Pass the user’s country explicitly to SitecoreAI
  3. Avoid caching issues caused by prerender requests

After applying these changes, the personalization started working correctly for users across different countries.


Monday, 17 November 2025

SitecoreAI Explained Simply: New Features, AI Agents, and What It Means for Marketers

November 17, 2025 0

 


At Sitecore Symposium 2025, Sitecore introduced the next version of its SaaS-based digital experience platform (DXP), called SitecoreAI. This new platform helps marketers plan, create, and improve campaigns faster with the help of AI. It brings AI-powered personalization, smart automation, and AI-assisted content creation across the whole customer journey.

Main Features of SitecoreAI


1. Strategy

This section includes tools for managing brand guidelines, creating briefs, handling campaigns, and later, a full marketing calendar.

2. Channels

This tab gives access to website and channel management, along with insights related to each channel.

3. Design

Here, users can manage normal website work like page setup, updating components, and maintaining forms.

4. Content

This is for managing content across all channels. It also includes media management (similar to DAM, but full Content Hub support is coming). Soon, it will also help handle embargoed or scheduled content releases—something many CMS tools struggle with.

5. Performance

This tab provides dashboards, insights, and reports to understand how your customer journey is performing.

6. Agentic

This is where Sitecore’s AI vision becomes real. Marketers can subscribe to, customize, or even build their own AI agents.


Agentic Studio: The Core of SitecoreAI

Agentic Studio is the main workspace where marketers work together with AI agents to build digital experiences. It comes with 20 pre-built AI agents, which help automate different tasks such as:

Campaign & Strategy Agents : Help create briefs, find the right audience, and optimize budgets.

Content Production Agents : Create brand-safe content, adapt it for different channels, and keep the messaging consistent.

Migration & Management Agents: These agents can help combine many old websites into one system, saving weeks or months of manual work.

Testing & Optimization Agents : Automate A/B testing, monitor results, and help improve performance.

Marketers can also build their own agents using simple no-code tools.

Key Capabilities of SitecoreAI

1. AI-Driven Content Creation

Helps teams create content faster—such as versions, summaries, metadata, translations, and creative assets.

2. Automated Personalization

AI studies user behavior and delivers the right content automatically, reducing manual work.

3. Better Search Results

With Sitecore Search, AI improves search ranking, understands user queries better, gives recommendations, and reduces zero-result pages.

4. Customer Insights & Predictions

With CDP and Personalize, SitecoreAI improves predictive models, journey insights, and user grouping.

5. AI Agents for Automation

These AI agents can help with:

  • Creating personalized experiences

  • Running optimization tests

  • Finding missing content

  • Suggesting new pages or components

  • Automating marketing workflows

Who Can Use SitecoreAI?

SitecoreAI is available now for:

  • New projects building an AI-first marketing setup

  • Existing XM Cloud customers (no major migration needed)

  • Large, multi-brand enterprises

  • Agencies and Sitecore partners

Why It Matters

For Developers

  • Better APIs and automation tools

  • AI-powered components

  • Faster delivery

  • Less manual personalization rules

For Marketers

  • Create content quickly

  • Launch experiences with AI-based suggestions

  • Personalize without deep technical knowledge

  • Act directly on insights instead of doing manual analysis

Conclusion

SitecoreAI is the start of a new chapter for Sitecore’s digital experience ecosystem.
It is still growing, but the goal is clear: to bring a strong AI layer that makes content creation easier, personalization smarter, and customer journeys more connected.


Tuesday, 30 April 2024

Sitecore Personalization – Profile Personas and Patterns Part Two

April 30, 2024 0

 



Content Profiling

We have setup Profile Personas, Profile and Pattern Cards in my previous blog.  Now, It’s time to assign these profile cards to Sitecore contents to identify customer’s behavior.
Now open the page in experience editor where you want to assign the profile.


Navigate to the Ribbon and select the Optimization tab. Then, click on "Associate Profile Cards" under profile settings.


This action will open the Profile Cards Dialog. Click on 'Edit' to proceed.



You have the option to either select a profile card from the dropdown menu or customize values for the content profile.



Enabling customization allows you to enter specific values for Profile Cards in the "Context" of the content item.



Repeat this process for all pages as needed to implement profiling according to your requirements.

Personalization using Pattern Card

If you're new to this process, I've documented detailed step-by-step instructions on how to personalizing components in my previous blog. 
Now, let's dive straight into the rules we're implementing for pattern-based personalization on the test page.


Next, click on the 'Specific' Profile and select a Profile from the Profiles dialog.



Then, choose the 'Specific' pattern from the Patterns dialog and select the correct pattern.



Click 'Ok'. Save and publish the items.

Now, open a new browser session and visit the page where you have assigned pattern card. Refresh the page multiple times to generate a profile score, aiding Sitecore in identifying the pattern. After visiting the page multiple times, navigate to the Experience profile and can observe the pattern value for recent contact you used.




Tuesday, 23 April 2024

Sitecore Personalization – Profile Personas and Patterns Part One

April 23, 2024 0

 


In my previous blog, I discussed on building and creating custom personalization rules to meet specific business requirements. In this part of personalization series, we will discuss more about personalization using Sitecore Profiles, Personas and Patterns.

In this article, we'll dive into the essential components of Sitecore profiling that allow you to comprehend visitor behavior and leverage this knowledge for personalized content delivery. Sitecore offers five fundamental profiling elements:

1. Profiles:

Profiles are pivotal for identifying visitor behavior and content interests. Sitecore provides pre-installed profiles and profile keys as a guideline, which can be customized to align with your business objectives.

Creating a Profile:

  • Access the Sitecore Launchpad and navigate to the Marketing Control Panel.



  • Right-click on Profiles, then select Insert > Profile.


  • Specify a name for your profile (e.g., "Product Interest").


2. Profile Keys:

Profile keys define different aspects within profiles. You assign numerical values to profile keys to track visitor interactions on the website.

Adding Keys to a Profile:

  • Right-click on your profile, then choose Insert > Profile Key.
  • Enter a name for the profile key (e.g., "Credit Card").

  • Provide Min-Max value as per requirement.

  • Save and publish the profile key item.

3. Profile Cards:

Profile cards aid in identifying and segmenting contacts, enabling the implementation of personalized rules across your website.

Creating a Profile Card:

  • Right-click on Profile Cards, then click Insert > Profile Card.

  • Assign a meaningful name (similar to profile keys) 

  • Set values based on categories.

  • Save and publish the profile cards to apply them effectively.

4. Personas:

Personas represent specific contact types within your target audience. Profile cards can describe how personas interact with website content, facilitating the implementation of personalized rules.

5. Pattern Cards:

Pattern cards map profile values to visitor types, enabling the implementation of personalized content strategies based on visitor behavior.

Creating a Pattern Card:

  • Right-click on Pattern Cards, then choose Insert > Pattern Card.

  • Set the name of Pattern card (same as profile card)

  • Set the Pattern card values per category

  • Save and publish the pattern card to utilize it for personalized content delivery

Stay tuned for the next blog post where we'll delve into Content Profiling and Personalization using these patterns. Learn how to optimize visitor experiences and drive engagement with Sitecore's powerful profiling capabilities.

Friday, 29 March 2024

Custom Personalization Rules in Sitecore

March 29, 2024 0



In my previous blog, I detailed the setup and management of the out-of-the-box (OOTB) personalization feature within a component. Today, I delve deeper into building and creating custom personalization rules to meet specific business requirements. Sitecore's architecture offers the flexibility needed for this scenario, allowing for the extension and implementation of custom rules as required. To illustrate, we'll focus on creating a custom rule that alters content displayed to site visitors based on a "querystring" parameter value.

To implement custom personalization, follow these steps:

Step 1: Navigate to " /sitecore/system/Settings/Rules/Definitions/Tags " and right-click on "Tags" to add a new customized Tag (e.g., QueryString Name Value Tag)


Step 2: Under " /sitecore/system/Settings/Rules/Definitions/Elements ", create a custom Element folder (e.g., QueryString Name Value Tag) and add a new condition within it. Set the Text and Type properties of the condition.

Text property: Provide a descriptive condition for the rule visible to content editors.

Type Property: Specify your class name along with its namespace followed by the assembly name, where the business logic for your personalization rule resides.

Step 3: Add the created tag to the default tag, within the Tags property of the element folder.

Step 4: Proceed to " /sitecore/system/Settings/Rules/Conditional Renderings " to include this tag in conditional rendering. This ensures the new rule is accessible in the rule editor for content editors to personalize components.


Step 5: Next, write the business logic for your personalization rule as required. You can download the sample code from this link , file name is QueryStringNameValueCustomRule.cs 


Step 6: In the Experience Editor, open a page, select the component for personalization, and click "Personalize." Then, click "New Condition" and add the rule according to your specifications. Click "Edit" to define the rule, where you'll find the custom rule you created. Select the custom rule, assign values as needed, and publish the page.


Step 7: Finally, on the public site, set the querystring as expected, and witness the personalized content tailored to your specifications.



I took references from this Sitecore Documentation Link while implementing and write down this blog.

Happy Sitecoring!

Friday, 15 March 2024

Basic Introduction on Sitecore Personalization

March 15, 2024 0

 


In this blog post, I'll provide an overview of personalization in Sitecore, outlining its benefits and offering step-by-step guidance on creating and configuring personalization for components. This guide is tailored for Sitecore beginners seeking to grasp the concept and its implementation.

Personalization empowers you to deliver customized content to your visitors. For instance, you can establish rules that display personalized content based on visitors' browsing patterns and their accumulated profile values.

This capability is crucial as it ensures that users are presented with content that aligns with their interests and preferences.

Approaches to Personalization:

  • Rules-based Personalization: The content editor establishes conditions dictating when content is delivered to a customer. These conditions can include factors such as visitor location or IP address, device type, keywords used to access the site, or completed website goals. The Rule Editor manages three key objects: Conditions, Actions, and Rules.
  • Adaptive Personalization: Utilizing visitor profiles and pattern-card matching, content is dynamically adjusted in real-time to suit individual visitors. Adaptive Personalization rules can be set using Sitecore XP’s Rules Set Editor.
  • Historical Personalization: Content can be personalized based on a contact’s past behavior rather than their current session actions. This approach acknowledges the significance of context preceding and following the present.
  • Test and Personalize: Sitecore XP facilitates A/B and multi-variant testing, either through pre-configured options or manual setup. Test results inform content optimization efforts aimed at improving conversion rates aligned with site goals. Testing also helps determine which content resonates best with specific visitor segments.
  • Journey-based Personalization: Design intricate user journeys within Sitecore XP using advanced business logic. These journeys aid in assessing customer progression with your brand and allow for the implementation of triggers to guide customers through their journeys based on their current stage.

Personalizing the Component:

It's important to note that for personalizing a component, ensure that the component you're targeting supports a datasource. This enables us to assign different contents based on various criteria.

Below are the steps to configure personalization for a specific component:

  1. Select the component you wish to personalize. You can choose the component from either the presentation or the Experience editor. We'll proceed with the Experience editor for this demonstration.


  2. Begin by selecting the component and clicking on the "Personalize" button.

  3. Next, click on the "New Condition" button and add the rule according to your requirements. Click on the "Edit" button to specify the rule.


  4. Let's consider a simple rule, such as displaying specific content if the current month is March.


  5. Now select the data source for March month rule


  6. Additionally, you can define a default or fallback component datasource. If none of the conditions match, the default will be utilized.


  7. Once the configurations are completed on the component, you'll notice an indicator in the presentation indicating that personalization has been applied to the specific rendering/component.



  8. You can also view the indicator from content editor.


  9. Upon saving and publishing the page, during the current month of March, it will display March-specific data.


If the rule is altered to set the month value to April, it will revert to displaying the default value.



In the Rule Set Editor, the personalization conditions are organized by category. The categories are:
  • Campaign
  • Channel
  • Date
  • Device
  • Fields
  • IP Geolocation
  • Item hierarchy
  • Item information
  • Item version
  • Marketing Automation
  • Security
  • Sitecore query
  • System
  • Tracking
  • Venue
  • Visit
  • Visitor
  • xDB
In the next blog we will discuss on how to create and implement custom personalization rules.

Happy Sitecoring!