The cookieDomainPeriods variable determines the domain on which the Analytics cookies s_cc and s_sq are set by determining the number of periods in the domain of the page URL. This variable is also used by some plug-ins in determining the correct domain to set the plug-in's cookie.
The default value for cookieDomainPeriods is "2". This is the value that is used if cookieDomainPeriods is omitted. For example, using the domain www.mysite.com, cookieDomainPeriods should be "2". For www.mysite.co.jp, cookieDomainPeriods should be "3".
If cookieDomainPeriods is set to "2" but the domain contains three periods, the JavaScript file attempts to set cookies on the domain suffix.
For example, if setting cookieDomainPeriods to "2" on the domain www.mysite.co.jp, the s_cc and s_sq cookies are created on the domainco.jp. Because co.jp is an invalid domain, almost all browsers reject these cookies. As a consequence, visitor click map data is lost, and theVisitor Profile > Technology > Cookies report indicates that almost 100% of visitors reject cookies.
If cookieDomainPeriods is set to "3" but the domain contains only two periods, the JavaScript file sets the cookies on the subdomain of the site. For example, if setting cookieDomainPeriods to "3" on the domain www2.mysite.com, the s_cc and s_sq cookies are created on the domain www2.mysite.com. When a visitor goes to another subdomain of your site (such as www4.mysite.com), all cookies set withwww2.mysite.com cannot be read.
See also fpCookieDomainPeriods.
Max Size | Debugger Parameter | Reports Populated | Default Value |
---|---|---|---|
N/A | CDP | Affects multiple reports as it controls how the visitor ID is stored and handled. | "2" |
Several examples to dynamically set the variable if your core Javascript file hosts both types:
Reference: https://marketing.adobe.com/resources/help/en_US/sc/implement/cookiedomainperiods.html