Sitecore Personalize Demo using TamperMonkey

 

Sitecore Personalize Demo using TamperMonkey.png

I started exploring Sitecore Personalize, which allows to craft tailored web experiences based on customer behavior and preferences.

In this blog, I’ll walk through how to integrate Sitecore Personalization for the Sitecore XP/XM/XMCloud website without installing EngageSDK – using TamperMonkey, a browser extension for running custom JavaScript.

Create a Point Of Sale (PoS)

In Sitecore CDP or Personalize create a PoS for the website.

Sitecore-CDP-Personalize-Popup-TamperMonkey.png

 

Create a Web Experience

In Sitecore Personalize, let’s navigate to the Experiences section and click Create New Experience.

Select from experience types such as:

  • Web Experience (e.g., personalized banners or pop-ups)
  • Interactive Experience (e.g., Chatbots, real-time API integrations)
  • Triggered Experience (e.g., email, push notifications)

Sitecore-CDP-Personalize-Popup-TamperMonkey-21.png

Sitecore-CDP-Personalize-Popup-TamperMonkey-3-1.png

OOTB Templates

Sitecore Personalize offers 14 out-of-the-box (OOTB) templates for creating web experiences. These templates are designed to help you quickly set up and customize your web experiments and experiences without needing to write code. Here are some of the templates available:

  1. Alert Bar (Boxever Library)

  2. Corner Popup (Boxever Library)

  3. Email Capture Bar (Boxever Library)

  4. Email Capture Corner (Boxever Library)

  5. Notification Widget (Boxever Library)

  6. Popup takeover (Boxever Library)

  7. Sidebar (Boxever Library)

  8. Alert Bar (Sitecore Library)

  9. Corner Popup (Sitecore Library)

  10. Email Capture Bar (Sitecore Library)

  11. Email Capture Corner (Sitecore Library)

  12. Notification Widget (Sitecore Library)

  13. Popup takeover (Sitecore Library)

  14. Sidebar (Sitecore Library)

Select any of the out-of-the-box templates or custom web templates, if they have been created.

Sitecore-CDP-Personalize-Popup-TamperMonkey-4.png

Let’s start to customize it. You have the option to use Advanced Edit for HTML, CSS, and JavaScript to enhance web templates.

Sitecore-CDP-Personalize-Popup-TamperMonkey-4.png

The final Popup looks like this – changed the following 

  • Background color
  • Title
  • Description
  • Button Text

Sitecore-CDP-Personalize-Popup-TamperMonkey-6.png

 

Page Targeting

I chose all the pages for simplicity.

Sitecore-CDP-Personalize-Popup-TamperMonkey-7.png

 

If you like specific pages – add the condition for the page URL.

Sitecore-CDP-Personalize-Popup-TamperMonkey-17.png

Goals

I chose not to track performance for testing purposes. Feel free to add any goal according to website needs.

Sitecore-CDP-Personalize-Popup-TamperMonkey-8.png

Filter, Decisioning, and Notifications

They are optional, going to leave them as it is. The Decision Model is so powerful that, will be exploring it in upcoming blogs.

Preview

Let’s Preview what it looks like – 

https://madhuanbalagan.com/?bxQATool=true&bxFlowRef=f536d1f2-646d-406e-8bb4-7e434912ce6b&bxVariantRef=77069aa5-dd50-44d2-ac5b-243ff8c246f6

The preview isn’t working because the EngageSDK needs to be installed on the website. If you have EngageSDK installed on the website, feel free to skip the TamperMonkey part.

Now this is where the TamperMonkey plugin comes to the rescue to pre-load the Engage SDK on any website using Sitecore Personalize script.

Download TamperMonkey Chrome extension –http://chromewebstore.google.com/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo?hl=en

Note: Make sure it is enabled and the Developer mode is turned on.

Sitecore-CDP-Personalize-Popup-TamperMonkey-11-1.png

 

Let’s make a new script. By default, TamperMonkey uses the website domain where you clicked ‘New Script’ as a match. 

Sitecore-CDP-Personalize-Popup-TamperMonkey-12.png

Replace the following placeholders – 

The clientkey is found in CDP->Settings->API Access

Sitecore-CDP-Personalize-Popup-TamperMonkey-2-1.png

 

Let’s add the script to TamperMonkey and save it. The @name value determines how the script is named.

Now it should detect the script when you visit the website.

Sitecore-CDP-Personalize-Popup-TamperMonkey-13.png

 

Live

Let’s publish the Experience to make it live – If you have a notification set, it will email when it’s live, paused, etc.

Sitecore-CDP-Personalize-Popup-TamperMonkey-2-1.png

The email notification is pretty helpful especially for Marketers to track their Experiences.

Sitecore-CDP-Personalize-Popup-TamperMonkey-20.png

 

 

Preview

Let’s try the Preview – make sure to add a new script for the preview URL in TamperMonkey. 

Let’s load the Preview with the page URL.

Sitecore-CDP-Personalize-Popup-TamperMonkey-16.png

The Popup showed up and the QA Tool shows at the left side of the page.

QA Tool

The QA Tool shows the validation of everything. Feel free to change the variant to test different scenarios. It’s super helpful for troubleshooting any issues.

Sitecore-CDP-Personalize-Popup-TamperMonkey-14.png

Testing

Let’s reload the page, Yay! Popup showed up!!

Sitecore-CDP-Personalize-Popup-TamperMonkey-15-2.png

Hope this helps.

Happy Sitecoring!

Leave a Reply

Your email address will not be published. Required fields are marked *