Loading ...
Sorry, an error occurred while loading the content.

Re: SiteCatalyst Time Parting

Expand Messages
  • John Andrews
    Hi Kevin, We are using the Time Parting Plugin as shown at the bottom. The site uses multiple languages, but the one common denominator between all the sites
    Message 1 of 3 , Feb 13, 2012
    View Source
    • 0 Attachment
      Hi Kevin,

      We are using the Time Parting Plugin as shown at the bottom. The site uses
      multiple languages, but the one common denominator between all the sites is
      that we use this plugin. We are able to use server side coding but I would
      like to try and keep this as simple as possible (We are a huge website with
      multiple sections. Each section has a different development team. We
      liked the idea of using this plugin as we can keep as much of the code
      based global).

      I just find it odd how this one plugin will base the time based on the
      server but not the day.

      Regards

      John

      /*
      * Plugin: getTimeParting 1.3 - Set timeparting values based on time zone
      */
      s.getTimeParting=new Function("t","z","y",""
      +"dc=new Date('1/1/2000');f=15;ne=8;if(dc.getDay()!=6||"
      +"dc.getMonth()!=0){return'Data Not Available'}else{;z=parseInt(z);"
      +"if(y=='2009'){f=8;ne=1};gmar=new Date('3/1/'+y);dsts=f-gmar.getDay("
      +");gnov=new Date('11/1/'+y);dste=ne-gnov.getDay();spr=new Date('3/'"
      +"+dsts+'/'+y);fl=new Date('11/'+dste+'/'+y);cd=new Date();"
      +"if(cd>spr&&cd<fl){z=z+1}else{z=z};utc=cd.getTime()+(cd.getTimezoneO"
      +"ffset()*60000);tz=new Date(utc + (3600000*z));thisy=tz.getFullYear("
      +");var days=['Sunday','Monday','Tuesday','Wednesday','Thursday','Fr"
      +"iday','Saturday'];if(thisy!=y){return'Data Not Available'}else{;thi"
      +"sh=tz.getHours();thismin=tz.getMinutes();thisd=tz.getDay();var dow="
      +"days[thisd];var dt='Weekday';var mint='00';if(thismin>1"
      +"4){mint='15'}if(thismin>2"+"9){mint='30'}if(thismin>4"+"4){mint='45'};if
      (thish==0){th"
      +"ish=12};if(thisd==6||thisd==0){dt='Weekend'};var timestring=thish+'"
      +"_'+mint;var daystring=dow;var endstring=dt;if(t=='h'){return tim"
      +"estring}if(t=='d'){return daystring};if(t=='w'){return en"
      +"dstring}}};"
      );






      On Fri, Feb 10, 2012 at 2:27 PM, KevinR <
      kevin.rogers@...> wrote:

      > How are you getting the time value? What programming language is your site
      > in? I have done a ton with getting all the time/date information with
      > JavaScript, and a bunch with getting it using php, but I've never needed to
      > mix the two. Are you able to use any server side code?
      >
      > Kevin Rogers
      > http://webanalyticsland.com
      >
      >
      > --- In webanalytics@yahoogroups.com, "jandrewsxchg" <jandrews.xchg@...>
      > wrote:
      > >
      > > Hi,
      > >
      > > I have implemented Time Parting on a site that I am responsible for, but
      > I have noticed a weird issue. We altered the code slightly so we will get
      > the actual day, not if it is just a weekday or weekend. While the time is
      > based on server by default, the day is based on javascript where it takes
      > it from the person computer. This means we get inaccurate data (if I run
      > the data for 10 February, I will get majority that comes back with Friday,
      > but I get several Thursday, Saturday, and even Tuesday (yes.... completely
      > off). Has anyone implemented this before where the day will be based off
      > of Server while writing the code in JavaScript?
      > >
      > > Thanks
      > >
      > > John
      > >
      > > http://bit.ly/y_analysisxchg
      > >
      >
      >
      >


      [Non-text portions of this message have been removed]
    • vabeachkevin
      What you have there is an older version of the standard SiteCatalyst time parting plugin. The current version can be found in SiteCatalyst under Help
      Message 2 of 3 , Feb 15, 2012
      View Source
      • 0 Attachment
        What you have there is an older version of the standard SiteCatalyst time parting plugin. The current version can be found in SiteCatalyst under Help > Knowledge Base > Product Documentation > Implementation > Plug-ins, and I believe it is version 2.0. Now there hasn't been a tremendous amount changed between the version you have and the current version. The new version plays a little nicer with DST, but the core functionality and the way the date and time is captured has not changed. Since it is JavaScript, it is based on the date and time information from the users web browser where the script is ran, not on any server information.


        Kevin Rogers
        http://webanalyticsland.com


        --- In webanalytics@yahoogroups.com, John Andrews <jandrews.xchg@...> wrote:
        >
        > Hi Kevin,
        >
        > We are using the Time Parting Plugin as shown at the bottom. The site uses
        > multiple languages, but the one common denominator between all the sites is
        > that we use this plugin. We are able to use server side coding but I would
        > like to try and keep this as simple as possible (We are a huge website with
        > multiple sections. Each section has a different development team. We
        > liked the idea of using this plugin as we can keep as much of the code
        > based global).
        >
        > I just find it odd how this one plugin will base the time based on the
        > server but not the day.
        >
        > Regards
        >
        > John
        >
        > /*
        > * Plugin: getTimeParting 1.3 - Set timeparting values based on time zone
        > */
        > s.getTimeParting=new Function("t","z","y",""
        > +"dc=new Date('1/1/2000');f=15;ne=8;if(dc.getDay()!=6||"
        > +"dc.getMonth()!=0){return'Data Not Available'}else{;z=parseInt(z);"
        > +"if(y=='2009'){f=8;ne=1};gmar=new Date('3/1/'+y);dsts=f-gmar.getDay("
        > +");gnov=new Date('11/1/'+y);dste=ne-gnov.getDay();spr=new Date('3/'"
        > +"+dsts+'/'+y);fl=new Date('11/'+dste+'/'+y);cd=new Date();"
        > +"if(cd>spr&&cd<fl){z=z+1}else{z=z};utc=cd.getTime()+(cd.getTimezoneO"
        > +"ffset()*60000);tz=new Date(utc + (3600000*z));thisy=tz.getFullYear("
        > +");var days=['Sunday','Monday','Tuesday','Wednesday','Thursday','Fr"
        > +"iday','Saturday'];if(thisy!=y){return'Data Not Available'}else{;thi"
        > +"sh=tz.getHours();thismin=tz.getMinutes();thisd=tz.getDay();var dow="
        > +"days[thisd];var dt='Weekday';var mint='00';if(thismin>1"
        > +"4){mint='15'}if(thismin>2"+"9){mint='30'}if(thismin>4"+"4){mint='45'};if
        > (thish==0){th"
        > +"ish=12};if(thisd==6||thisd==0){dt='Weekend'};var timestring=thish+'"
        > +"_'+mint;var daystring=dow;var endstring=dt;if(t=='h'){return tim"
        > +"estring}if(t=='d'){return daystring};if(t=='w'){return en"
        > +"dstring}}};"
        > );
        >
        >
        >
        >
        >
        >
        > On Fri, Feb 10, 2012 at 2:27 PM, KevinR <
        > kevin.rogers@...> wrote:
        >
        > > How are you getting the time value? What programming language is your site
        > > in? I have done a ton with getting all the time/date information with
        > > JavaScript, and a bunch with getting it using php, but I've never needed to
        > > mix the two. Are you able to use any server side code?
        > >
        > > Kevin Rogers
        > > http://webanalyticsland.com
        > >
        > >
        > > --- In webanalytics@yahoogroups.com, "jandrewsxchg" <jandrews.xchg@>
        > > wrote:
        > > >
        > > > Hi,
        > > >
        > > > I have implemented Time Parting on a site that I am responsible for, but
        > > I have noticed a weird issue. We altered the code slightly so we will get
        > > the actual day, not if it is just a weekday or weekend. While the time is
        > > based on server by default, the day is based on javascript where it takes
        > > it from the person computer. This means we get inaccurate data (if I run
        > > the data for 10 February, I will get majority that comes back with Friday,
        > > but I get several Thursday, Saturday, and even Tuesday (yes.... completely
        > > off). Has anyone implemented this before where the day will be based off
        > > of Server while writing the code in JavaScript?
        > > >
        > > > Thanks
        > > >
        > > > John
        > > >
        > > > http://bit.ly/y_analysisxchg
        > > >
        > >
        > >
        > >
        >
        >
        > [Non-text portions of this message have been removed]
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.