Mark Everard

Hello, I'm Mark – a PhD physicist turned technologist / architect.

Archive for November, 2011

A QueryString Visitor Group Criterion for EPiServer

with 2 comments

A common usage for advanced website analytics systems (Omniture, Google etc) is to track the effectiveness of external digital marketing campaigns such as banner ads, pay-per-click, sponsored search results……..

Technically, this is normally achieved by adding a querystring key to the campaign link url and then tracking requests that use this key. So for example, a Google Adwords campaign linking to your /products page would also include a querystring parameter of cid=marketingcampaign (example:

This querystring parameter can be picked up by your analytics implementation and used to track various aspects of the campaign.

On an EPiServer CMS6 R2 site, editors can use the Personalization/Visitor Group framework to provide a unique page experience per visitor, meaning that its possible to provide personalized content for each external marketing campaign on any page on your site.

Out-of-the-box, EPiServer provides a criterion which checks the incoming request Url or the page referrer, but not one that checks the querystring of the incoming request.

Creating a Visitor group criterion is straight forward – the only issue I’ve ever had trouble with; is when working on a .NET 4.0 project – which was solved by Ted Nyberg.

I’ve created a simple QueryString Criterion which will provide a match based on the following:

  1. Whether the current request contains a user specified querystring key
  2. and / or whether the current request contains a matching querystring key which also has the user specified value.

The source code is available as part of the Criteria Pack on Codeplex and of course there is a Nuget package on – (as soon as its been approved!)

Written by mark

November 7th, 2011 at 11:00 am

Posted in Code,EPiServer