MVT using Publishing Targets

I have been involved in a few enterprise projects where unfortunately I cannot easily enable XDB architecture and fully leverage Sitecore capabilities for MVT testing, therefore, it comes to the idea of getting creative with what I got and find an alternative way of helping the marketing team testing the effectiveness of their new content and the new functionality that they have in mind….

I guess that it is pointless to mention, the advantages of the Testing culture and the idea behind fail quickly… however all these principles & features are covered with Sitecore MVT and in case you have XDB enabled in most of the cases I would strongly suggest you to use the built-in features…

In the specific project circumstances, I have been asked to test the effectiveness of some new “label” within the Booking funnel to see the impact on conversion….

For the Tracking, we were not using XDB and Sitecore analytics but Google Analitycs do a good job tracking Conversion and events…

For trying the different variants, I have split the sitecore change across the 4 Publishing Targets that I have for scalability reasons…  you can read more about publishing target here

My architecture requires a CDN / Proxy (Akamai in my specific case) to split the traffic across my 4 Content Delivery servers and have a publishing target different for each of the Content Delivery server…

Each Variant can be assigned to one or multiple CDs so that you can have a simple A/B testing or a more complex MVT….

With this architecture and this setup, I was able to allow the marketing team to test their content experiment and help them to find the best variation and the winning experiment even without having to configure Sitecore analytics, XDB and so on, but just leveraging the existing architecture….

The change that you would need to implement is to send via a custom dimension to GA the name of the Content Delivery server for each page view / event / transaction…

the code to track the CD, would be as simple as:

ga('set', 'cd1', 'Level 1');

obviously, this approach comes with some trade-off….  since Marketing users cannot really know which test is running and risk to override a running test doing a simple content publishing…. Also from the reporting point of view, you would need to keep track of the publishing that your content team is doing to be sure that anything else is affecting your experiment…. Also, need to remember to switch off your experiments and align all the content on the publishing targets to have a consistent web site….


Untitled Diagram

Sitecore 8 Profiling Visitors for Beginners

The first step to deliver Personalisation for Anonymous Visitors of your web site is knowing your Visitors through the pages that they have visited…

Sitecore allow you to Profile your customers interests and behavior through the Profile framework where you can define the Profile Keys, Profile Cards and PatternMatch Cards.

In order to be able to fully benefit from this feature, you need to have XDB & Analytics enabled so that you can fully track your customer behavior.




As you can see, there is not always a clear classification, but often the definition touch multiple dimensions…

Once that you have defined your Profiles, it is time to TAG your content so that you can classify your visitors….



Once that you have defined your Profiles and Tagged your content you can easily identify your Anonymous visitors and start delivering personalized content based on the interest and behavior that you were able to track….

Some example of personalisation rules are reported here…





Sitecore Behavior Personalisation InSession

One of the key selling point of Sitecore 8 compared to the other CMS products is the Personalisation Engine.

The definition of “Behavior Personalisation” should be self Explanatory, providing personalised content based on the behavior of the user….

InSession Personalisation DOES NOT REQUIRE XDB license and MONGODB capabilities. Most of the features are enabled also if you are running Sitecore in CMSONLY mode.

The main advantage of XDB comes from the power of Analytics data and it will give you the ability to personalised based on the historic interactions and behavior (eg. checking if the customer has visited the page within the previous visits to the web site, or if the customer has never triggered a specific goal.)

The way of delivering personalised content within Sitecore is common within the personalisation framework and as you would expect you would need to define within your presentation details your personalisation rules.

Within the personalisation engine there are several way to define visitors behavior:

  • Visit user visit a page, or check the entrypage of the journey


  • Goal / Event /Outcome user trigger a goal -Event -Outcome during the visit


  • Campaigns  user come from a campaign landing page/email or his journey qualify with a campaign


  • Referrals/search keyword user come from a specific website or through a specific keyword




Tracker is not initialized error

Within Sitecore 8.1 and 8.2 you could get easily this “Tracker is not initialized error” even if you are not planning to use analytics but for laziness you have not disabled analytics and/or you left within your layout the VisitorIdentification tag…

The simpler way to get rid of this issue if you are not using Analytics is to remove  Sitecore.Analytics.Tracking.config from your include folder.

In the case you want to use analytics therefore you should check that in Sitecore.Analytics.Tracking.config your hostname property is set to the DNS name that you are using to access to your website….

Track a Goal Hit via Sitecore analytics api

This snippet can be used to hit a goal via code with the sitecore analytics api

//Check that analytics are on...
if (Sitecore.Analytics.Tracker.IsActive && Sitecore.Analytics.Tracker.CurrentPage != null)
  //Get the item goal.
  Item goalItem = Sitecore.Context.Database.GetItem("{xxxxx-xxx-xxx-xxxxx}");
  //Page event wrapper
  PageEventItem goal = new PageEventItem(goalItem);
  //Create the record that needs to  store the goal
   VisitorDataSet.PageEventsRow pageEventsRw = Sitecore.Analytics.Tracker.CurrentPage.Register(goal);
  //this is not mandatory
  pageEventsRw.Data = "custom text";
to associate a goal to a sitecore item and to trigger the goal on the page view of the item, you can check this blog post

Getting Started with Sitecore 7.5 Analytics and MongoDb

As probably most of you have already heard, the more exciting new functionality of Sitecore 7.5 is around the Analytics and MongoDb
In this guide, I will help you in your first configuration of the analytics and MongoDb.

Assuming that you have completed the setup of SC 7.5 and Sitecore is running fine on your machine now it is time of download Mongo from here once that you have installed Mongo, you can decide if you want to run as a service or a standalone application.

If you have decided for the standalone application, now it is time to start it you can run the following from command line

cd C:\Program Files\MongoDB 2.6 Standard\bin
mongod.exe -dbpath C:\MongoData

Now you should see in the command line, the MongoDb status and activity tracking.

Now you can browse your sitecore instance ensuring that the Visitor identification tag is rendered correctly


and that the following code is rendered on the pages

<link href="/layouts/System/VisitorIdentification.aspx" rel="stylesheet" type="text/css" />

Assuming that you are running everything on the default MongoDB Port 27017 this should be in your connection string

<add name="analytics" connectionString="mongodb://localhost/analytics"/>
<add name="" connectionString="mongodb://localhost/tracking_live"/>
<add name="tracking.history" connectionString="mongodb://localhost/tracking_history"/>
<add name="reporting" connectionString="user id=user;password=password;Data Source(local);Database=sc75wizardSitecore_Analytics"/>

Now that you have collected some visitors data you can either run the latest visits report (in engagement Analytics) or use a MongoDbViewer (like Mongo Vue) to see your data in the Analytics – Contacts Table


Associate a visitor to a Contact in Sitecore 7.5 Analytics

This is a very important concept of Sitecore Analytics, basically everytime that you are identifying an user (eg. successful login, or getting the email address for any reason) you need to convert the existing “anonymous” visit to a registered contact, in this way the Analytics will associate the anonymous session analytics data to an identified “contact” data

var tracker = Sitecore.Analytics.Tracker.Current;
var identifier = tracker.Contact.Identifiers;
if (identifier.IdentificationLevel != Sitecore.Analytics.Model.ContactIdentificationLevel.Known)