Web Analytics API - DevNet

advertisement
Deep Dive – Web Analytics
Partners’ Webinar
06/27/2013
Karol Jarkovsky
Solution Architect
karolj@kentico.com
Tell Me How It Works
Advanced Configuration
•
Site manager  Settings  On-line marketing  Web analytics
o Remember visitors by IP (minutes)
o Visitor idle time (minutes)
o Excluding
o Excluded search engine
o Excluded file extension
o Excluded URLs
o Excluded IP addresses
•
web.config/appSettings
o
CMSWebAnalyticsSlidingIPExpiration
o Enabled by default
o
CMSWebAnalyticsShowFullData
o Indicates whether the amount of data displayed in the analytics reports should be reduced before being
rendered
o Disabled by default
o
o
CMSWebAnalyticsUseMemoryStorage
CMSActivityUseMemoryStorage
o Indicates whether WA should store hit logs in memory storage - CMS.WebAnalytics.MemoryStorage
o
CMSLogActivityImmediatelyToDB
But Is That Right?
Non-human traffic impacts statistics results
But Is That Right?
Adding mechanism to filter out non-human hits
Web Analytics Via JavaScript
2. Page executing async
call to Kentico web
service (using JavaScript)
4. Hits processed
standard way
1. Server adds JavaScript
snippet to page
3. Web service logs hits
asynchronously
Web Analytics Via JavaScript
•
JavaScript snippet registered on page through CMS.UIControls.DocumentBase
•
•
•
•
•
DocumentBase.InitAsyncWebAnalytics() method executed on page load
o
•
GetFilePage
PortalPage : ContentPage
o ~/CMSPages/PortalTemplate.aspx inherits from PortalPage
TemplateMasterPage
o ASPX Master Pages inherits from TemplateMasterPage
Additonal system pages working with DocumentBase
 ~\CMSModules\Newsletters\CMSPages\GetCSS.aspx
 ~\CMSModules\Sharepoint\CMSPages\GetSharePointFile.aspx
If analytics enabled and JavaScript logging enabled snippet is added to the page
JavaScript snippet calls one of methods defined in WebAnalyticsService.asmx
o
o
o
o
o
o
o
o
On-site search
Banner click
On-line marketing (Landing page, Exit page, Time on page, External search, Page visit)
Page views
Browser capabilities
Visitor info (browser, mobile devices, countries, cookies, etc.)
URL Referrals
Traffic sources
Web Analytics API
•
Web Analytics and important API classes
•
CMS.WebAnalytics.HitLogProvider
o LogDirectory – property that can be used to alter default storage path
o LogHit() - Core analytics method logging all statistics, incl. custom
o If physical log path IsExternalStorage then machine name is added to log file name
o
codeName_<date>_<time>[_<machine name>].log
o Info on how to create Custom Storage Provider here
•
CMS.WebAnalytics.HitLogProcessor
o Processing physical *.log files stored in HitLogProvider.LogDirectory
o Log file processed only if date and time retrieved from log file name is in the past
o Processing log files and adding hit counts for statistics with the same key
o
siteName;culture;objectName;objectID
o Storing statistics to DB in batches of 10
•
CMS.WebAnalytics.AnalyticsHelper
o TrackPageViewsEnabled()
o AnalyticsEnabled()
o Implements methods internally calling HitLogProvider.LogHit()
o
o
o
LogSearchKeywords()
LogReferringSite()
LogLandingPage()
o …
Web Analytics API
•
CMS.CMSHelper.AnalyticsMethods
o LogVisitor()


Tracks user visit, browser type, countries, mobile device
Visitor’s RETURNING_VISITOR status based on
1. IP address
• Site manager  On-line Marketing  Web analytics  Visitors  Remember visitors by
IP (minutes)
• With CMSWebAnalyticsSlidingIPExpiration IP stored for a minute longer
2. Session
3. Cookie
Logging Custom Statistics Using JavaScript
DEMO
THANK YOU!
Download