Slide deck used in the European SharePoint Conference 2015, in Stockholm, Sweden.
SharePoint 2013 introduced the Recommendations web part, an easy and straightforward way of giving users personalized content recommendations based on their behaviour and the behaviour of other users of the site. In this session you will learn how SharePoint calculates these recommendations, the components used to power recommendations and how you can leverage them. You will also learn how you can use and extend this feature by using custom usage events and influencing the recommendation calculations.
2. André Vala
/47
2
ABOUT ME
BLOG
LINKED IN
TWITTER
EMAIL
MEMBER OF
MEMBER OF
WORKS FOR
andre.vala@create.pt
@atomicvee
http://blogit.create.pt/andrevala
http://www.linkedin.com/in/andrevala
SharePoint Solutions Architect
JOB TITLE
Office365 PT
SPUG PT
5. Content Recommendation
What?
• Providing relevant contextual content to users
• “People who viewed this also viewed that”
• “These are the most popular items”
Why?
• Enhanced user experience
• Improved conversion (on e-commerce sites)
How?
SharePoint 2013 includes two out-of-the-box webparts
• Recommended Items web part
• Popular Items web part
/47
5
6. Recommended Items Web Part
• Out-of-the-box Web Part
• Similar to a Content Search Web Part
• Shows list of recommended items
related to the current content (“users
who viewed this item also viewed
these items”)
/47
6
CONTENT RECOMMENDATION
7. Popular Items Web Part
• Out-of-the-box Web Part
• Similar to a Content Search Web Part
• Shows most viewed items
• Can be filtered (by category, for example)
/47
7
CONTENT RECOMMENDATION
11. Architecture
/47
11
HOW DOES IT WORK?
Page with
web parts
Usage
Reports
Search
Index
Analytics
Processing
Component
Event
Store
External
Events
Analytics
Reporting DB
User
Admin
1
2
3
4
5
6
7
8
1 Usage events are recorded by the webparts
and saved in the event store
Usage events from the event store or from
external events are periodically processed
by the Analytics Processing Component
2
3
Recommendation and popularity data
about each item is added to the search
index
4
Processed usage events are also stored in
the Analytics Reporting database
5
Recommendation and popularity data is
used in the respective webparts and also to
influence relevance in search queries
6
Popularity data from the search index and
analytics reporting database is used in
usage reports
7
8
12. Usage Events
• Default usage event types
• View
• Recommendation displayed
• Recommendation clicked
• Recorded by the web parts and saved to the Event Store
• You can create up to 12 custom usage event types
/47
12
HOW DOES IT WORK?
13. Event Store
Folder in the file system that stores usage event log files
/47
13
HOW DOES IT WORK?
1_2015110618_AV-SP-VM01.log
Event
Type ID
Year Month Day Hour
Server
17. Usage Analytics Processing
• Usage Analytics processing runs once every 24 hours
• How to manually jump start it
1. Start Search Analytics
2. Push usage events to the Event Store
3. Prepare usage event files
4. Start Usage Analytics
/47
17
HOW DOES IT WORK?
18. Start Search Analytics
Start the Search Analytics timer job
$a = Get-SPTimerJob -Type Microsoft.Office.Server.Search.Analytics.AnalyticsJobDefinition
$sa = $a.GetAnalysis("Microsoft.Office.Server.Search.Analytics.SearchAnalyticsJob")
$sa.StartAnalysis()
Check if the Search Analytics timer job is done
$sa.GetAnalysisInfo()
/47
18
HOW DOES IT WORK? > ANALYTICS PROCESSING
19. Push events to the Event Store
Events are pushed every 10 minutes through a Timer Job
$tj = Get-SPTimerJob -Identity ("job-usage-log-file-import")
$tj.RunNow()
Check the event store
C:Program FilesMicrosoft Office Servers15.0DataOffice ServerAnalytics_<GUID>EventStore
/47
19
HOW DOES IT WORK? > ANALYTICS PROCESSING
20. Prepare usage event files
• Usage Analytics processes usage events from the previous day
• Workaround to process current day
• Copy usage log files to a custom folder
• Make sure the folder is read-only
• Run the job specifying the folder path
/47
20
HOW DOES IT WORK? > ANALYTICS PROCESSING
21. Start Usage Analytics
Run the following PowerShell script
$tj = get-sptimerjob -type microsoft.office.server.search.analytics.usageanalyticsjobdefinition
$tj.DisableTimerJobSchedule()
$tj.StartAnalysis("<hostname>Analytics_<guid>EventStoremyevents")
$tj.EnableTimerJobSchedule()
Check if the usage analytics job is done
$tj.GetAnalysisInfo()
/47
21
HOW DOES IT WORK? > ANALYTICS PROCESSING
22. Recommended Items Web Part
• Shows items whose recommendedfor property includes a token from the
current URL
• Display Template records usage events:
• Recommendation Displayed
• Recommendation Clicked
• To generate recommendations, associated items must have been clicked
by three or more different users
/47
22
HOW DOES IT WORK?
23. Popular Items Web Part
• Shows items sorted by the ViewsRecent managed property (number of
views of the item in the last 14 days)
• Uses owstaxIdMetadataAllTagsInfo managed property for automatic
filtering
/47
23
HOW DOES IT WORK?
25. Demo Summary
• How events are recorded to the event store
• Manually starting usage analytics processing
• Configuring Recommended Items Webpart
• Configuring Popular Items Webpart
/47
25
HOW DOES IT WORK?
27. Popular Items Report
• Shows usage event statistics for all items in a list/library
• Can be sorted by recent (last 14 days) or ever
• Accessible from the list/library ribbon (Most Popular Items button)
/47
27
28. Popularity Trends Report
• Excel report
• Shows usage event statistics for a:
• Site collection (from site collection administration settings)
• Web site (from site administration settings)
• List/library item (from list/library files ribbon)
• Daily count for the last 14 days
• Monthly count for the last 3 years
/47
28
29. Using PowerShell
Get Usage Report
https://msdn.microsoft.com/EN-US/library/microsoft.office.server.search.administration.searchserviceapplication.getrollupanalyticsitemdata.aspx
Retrieves usage data (hits and users) for a site collection or a specific web site, for a single day or a whole month.
$searchApp.GetRollupAnalyticsItemData
Get Search Report
https://msdn.microsoft.com/EN-US/library/microsoft.office.server.search.administration.searchserviceapplication.getsearchreport.aspx
Retrieves the search report (top queries) for one or all site collection, for a single day or a whole month.
$searchApp.GetSearchReport
/47
29
40. Recommendations for Anonymous Users
• Requires usage cookies
• Cookies that identify a user session using a GUID
• Lifetime of 14 days
• By default usage cookies are disabled for SharePoint web applications
• By default, only the View event type can be recorded for anonymous users
/47
40
41. Allow Event Recording for Anonymous Users
Get Search Service Application
$SSP = Get-SPEnterpriseSearchServiceApplicationProxy
Get a usage event type
$tenantConfig = $SSP.GetAnalyticsTenantConfiguration([Guid]::Empty)
$event = $tenantConfig.EventTypeDefinitions | where-object { $_.EventTypeId -eq <EventTypeId> }
Enable the recording of a usage event for anonymous users
$event.Options = [Microsoft.Office.Server.Search.Analytics.EventOptions]::AllowAnonymousWrite
$tenantConfig.Update($SSP)
/47
41
45. Key Takeaways
• SharePoint records and analyzes usage data to calculate
• Item popularity (view count)
• Item recommendations (item relationships)
• SharePoint includes two out-of-the-box web parts
• Recommendation features are based on Search
• Recommendation features are customizable
• Create custom usage event types
• Change recommendation weight
• Change recent popularity time frame
/47
45
46. References
How to display recommendations and popular items in SharePoint Server 2013
https://technet.microsoft.com/en-us/library/dn794244.aspx
Overview of analytics processing in SharePoint Server 2013
https://technet.microsoft.com/en-us/library/jj219554
Configure recommendations and usage event types in SharePoint Server 2013
https://technet.microsoft.com/en-us/library/jj715889.aspx#BKMK_CreateCustomUsageEventType
View usage reports in SharePoint Server 2013
https://technet.microsoft.com/en-us/library/jj715890.aspx
Bella Engen’s blog
http://blogs.technet.com/b/tothesharepoint
Waldek Mastykarz’s blog
http://blog.mastykarz.nl
/47
46