Setup the Analytics module in continuous delivery

You can use the same configuration for Google Analytics in all your environments, but receive tracking data only form your production site.  Using the following settings, the request to other domains are ignored in the tracked data.

NOTE: Because the configuration files, generated by the Analytics module, are from a different provider, they cannot be stored in the database. Therefore, you cannot configure the module after you deploy the site in the cloud. You must do it before the deployment and the files need to be included in the deployment package.

Perform the following:

  1. Create an account in Google Analytics or use and existing one.

    RECOMMENDATION: Google Analytics recommends that you have one account set for every website that you track.

  2. In your account, create a new property and set the Default URL to be the URL of your production site.
    A property represents a website, mobile application, or device. It is the representation of the resource that is associated with your tracking code.
  3. In this property, create a view and set its Website URL to be that of your production site.
    The view is your access point to reports.
  4. Add a filter for the newly created view.
    It will filter the incoming data, so that only data from your production domain will be used.
    Perform the following:
    1. In Google Analytics, navigate to the Admin section.
    2. Select your Account, Property, and View.
    3. In the View column, click Filters » ADD FILTER.
    4. In Filter Name, choose a name for the filter.
    5. In Filter Type, select Predefined.
    6. In Select filter type, select Include only.
    7. In Select source or destination, select traffic to the hostname.
    8. In Select expression, select that contains or that are equal to, depending on the setup you need.
    9. In Hostname, enter the address of your production website.
    10. Click Save.
  5. Perform procedure Set up the Analytics module.
    1. In Step 6, in Available accounts dropdown box, select the view that you have created.
    2. In Step 7, in Tracked domains, select the domain of the production website.

      NOTE: If you have not set the tracking code, provided by Google Analytics on any page of your website or the page where you have set it has not been requested, Sitefinity CMS your domain in the list of Tracked domains.

RESULT: Sitefinity CMS Analytics module will display data from your production environment only, regardless of that you are using the same Analytics settings on all of your environments.

Was this article helpful?