Web analytics API

Database tables

Web analytics use six primary database tables to store statistics and their values.

The Analytics_Statistics table stores records that represent the statistics of a tracked event within a certain context, i.e. related to a specific object, site and culture.

Five other tables are used to store the exact number of hits for the statistics in the Analytics_Statistics table:

  • Analytics_HourHits
  • Analytics_DayHits
  • Analytics_WeekHits
  • Analytics_MonthHits
  • Analytics_YearHits

When a hit for a tracked statistic occurs, it is logged into all of these tables. The difference between them is in the unit of time used to separate hits into individual records. For example, a record in the Analytics_HoursHits table contains the number of hits that were logged for a given statistic during one hour, while a single record in Analytics_MonthHits counts all hits that occurred over an entire month.

The Analytics_ExitPages table is used to temporarily store exit page candidates for the Top exit pages statistic. The latest candidate recorded for a visitor when their session expires is then stored as the final exit page.

Campaign statistic storage

The following tables store campaign tracking objects:

Database tableDescription
Analytics_CampaignContains records representing campaigns and their settings.
Analytics_CampaignAssetStores relationships between campaigns and their assets specified by their GUID.
Analytics_CampaignAssetUrlStores relationships between campaigns and their assets specified by their GUID for MVC sites.
Analytics_CampaignConversionContains records representing campaign conversions.

Conversions used in campaigns are a different type of conversions that are used elsewhere, typically A/B tests. If you are interested in the other type of conversions, see Logging custom conversions on your website.

Custom conversion statistic storage

Custom conversion tracking objects are stored in the Analytics_Statistics table and the corresponding amount of hits for individual units of time are saved in the appropriate Hits table.

The following code names are used for custom conversion statistics:

  • conversion – general statistic used to store the overall custom conversion records. This statistic is always logged when a custom conversion is performed on the website.
  • abconversion;<A/B test code name>;<Variant code name> – logged when a conversion is performed by a user who viewed the given page variant of an A/B test.
  • mvtconversion;<MVT test code name>;<Combination name> – logged when a conversion is performed by a user who viewed the given content combination on a page with a defined multivariate test.

All types of custom conversions use the StatisticsObjectName column to store the code name of the logged custom conversion.

API classes

You can find all web analytics classes under the CMS.WebAnalytics namespace.

ClassDescription
Analytics_Statistics table API
StatisticsInfoRepresents the statistics of a certain event within a specific context.
StatisticsInfoProviderProvides management functionality for statistic records.
Analytics_<time interval>Hits table API
HitsInfoRepresents the hits of statistics during a specific time interval.
HitsInfoProviderProvides management functionality for statistic hits.
Analytics_Campaign table API
CampaignInfoRepresents campaign tracking objects.
CampaignInfoProviderProvides management functionality for campaigns.
Analytics_CampaignAsset table API
CampaignAssetInfo

Represents the relationships between campaigns and their assets.

CampaignAssetInfoProviderProvides management functionality for the relationships.
Analytics_CampaignAssetUrl table API
CampaignAssetUrlInfoRepresents the relationships between campaigns and their assets on MVC sites.
CampaignAssetUrlInfoProviderProvides management functionality for the relationships.
CampaignAssetUrlInfoHelperProvides functionality for input validation.
Analytics_CampaignConversion table API
CampaignConversionInfoRepresents conversion tracking objects of campaigns.
CampaignConversionInfoProviderProvides management functionality for campaign conversions.
Analytics_Conversion table API
ConversionInfoRepresents custom conversion tracking objects of all other objects using custom conversions (e.g. A/B tests).
ConversionInfoProviderProvides management functionality for custom conversions.
Other classes
AnalyticsHelperProvides general web analytics functionality and data.
HitLogProviderContains methods used to create the analytics log files for statistics.
HitLogProcessorThis class defines the scheduled task that periodically processes analytics log files and transfers the information to the database.

Was this page helpful?