****** TIME PARTING ****** 1. Add Time Parting Daylight Savings Config Variables for your location to the "Config Variables Section" of the AppMeasurement.js file or the AppMeasurement area in Dynamic Tag Management (add to Config Variables Section - DO NOT place in or after s.doPlugins). USE ONLY ONE SET OF DST CONFIG VARIABLES. Some have been preconfigured for your convenience below (or modify for your location). /* DST areas in US and Canada (no DST in AZ or SK, varies by county in IN) */ s.dstStart="3/9/2014"; s.dstEnd="11/2/2014"; s.currentYear="2014"; /* DST areas in Europe (no DST in Belarus, Iceland, Russia/Kaliningrad Oblast) */ s.dstStart="3/30/2014"; s.dstEnd="10/26/2014"; s.currentYear="2014"; /* DST areas in Australia (NSW,Vic,Tas,ACT,SA) - See Southern Hemisphere Info below */ s.dstStart="10/5/2014"; s.dstEnd="4/5/2015"; s.currentYear="2014"; /* DST in New Zealand - See Southern Hemisphere Info below */ s.dstStart="9/28/2014"; s.dstEnd="4/5/2015"; s.currentYear="2014"; /* DST areas in Brazil (SP,RJ,RS,SC,PR,MG,GO,DF,ES,MT,MS,BA) - See Southern Hemisphere Info below */ s.dstStart="10/19/2014"; s.dstEnd="2/21/2015"; s.currentYear="2014"; /* Countries or Areas with no DST */ s.dstStart="1/1/2014"; s.dstEnd="1/1/2014"; s.currentYear="2014"; For DST in your city, region and country, see: http://www.timeanddate.com/ NOTES ON DST: * Configuration variables MUST be set for plugin to work correctly * Format for config variables is MM/DD/YYYY * s.dstStart is the start day, month and year for Daylight Savings Time. * s.dstEnd is the end day, month and year for Daylight Savings Time * s.CurrentYear is the current year. If not set, will assume year of browser * If country has no DST - set dstStart, dstEnd to default (1/1/2014) SOUTHERN HEMISPHERE INFO: * If DST crosses into new year - set dstStart to month,day,year of previous year. After the DST end date passes,set the current year DST start date and the DST end date for next year (DST offset is calculated when today's date is between the DST start and DST end dates). ######################################################################################################### 2. Add the following calls with the correct GMT offset (time zone) to "doPlugins" /* Example is set to '-7' (US/Canada Mountain Time) */ s.prop17=s.getTimeParting('h','-7'); // Set hour s.prop18=s.getTimeParting('d','-7'); // Set day s.prop19=s.getTimeParting('w','-7'); // Set weekday /* Fun Option 1 - Set values into eVars for Conversion Time Parting! */ s.eVar17=s.prop17 s.eVar18=s.prop18 s.eVar19=s.prop19 /* Fun Option 2 - Set values into eVars using Dynamic Variables instead (discussed in Chapter 20) */ s.eVar17="D=c17" s.eVar18="D=c18" s.eVar19="D=c19" Find the correct GMT offset value for your location and modify the above calls in your AppMeasurement.js or the AppMeasurement area in Dynamic Tag Management. -10 = Honolulu -9 = Anchorage -8 = US/Canada Pacific Time -5 = US/Canada Eastern Time -4 = Santiago, Canada Atlantic Time -3 = Buenos Aires, Brasilia 0 = GMT, Western European Time +1 = Central European Time +2 = Eastern European Time, Cairo, Johannesburg, Istanbul, Tel Aviv +3 = Moscow, Saint Petersburg +4 = Abu Dhabi, Dubai +5.5 = Mumbai, Bangalore +7 = Bangkok, Hanoi, Novosibirsk +8 = Beijing, Hong Kong, Perth, Singapore, Taipei +9 = Tokyo, Seoul +9.5 = Adelaide, Darwin +10 = Sydney, Melbourne +12 = Wellington, Auckland For more GMT offsets, see: http://www.timeanddate.com/time/map/ ######################################################################################################### 3. Add the Plug-in Module after (below and outside) the *doPlugins* function. /* * Plugin: getTimeParting 2.0 - Set timeparting values based on time zone */ s.getTimeParting=new Function("t","z","" +"var s=this,cy;dc=new Date('1/1/2000');" +"if(dc.getDay()!=6||dc.getMonth()!=0){return'Data Not Available'}" +"else{;z=parseFloat(z);var dsts=new Date(s.dstStart);" +"var dste=new Date(s.dstEnd);fl=dste;cd=new Date();if(cd>dsts&&cd30){mint='30'}if(thish>=12){ap='PM';thish=thish-12};" +"if (thish==0){thish=12};if(thisd==6||thisd==0){dt='Weekend'};" +"var timestring=thish+':'+mint+ap;if(t=='h'){return timestring}" +"if(t=='d'){return dow};if(t=='w'){return dt}}};"); NOTE: * Always test plug-ins extensively to ensure data collection is as expected before deploying in production environment.