Forum Discussion
Pam DeLung
Dec 11, 2019Copper Contributor
Audience Targeting for News not working at Hub Site level
We have a Hub site and are pulling in news from sites associated with the Hub. I have set targeted audiences on those news articles and have tested the functionality on the sites themselves - the au...
johnvienna
Dec 29, 2021Copper Contributor
We had also the same issue, like described with enabling target audience on the news webpart in combination with hub sites. I want to document couple of things, which we observed while solving this issue.
- News webparts target audience is depending on search if multiple site collections are involved
- It is enough to have target audience enabled on the site pages where the news is stored, you want to display on the news webpart(child site collection of a hub). It is not necessary to enable target audience on the site pages library where the page with the news webpart is stored(parent hub).
- The two main fields to watch on the site pages library are Audience and AudienceIds
- We have changed the field schema XML property with Set-PnPField to hide the target audience field. We were setting the value of the field with some additional flows depending on the specific site collections, instead of letting the user choose the right AAD group. So, if you hide the Audience field the way we have done it, the field will not be crawled and therefore target audience will not work.
- If you are using multiple target audience groups for one news page on some site collection the values of AudienceIds field are not complete. The Id of one of the groups is missing sometimes. In this case we just had to deactivate and reactivate target audience on the library level of the effected site collection.
After solving point 4 and 5 we managed to get the webpart working. So, the issue can be caused by so many different constellations, that it was quite hard for us to solve the issue. Point 4 was a mistake in our setup and point 5 seems to be a SharePoint bug.