Debugging web analytics

If you encounter problems or unexpected behavior related to web analytics (for example with custom statistics), you can use the system’s debugging functionality to monitor how the analytics log statistics for individual web requests.

Enabling the web analytics debug

To use web analytics debugging, open the Settings application and adjust the settings in the System -> Debug category:

Setting

Description

Enable web analytics debug

Enables web analytics debugging and the Analytics tab in the interface of the Debug application.

Display web analytics debug on live site

If enabled, web analytics debug information is also displayed at the bottom of each page on the live site. Requires web analytics debugging to be enabled.

Web analytics debug log length

Sets the maximum length of the web analytics debug log, i.e. the number of requests for which debug information is preserved and displayed.

If empty, value of the Default log length setting is used.

Display stack information

If enabled, the system tracks the code stack when debugging web analytics and displays the information in the Context column.

This information is only available in the debugging UI and on the live site, not in the debug log written into the loganalytics.log file.

Log web analytics to file

If enabled, the system saves the web analytics debug log into the loganalytics.log file in the ~\App_Data folder. This option does not require web analytics debugging to be enabled.

Tip: You can also enable web analytics debugging through the “debug everything” settings in the All section of the Debug settings category.

Monitoring web analytics logging

To view which statistics the web analytics logged for recent web requests:

  1. Open the Debug application.
  2. Select the Analytics tab.

You can see the URLs of web requests and the time when the system processed the requests. The table below each request contains the web analytics statistics that the system logged for the given request. The table provides the following information for each statistic:

  • The Code name of the statistic

  • The Object related to the event (for example when logging page views, the Object value contains the alias path and document ID of the viewed page)

  • The number of hits that occurred (Count)

  • The code name of the site where the event occurred

  • The Context in which the system logged the event (API method)

    • Click on the method to see the full stack trace.
    • If you enable the Show complete context option at the top of the interface, the stack trace is displayed for all statistics.

Click Clear debug log to remove all records in the web analytics debug.