User Segments for Web Parts

With the new SharePoint 2013 user segments we can display relevant content to our visitors. What if however we wanted to use user segments not only to control the content but to control Web Parts as well?

Displaying relevant content using content targeting with user segments

One of the great improvements in SharePoint 2013 for web content management is the new search-driven publishing model. Using SharePoint 2013 Search we can have our content indexed and published on one or more websites. The great benefit of using search for publishing content is, that it allows us to leverage its analytics and query manipulation capabilities to choose which content should be displayed. Although this sounds very technical, it creates new opportunities for showing relevant content and increasing the conversion of a website.

Content targeting with user segments is a part of the search-driven publishing model and therefore it works only in the context of Search Web Parts and content indexed by SharePoint 2013 Search. The consequence of it is, that even the smallest optimization requires you to ensure that the content-to-be-targeted is tagged properly and indexed and to create some query rules that will control which piece of content should be displayed for which group of visitors. While this bit of overhead is acceptable for more complex pieces of a website, what if all you need to do is to quickly display a promotional banner to some visitors?

Content targeting in the past

The concept of targeting content isn’t new to SharePoint 2013. Previous versions of SharePoint offered the Audiences capability that could be used to conditionally display Web Parts to certain groups of users. Often however the Audiences mechanism was not enough. Not only was it too static but it also worked with known users only, making it of little use on public-facing websites with anonymous users.

Despite its disadvantages, the idea behind Audiences was good: to be able to leverage the modularity of Web Parts to display relevant content to the visitors. So, what if you could conditionally display Web Parts to some groups of visitors, just as you would with Audiences, but then using user segments?

User Segments for Web Parts

Mavention User Segments for Web Parts is a SharePoint 2013 solution that allows you to conditionally display Web Parts to groups of users using user segments.

Upon installation, all you need to do, to use Mavention User Segments for Web Parts, is to activate the Mavention User Segments for Web Parts Web Application Configuration Web Application Feature in Central Administration.

Activating the ‘Mavention User Segments for Web Parts Web Application Configuration’ Feature in Central Administration

Activating the Feature will replace the default Audiences mechanism with the new Web Part targeting system based on user segments.

After activating the Feature you can directly start with targeting your Web Parts to user segments. Where previously you could configure Audiences, now you can choose to which user segments the particular Web Part should be visible.

Configuring user segments on a Content Editor Web Part

Once configured, Mavention User Segments for Web Parts will then check on every request whether the current visitor has the required segments terms in his profile to see the particular Web Part. The list of user segment terms for the current visitor are retrieved from the UserSegmentTerms session variable, which is an array of string and where you should set the array of user segment terms IDs for the current visitor in your implementation of content targeting with user segments.

Previewing your changes

As soon as you start applying user segments to conditionally display Web Parts you might want to be able to see how the page is going to be displayed to a specific group of visitors. Mavention User Segments for Web Parts integrates with the Mavention View as user segment solution I wrote about previously. So if you were using it already to preview pages using content targeting, you can now use it also to preview how content targeting will be applied to Web Parts.

Previewing user segments for Web Parts using Mavention View as User Segment


Using the content targeting with user segments capability of SharePoint 2013 we can display relevant content to visitors of our websites. Although this mechanism is very powerful it introduces some configuration overhead, particularly for quick and easy optimizations. Mavention User Segments for Web Parts allows you to apply the concept of content targeting using user segments to Web Parts what makes it easier to benefit of the modularity that Web Parts offer for building rich and dynamic websites.

Download: Mavention User Segments for Web Parts (10KB, WSP)

Others found also helpful: