Logging

Danie de Kock
Member since: 2006
 

Hi,

I've configured EPiServer CMS 5 to record stats for a website. I can see the stats in my statistics tab in Edit mode. But I can't find a way to display the stats in the website for the visitor.  Please take a look at the code below. The "TEST" in the GetMaxHits is the "siteDisplayName" in the web.config.  After running the code, the dataset contains a table "Pages", but with no rows.

Thanks!

Danie

RealTimeAnalyzerView client = new RealTimeAnalyzerView();

Uri address = new Uri("soap.tcp://localhost/RealTimeAnalyzerView");

Uri via = new Uri("soap.tcp://localhost/RealTimeAnalyzerView");

client.Destination = new Microsoft.Web.Services3.Addressing.EndpointReference(address, via);

DataSet data = client.GetMaxHits("TEST");

#28495
Mar 11, 2009 19:20
Thorbjörn Karlström
Member since: 2007
 

Hi,

Replace your last line (DataSet data = client.GetMaxHits("TEST");) with:

ITransformer transformer = (ITransformer)BaseLibrary.ClassFactory.CreateInstance(typeof(ITransformer), new object[0]);

DataSet data = client.GetMaxHits(transformer.CreateURL(CurrentPage.PageLink.ID));

#28498
Mar 12, 2009 9:49
Danie de Kock
Member since: 2006
 

Many thanks!

One more question: When I restart the log service I loose all my URL references (although the number of hits are retrieved from the database).  Because I loose all my URL references, I'm loosing all my stats. Is there another way of fetching the data without the URLs or is there a way to store the URL references in the database?

Or should I use the TimeSpanAnalyzerView instead for the historical data? If, how do I use it?

Thanks again!

Danie

#28501
Edited, Mar 12, 2009 10:30