Previously I blogged about Cookie visitor group criteria for EPiServer. This visitor group criteria allows editors to check the values of cookies or simply that they exist. Today the "Cookie Drop Block" for EPiServer is released. It allows editors to create a block, that when rendered drops a cookie for the user.

How to use it

This is a block that has no front end rendering apart from some script that sets a cookie. In edit mode it is displayed to allow editors to get some feedback about the fact a cookie:

CookieDropBlock in edit mode

This message can be hidden in on page edit mode if the user checks the "Hide edit mode message" checkbox on the block.

How is this useful to me?

This block can be used in a number of useful ways:

Persist visitor group matches across sessions - This is useful as some built in EPiServer Visitor Groups are session based or simply do not use cookies. These are useful but means that the next time a user visits a site all insights are lost. For example if an editor uses the "Visited Page" criterion to mark a user as "Interested in Alloy track" then this will only match as long as the session is active. Using a combination of the Cookie Drop Block, CookieVisitorGroupCriteria and the built in "Visited Page" criteria we can persist this interest between sessions:

Personalised Cookie Drop block

Matching an interest group based on a landing page - The cookie drop block can be used with other visitor groups such as "Landing page" or "Query String" (available in the free EPiServer Visitor Group Criteria Pack). These can inspect values on the URL and will use CookieDropBlock to set a cookie for the user. This means its possible to tag inbound links from social media, emails or any other source such as a campaign set up in Google Analytics and identify them for the rest of their journey on the site and for each visit on the site.

How to install

This block is available on the EPiServer Nuget feed.

Source code for the Cookie Drop Block is available on GitHub.


Using a couple of simple tools I hope it can be seen that even more personal, persistent personalisation can be built with EPiServer. I look forward to hearing your thoughts/feedback in the comments below and for any more ideas on how this can could be used.


Recommendations for you