Marketing Cloud Connector for Sitecore XM
- Yassine Alahyane
- Jun 10
- 2 min read

June 10th 2025
Sitecore and Salesforce Marketing Cloud are two of the most powerful platforms for delivering personalized experiences and Marketing Automation.
If you’re using Sitecore XP (Experience Platform), you can leverage Sitecore Connect for Salesforce Marketing Cloud – Behavioral Data Exchange to sync behavioral data from xDB directly into Marketing Cloud Data Extensions. This enables advanced segmentation, journey building, and Marketing Automation.
👉 You can learn more about that connector here.
But what if you’re using Sitecore XM instead? The lightweight CMS version without xDB and analytics ? And you still want to track some user behavior and sync it to Salesforce Marketing Cloud?
Good news, it’s more achievable than you might think.
To help you get started, I’m excited to share a lightweight XM-to-Salesforce Marketing Cloud Connector.
Since Sitecore XM doesn’t offer built-in behavioral tracking, with this connector, you can define exactly what interactions you want to track, and send that data to Marketing Cloud where it can fuel personalized experiences.
As a starting point, the connector includes a working example for Page View tracking.
Let’s walk through how the connector works using this Page View Tracking example…
Set up a Data Extension in Salesforce Marketing Cloud
In Marketing Cloud, Create a new Data Extension as below:

Configure and Install the Connector
Clone this Repo.
Add Alyas.Feature.MarketingCloudConnect project to your XM Solution in Visual Studio.
Update Alyas.Feature.MarketingCloudConnect.Config with your MC credentials.

Update PageViewTracker.js Tracking Key with Data Extension External Key you created earlier.
In your Layout cshtml add the following to enable page views tracking:
<script>
window.SitecoreContext = {
userEmail: '@Sitecore.Context.User.Profile.Email'
};
</script>
<script type="text/javascript" src="~/Scripts/Feature/MarketingCloudConnect/PageViewTracker.js"></script>
Publish the Project and your Layout.
Test the Connector
Navigating on your website should now sync Data (Page Views) with your newly created Data Extension.
You can see both Anonymous and authenticated user's page views in this example.
Implementation Notes:
The API Endpoint used in this example to track page views takes as inputs:
TrackingKey : The External Key of the target Data Extension in Salesforce Marketing Cloud.
EventData: A list of generic objects, allowing flexibility to support various types of tracking events and different Data Extension schemas.
The Tracking Service provides three core functions:
TrackEvent: Send a list of events to a specified Data Extension in Salesforce Marketing Cloud
GetTrackingEventData: Query events from a Data Extension using custom filters (e.g., var filters = new NameValueCollection { { "Device", "Desktop" } };).
UpdateEvent: Modify an existing record in a specified Data Extension (Requires a Primary Key)
The Page Views Tracking implementation serves as a sample and should be reviewed and tailored to meet your specific requirements before use.
Important:
The data stored in Salesforce Marketing Cloud Data Extensions can be used in Journey Builder, Email Studio, segmentation, and other marketing campaigns. Additionally, you can leverage this connector to pull data back into Sitecore and drive website personalization based on that data.
While Sitecore XM does not include built-in analytics or marketing automation tools like XP, you can still use the Sitecore Rules Engine for personalization, including non-behavioral rules and custom rules that connect to external systems like Marketing Cloud.
Thank you for reading! If you found this helpful, please share it with your network.
Comments