gaAddonsgaAddons - Google Analytics Addons by Stéphane Hamel

Documentation: Calls Reference

_setDayOfWeek

_setDayOfWeekCreate a new session custom variable with the current weekday. This is particularly useful for segmentation.

Caveat

Since this call sets a custom variable, it should be put before your _trackPageView call, otherwise the data will not be collected.

_setDayOfWeek is initialized only on the 1st page view of the visit - therefore, if you want to use this feature, make sure it is included on every pages of your site.

The number of custom variables slots is limited to five. Be careful if you use this feature alongside other gaAddons features also making use of custom variables (namely, _4Q, _setDayOfWeek).

Simple call

_gaq.push(['_setDayOfWeek']);
      

Advanced call

_gaq.push(['_setDayOfWeek', {
	index: 1, // optional [1-5]
	name: 'DayOfWeek', // optional string
	value: null, // optional string
	scope: _GA_SCOPE_SESSION, // optional _GA_SCOPE_PAGE|_GA_SCOPE_SESSION|_GA_SCOPE_VISITOR or use 3,2,1 respectively
	days: ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'] // optional array of strings
	}]);
      

Parameters

index [1-5]
The custom variable slot number. The default value for this parameter is 1. Refer to Custom Variables in Google Analytics Help.
name 'DayOfWeek'|string
The custom variable name. Refer to Custom Variables in Google Analytics Help.
value null
Will hold the current day string. This parameter would typically not be overwritten..
scope _GA_SCOPE_SESSION|_GA_SCOPE_PAGE|_GA_SCOPE_VISITOR
The scope of this custom variable - page (3), sesion (2) or visitor (1). Since this event pertains specifically to a session, this parameter shouldn't be overwritten. Refer to Custom Variables in Google Analytics Help.
days ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday']|array of strings
This array holds the strings for each weekdays. You can overwrite those values if you want to translate or use a different set of values.