In the previous article, I have explained about various list level settings available in SharePoint and explained Validation Settings in detail. Now, in this article, I am going to cover what audience targeting is and how to configure the audience targeting for lists and libraries.
In this article, I am going to cover the following topics.
- Introduction to Audience targeting in List and Library Setting.
- Why is audience targeting needed?
- How to configure audience targeting with an example?
Introduction to Audience Targeting in List and Library Settings
As the name suggests, audience targeting means targeting your audience. As we are in SharePoint and SharePoint is mainly used to manage your data and contents, we can redefine the meaning of target audience in SharePoint as “The configurable feature of SharePoint that allows its user to target the contents to its particular people is called as Target Audience or Audience Target”. In other words, the mechanism of identifying the contents and displaying to the appropriate groups of users in SharePoint is called as Audience targeting.
For example, there is a shopping portal in which the items are classified by region. So contents relevant to one region should not be visible to other regions and vice versa. So this can be avoided using targeting audience. Let’s understand this concept in details using the real-world example.
Why is audience targeting needed?
Let’s create a situation, there is an organization with name Contoso. Contoso has a custom list. In the list, they are creating sensitive and non-sensitive information and they are setting up the permission to the custom lists because SharePoint has powerful permission management. Now they have 2 user groups (What are groups in SharePoint that I am going to explain later in this series) Managers and Normal Users. The requirement is that the items which are sensitives must be visible to only users in Manager Groups, and other items should be visible to other users.
Now, what are the options to achieve this?
- Enter the item and assign the item level permission to the list. But configuring the item level permission is two steps process. Because first, we have to create the item in the list and then share the item with the required groups of users.
- Using audience targeting mechanism.
Audience Targeting is available with every list and library in SharePoint but it is by default disabled. We have to enable the audience targeting setting from lists and libraries setting manually.
How to enable/disable audience targeting?
Open the list on which you want to enable the audience targeting. Click on setting icons and then click on List Settings.
Check the list of columns in the list. Here, we do not have the column for Audience Targeting.
Now, click on Audience targeting settings option from list settings.
Check on the “Enable Audience targeting” and click OK. By default it is unchecked.
Now, check the columns in list setting again and now you will find an additional column for Audience targeting in the list.
So we have successfully enabled the audience targeting for the list Employee Directory.
Configuring audience targeting with an example
Now we have 2 groups in the SharePoint Site. Both the groups have different users as shown in the below images.
Managers groups have “Aakash Maurya” as its user.
The normal user’s group have Contoso user in it.
Now, just let’s add the item. Now, you will observe that while adding items to the list we have an additional column as Audience Targeting.
Note that here we can only insert the SharePoint Groups and Distribution groups. Here we cannot use Users directly. Similarly, add another item with title “Normal user” and assign Normal Users in the target audiences columns.
So, for now, we have 2 records in the list. One is for managers and other is for normal users. If you look at the lists then you will be able to see both the items. So now what to do to use the target audience feature? Target audience works with WebParts such as Content Query Web Part.
So now let’s create a page and keep the Content Query WebPart there. And configure the web part to get the items from Employee Directory list(How Content Query WebParts works that I will explain later in this series).
Keeping and Configuring Content Query WebPart
First of all, create a page. Then edit the page and then click on Insert -> WebParts -> Under Content Roll Up- -> Click on Content Query web part.
Now, let’s configure the web part. Edit the web part and select the list from which items should be displayed, in our case it’s Employee Directory. Then you will have an option to select “Apply audience filtering” check that option and save the web part. Now, save the page.
Once you will save the page then you can see the relevant items based on audience targeting set during creation of the item. If I have logged in with “Aakash” user then it belongs to Managers groups so Manager-1 item will appear on the screen.
If I am logged in with Contoso user and this user is a member of Normal User groups then on the same page I will be seeing the item “Normal User-1”.
So you have seen the power of Audience targeting. This option is available in most of the WebParts in SharePoint. I have demonstrated with Content Query.
So in this article, I have explained the basic concept of Audience Targeting, also I have explained why we need the audience targeting in the real world. I have also explained how to use audience targeting in SharePoint list and Content Query Web Part by detail example.
In my next coming article, I am going to cover how ratings work in SharePoint in detail.
Any question or feedback or suggestion, please do comment and let me know.