Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Web analytics - Kentico HitLogProvider.LogHit() only tracks first time visit? View modes: 
User avatar
Member
Member
joeh42 - 5/25/2011 10:46:24 AM
   
Web analytics - Kentico HitLogProvider.LogHit() only tracks first time visit?
I have setup analytics to track which user views which document ID as suggested by Zdenek in http://devnet.kentico.com/Forums/f45/t20545/Tracking-user-views.aspx.

I noticed that if I navigate through my site in the following order:
* page 1
* page 2
* page 3
* page 4
* page 1
* page 2
* page 3
* page 4

Kentico outputs the log entries to a text file. I see each listed individually (i.e. 8 hits). However, when I view the database records after the scheduled task has run, there are only 4 records.

Is this the correct behavior in terms of analytics?

Would it be possible to instead track each individual view (track all 8 records in the database) using Analytics, or would I need to create custom table and implement the logic myself?

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 5/26/2011 4:47:10 AM
   
RE:Web analytics - Kentico HitLogProvider.LogHit() only tracks first time visit?
Hello,


if you use the method:

CMS.WebAnalytics.HitLogProvider.LogHit("MembershipDocumentPageView", CMSContext.CurrentSiteName, CMSContext.CurrentUser.PreferredCultureCode, CMSContext.CurrentUser.UserName, CMSContext.CurrentDocument.DocumentId);

you can see the log records differ by the site, culture and username.

If you want to store the number of hits, you can use the method:

CMS.WebAnalytics.HitLogProvider.LogHit(string codeName, string siteName, string culture, string objectName, int objectId, int count)

See the API Reference for more details.


Best regards,
Helena Grulichova

User avatar
Member
Member
joeh42 - 5/26/2011 4:20:27 PM
   
RE:Web analytics - Kentico HitLogProvider.LogHit() only tracks first time visit?
I found the table structure confusing. After seeing multiple lines in the text log file, I expected to see multiple database records in the main stats table. I didn't realize that the counts were stored in the hourly / monthly / etc tables. Thanks!