Track websites with Sitefinity Insight

Turn on tracking

When you have Sitefinity Insight subscription, your  Insight account is connected to your Sitefinity Cloud project and initial tracking is enabled for the Staging environment only. 

To enable tracking of your Production environment, perform the following:

  1. Open Sitefinity Cloud Management portal.
  2. Navigate to Pipelines » Library.
  3. Open _CUSTOMER_Production_Variables group and set the 
    sf-env:digitalExperienceCloudConnectorConfig:disableTracking key to False
    By default, it is set to True.

Data centers configuration

Initially, in Sitefinity Cloud two Sitefinity Insight data centers are configured – Staging and Production with different Access keys. 

The key for each data center is referenced in the _CUSTOMER_Production_Variables and _CUSTOMER_Staging_Variables and is set appropriately for each environment’s web.config transformation file during deployment. The actual values are pulled up securely from Azure Key Vault, so that the access keys values are not displayed.

The following screenshot displays the Access key and its value for the Production environment:


Website mapping

Each website name must be mapped to the proper API key for the Sitefinity Insight data center where the site will send data to. It is important that this mapping is set in the web.config transformation file for each environment.

In the continuous delivery pipeline, web.config file transformations are used, so that Sitefinity Cloud can support different configurations for the Staging and Production environments. The Web.Production.config file holds the configurations that are applicable to the Production environment only and the Web.Staging.config file holds configurations that are applicable for the Staging environment only. 

EXAMPLE: The following part of the web.config demonstrates how to map the API key:

NOTE: The proper mappings for the already existing websites will be added to the project in the initial configuration, provided by the Sitefinity Cloud team.

Tracking a new website

If you want to add another website for tracking, you must map it to the Production or the Staging data center. 

To do this perform the following:

  1. Download the project for development and set it up locally.
    For continuous delivery process to work, Sitefinity configurations are read-only in the Cloud and can be edited only locally.
  2. In Sitefinity CMS backend, navigate to Administration » Settings » Advanced » DigitalExperienceCloudConnector » Mappings Site name <-> API key
  3. Click the (?) icon of DataCenterApiKey input field.
  4. Copy the path to the configuration property.
  5. Use the copied path to  build the string that you must add in the appSettings section of the Web.Production.config or the Web.Staging.config transformation files.
    Use the following example: 

Was this article helpful?

Next article