Configuration

These are the various configuration options available, including cookie setup, campaign setup, and other miscellaneous options.

_setDomainName

Sets the domain name for the Google Analytics cookies. Note that this option can only be passed when create (previously _setAccount) is called.

via ga.js
_gaq.push(['_setDomainName', 'misterphilip.com']); 
via analytics.js
ga('create', 'UA-XXXXX-Y', {
    cookieDomain: 'misterphilip.com'
});

Should you want to use the legacy cookies (from ga.js), you'll also want to populate the legacyCookieDomain setting:
via analytics.js
ga('create', 'UA-XXXXX-Y', {
          cookieDomain: 'misterphilip.com',
    legacyCookieDomain: 'misterphilip.com'
});

_setCookiePath

Sets the path to the Google Analytics cookie. By default this is in the root (/) and it is recommended that this not be changed.

via ga.js
_gaq.push(['_setCookiePath', '/path/to/cookies']); 
via analytics.js
ga('create', 'UA-XXXXX-Y', {
    cookiePath: '/path/to/cookies'
});

_setSampleRate

Sets the sample rate; great for those with heavy traffic spikes. The value passed in should be a numeric string as a whole percentage.

via ga.js
_gaq.push(['_setSampleRate', '80']); 
via analytics.js
ga('create', 'UA-XXXXX-Y', {
    sampleRate: 80
});

_setSiteSpeedSampleRate

This determines how often site speed tracking beacons should be sent. The integer argument defines the percentage and defaults to 1% of visitors.

via ga.js
_gaq.push(['_setSiteSpeedSampleRate', '5']); 
via analytics.js
ga('create', 'UA-XXXXX-Y', {
    siteSpeedSampleRate: 5
});

_setVisitorCookieTimeout

Sets when the visitor cookie should expire, in milliseconds. Defaults to 2 years.

via ga.js
_gaq.push(['_setVisitorCookieTimeout', 63113900000]); 
via analytics.js
ga('create', 'UA-XXXXX-Y', {
    cookieExpires: 63113900000
});