Configure the analytics cookie domain

Abstract

How to configure the Sitecore Content Delivery analytics cookie domain.

Applies to

Content Delivery (CD)

Configuration file

\App_Config\Sitecore\Marketing.Tracking\Sitecore.Analytics.Tracking.config

You can configure the domain of the tracking cookie (SC_ANALYTICS_GLOBAL_COOKIE) if you do not want it to be the default domain.

Configuring the analytics cookie domain can be useful in several scenarios, for example:

  • You have configured a proxy or special load balancer that changes the domain of the requests.

  • You want to track analytic statistics for several CD servers separately.

  • You want all the sites in a multisite scenario to use the same domain in their analytics cookie.

To configure the cookie domain:

  1. Open the \App_Config\Sitecore\Marketing.Tracking\Sitecore.Analytics.Tracking.config file.

  2. Insert the Analytics.CookieDomain tag with the value set to the domain of your choice.

    <configuration
      xmlns:patch="http://www.sitecore.net/xmlconfig/" 
      xmlns:set="http://www.sitecore.net/xmlconfig/set/" 
      xmlns:role="http://www.sitecore.net/xmlconfig/role/">
      <sitecore role:require="Standalone or ContentDelivery or ContentManagement">
        <settings>
          <setting name="Analytics.CookieDomain" value="YOUR DOMAIN" />
        </settings>
      </sitecore>
    </configuration>
  3. Save your changes.