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.
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");
Hi,Replace your last line (DataSet data = client.GetMaxHits("TEST");) with:ITransformer transformer = (ITransformer)BaseLibrary.ClassFactory.CreateInstance(typeof(ITransformer), new object);DataSet data = client.GetMaxHits(transformer.CreateURL(CurrentPage.PageLink.ID));
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?