<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Web Analytics Land &#187; visits</title>
	<atom:link href="http://webanalyticsland.com/sitecatalyst-implementation/tag/visits/feed/" rel="self" type="application/rss+xml" />
	<link>http://webanalyticsland.com</link>
	<description>Omniture SiteCatalyst Implementation Optimization.</description>
	<lastBuildDate>Sat, 19 Nov 2011 02:24:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>How To Add Page Views And Visits To All SiteCatalyst eVars</title>
		<link>http://webanalyticsland.com/sitecatalyst-implementation/how-to-add-page-views-and-visits-to-all-sitecatalyst-evars/</link>
		<comments>http://webanalyticsland.com/sitecatalyst-implementation/how-to-add-page-views-and-visits-to-all-sitecatalyst-evars/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 19:39:14 +0000</pubDate>
		<dc:creator>VaBeachKevin</dc:creator>
				<category><![CDATA[SiteCatalyst Implementation]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[cookies]]></category>
		<category><![CDATA[enhancements]]></category>
		<category><![CDATA[implementation]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[omniture]]></category>
		<category><![CDATA[page views]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[sitecatalyst]]></category>
		<category><![CDATA[s_code.js]]></category>
		<category><![CDATA[tracking]]></category>
		<category><![CDATA[visits]]></category>

		<guid isPermaLink="false">http://webanalyticsland.com/?p=218</guid>
		<description><![CDATA[Here is a simple way to add Page Views and Visits to all of your eVar reports (see the update below). While Client Care has the ability to turn on a few things, flip some switches here and there to add visits to some reports, I like having full control over it as much as [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a simple way to add Page Views and <strike>Visits</strike> to all of your eVar reports <strong>(see the update below)</strong>. While Client Care has the ability to turn on a few things, flip some switches here and there to add visits to some reports, I like having full control over it as much as possible myself (and I&#8217;m not really in the mood to wait on hold to get it done). To make this happen we are going to have to use 2 events and a pair of plug-ins. Hopefully you should have a couple of events available to use, and you can find the plug-in code on the <a href="http://webanalyticsland.com/sitecatalyst-plugins/">SiteCatalyst Plugins</a> page. Here&#8217;s how to do it. </p>
<p>First lets get Page Views. To do this we are going to use the <a href="http://webanalyticsland.com/plugins/Append_to_List_Plugin.pdf">Append List plug-in</a>. The Append List (or apl) plug-in utility provides a simple mechanism to append a value to any delimited lists, with the option of a case sensitive or case-insensitive check to insure the value doesn&#8217;t already exist in the list. The apl plug-in is referenced by several standard plug-ins but can be used directly in a variety of situations. This is an Omniture supported plug-in and you can find more information about it by accessing the Knowledge Base.</p>
<pre class="brush: jscript">
s.apl(L,v,d,u)
</pre>
<p>L = source list, empty list is accepted<br />
v = value to append<br />
d = list delimiter<br />
u (optional, defaults to 0) Unique value check. 0=no unique check, value is always appended. 1=case insensitive check, append only if value isn&#8217;t in list. 2=case sensitive check, append only if value isn&#8217;t in list.</p>
<p>What we are going to do is in the s_code.js file, set up this plug-in to fire off an event on every single page view of the site, exactly mimicking the standard Page View metric.</p>
<pre class="brush: jscript">
/* Set Page View Event */
s.events=s.apl(s.events,&#039;event1&#039;,&#039;,&#039;,1);
</pre>
<p>Here is the plug-in code:</p>
<pre class="brush: jscript">
/*
* Plugin Utility: apl v1.1
*/
s.apl=new Function(&quot;L&quot;,&quot;v&quot;,&quot;d&quot;,&quot;u&quot;,&quot;&quot;
+&quot;var s=this,m=0;if(!L)L=&#039;&#039;;if(u){var i,n,a=s.split(L,d);for(i=0;i&lt;a.&quot;
+&quot;length;i++){n=a[i];m=m||(u==1?(n==v):(n.toLowerCase()==v.toLowerCas&quot;
+&quot;e()));}}if(!m)L=L?L+d+v:v;return L&quot;);
</pre>
<p><strong><font color="red">UPDATE: In my eagerness to share this with everyone I skipped the testing process I usually do. Upon testing I realized I a critical, basic error in my logic. By doing it this way, you are setting an event prior to any of the eVars, so they would not be associated with each other, and there for show up as &#8220;None&#8221; in your report. It is such a simple oversight that I am actually embarrassed that I missed. So now I throw it out to you, the Omniture community, how do you guys think we should try to figure this one out? Or is it even possible to do? Let me know what you think!</font></strong></p>
<p><strong><font color="red">Just to be super clear, this will work if you want to add visits to some of your Traffic Sources reports. For example if you want visits from the original referring domains, this will work perfectly for that.</font></strong></p>
<p>Now lets get Visits. I thought a lot about how to get this. One method you could use would be do the exact same thing we did to get the Page Views event. Set it up on a different event, then call up Omniture Client Care to have them set that event to only record once per visit. Again I wanted to try to avoid using Client Care. I also did not want to go that route since I want this to mimic the Visits metric as close as possible, so I want it to be cookie based. Here I decided to use the Get Visit Start plug-in.</p>
<p>What the <a href="http://webanalyticsland.com/plugins/Get_Visit_Start_Plugin.pdf">Get Visit Start plug-in</a> was designed to do is to determine first page of a visit. It returns 1 on the first plug-in call of the visit, otherwise returns nothing. It uses a 30 minute cookie if possible, otherwise reverts to a session cookie. Always returns nothing if 30 minute or session cookie can&#8217;t be set, so it functions very much like the standard Visit&#8217;s metric. What I have done is set the plug-in up to populate a variable, then use basic JavaScript to determine if there is a value to the variable that was just set, and if so fire off the Append List plug-in. The theory behind this is the Get Visit Start plug-in will only return a value one time per visit, on the first page view, and at that one and only time fire off a single event. </p>
<pre class="brush: jscript">
s.getVisitStart(c)
</pre>
<p>c=cookie name for tracking (&#8220;s_visit&#8221; is standard)</p>
<p>Here is how I have it set up. I made up a variable s.visEvent to hold the value of the Get Visit Start Plugin, then fire off event6 if it has a value.</p>
<pre class="brush: jscript">
/* Set Visit Event */
s.visEvent=s.getVisitStart(&quot;s_visit&quot;);
if (s.visEvent) s.events=s.apl(s.events,&#039;event6&#039;,&#039;,&#039;,1);
</pre>
<p>Here is the plug-in code:</p>
<pre class="brush: jscript">
/*
 * Get Visit Start
 */
s.getVisitStart=new Function(&quot;c&quot;,&quot;&quot;
+&quot;var s=this,v=1,t=new Date;t.setTime(t.getTime()+1800000);if(s.c_r(c&quot;
+&quot;)){v=0}if(!s.c_w(c,1,t)){s.c_w(c,1,0)}if(!s.c_r(c)){v=0}return v;&quot;);
</pre>
<p>Pretty simple. Typically I would have just used the Get Val Once plug-in when I want to get a value of a variable only once per visit, but it didn&#8217;t want to work well with the s.events variable.</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://webanalyticsland.com/sitecatalyst-implementation/how-to-add-page-views-and-visits-to-all-sitecatalyst-evars/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Three SiteCatalyst Plugins To Add Detail To Visits</title>
		<link>http://webanalyticsland.com/sitecatalyst-implementation/three-sitecatalyst-plugins-to-add-detail-to-visits/</link>
		<comments>http://webanalyticsland.com/sitecatalyst-implementation/three-sitecatalyst-plugins-to-add-detail-to-visits/#comments</comments>
		<pubDate>Mon, 13 Apr 2009 14:58:09 +0000</pubDate>
		<dc:creator>VaBeachKevin</dc:creator>
				<category><![CDATA[SiteCatalyst Implementation]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[implementation]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[omniture]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[sitecatalyst]]></category>
		<category><![CDATA[s_code.js]]></category>
		<category><![CDATA[visitors]]></category>
		<category><![CDATA[visits]]></category>

		<guid isPermaLink="false">http://webanalyticsland.com/?p=120</guid>
		<description><![CDATA[Here are three different plugins that have to do with your site visits. If you have not read it yet, be sure to check out Omniture&#8217;s Matt Belkin&#8217;s view on visits. It is one of the most important metrics to use, and here are a few plugins that will give you a little more insight [...]]]></description>
			<content:encoded><![CDATA[<p>Here are three different plugins that have to do with your site visits. If you have not read it yet, be sure to check out <a href="http://blogs.omniture.com/2006/03/24/unique-visitors-or-visits-which-metric-should-you-use/" target="_new" >Omniture&#8217;s Matt Belkin&#8217;s view on visits</a>. It is one of the most important metrics to use, and here are a few plugins that will give you a little more insight to your site&#8217;s visits.</p>
<p><strong>1. New/Repeat Visit</strong><br />
This plugin takes a look at each visit and sets the value of either &#8220;New&#8221; or &#8220;Repeat&#8221; right in a prop or eVar. One thing about this plugin is that it will set the value on every page view. One thing I recommend is to contact Client Care and have them enable visits for for the prop you plan to use with this plugin. Here is what you should get:<br />
<img src="http://webanalyticsland.com/images/new-repeat.png" alt="New/Repeat Visit Report" /></p>
<p>Here is the actual code:</p>
<pre class="brush: jscript">
s.prop1=s.getNewRepeat();

/*
 * Plugin: getNewRepeat
 */
s.getNewRepeat=new Function(&quot;&quot;
+&quot;var s=this,e=new Date(),cval,ct=e.getTime(),y=e.getYear();e.setTime&quot;
+&quot;(ct+30*24*60*60*1000);cval=s.c_r(&#039;s_nr&#039;);if(cval.length==0){s.c_w(&quot;
+&quot;&#039;s_nr&#039;,ct,e);return &#039;New&#039;;}if(cval.length!=0&amp;amp;&amp;amp;ct-cval&lt;30*60*1000){s&quot;
+&quot;.c_w(&#039;s_nr&#039;,ct,e);return &#039;New&#039;;}if(cval&lt;1123916400001){e.setTime(cv&quot;
+&quot;al+30*24*60*60*1000);s.c_w(&#039;s_nr&#039;,ct,e);return &#039;Repeat&#039;;}else retur&quot;
+&quot;n &#039;Repeat&#039;;&quot;);
</pre>
<p><strong>2. Visit Number</strong><br />
This plugin counts the number of visits that an individual visitor has. This is neat to see how users on their 9th or 10th visit interact with the site, as opposed to their 3rd or 4th visit. The report you will get with this is just a list of numbers, which you can correlate with other traffic items.</p>
<p>Here is the actual code:</p>
<pre class="brush: jscript">
s.prop2=s.getVisitNum();

/*
 * Plugin: getVisitNum
 */
s.getVisitNum=new Function(&quot;&quot;
+&quot;var s=this,e=new Date(),cval,cvisit,ct=e.getTime(),c=&#039;s_vnum&#039;,c2=&#039;s&quot;
+&quot;_invisit&#039;;e.setTime(ct+30*24*60*60*1000);cval=s.c_r(c);if(cval){var&quot;
+&quot; i=cval.indexOf(&#039;&amp;amp;vn=&#039;),str=cval.substring(i+4,cval.length),k;}cvis&quot;
+&quot;it=s.c_r(c2);if(cvisit){if(str){e.setTime(ct+30*60*1000);s.c_w(c2,&#039;&quot;
+&quot;true&#039;,e);return str;}else return &#039;unknown visit number&#039;;}else{if(st&quot;
+&quot;r){str++;k=cval.substring(0,i);e.setTime(k);s.c_w(c,k+&#039;&amp;amp;vn=&#039;+str,e)&quot;
+&quot;;e.setTime(ct+30*60*1000);s.c_w(c2,&#039;true&#039;,e);return str;}else{s.c_w&quot;
+&quot;(c,ct+30*24*60*60*1000+&#039;&amp;amp;vn=1&#039;,e);e.setTime(ct+30*60*1000);s.c_w(c2&quot;
+&quot;,&#039;true&#039;,e);return 1;}}&quot;);
</pre>
<p><strong>3. Days Since Last Visit</strong><br />
This report looks at all of your visits, and tells you how long it has been since the previous visit. As with the previous two, this is going to be set on every page of the site, so make sure you enable visits. Here is what the report would look like:<br />
<img src="http://webanalyticsland.com/images/dayssince.png" alt="Days Since Last Visit Report" /><br />
As you can see it takes each visit and categorizes each one as being First Visit, Less than 1 day, Less than 7 days, More than 7 days, and More than 30 days.</p>
<p>Here is the actual code:</p>
<pre class="brush: jscript">
s.prop3=s.getDaysSinceLastVisit(&#039;s_lv&#039;);

/*
 * Plugin: Days since last Visit
 */
s.getDaysSinceLastVisit=new Function(&quot;c&quot;,&quot;&quot;
+&quot;var s=this,e=new Date(),es=new Date(),cval,cval_s,cval_ss,ct=e.getT&quot;
+&quot;ime(),day=24*60*60*1000,f1,f2,f3,f4,f5;e.setTime(ct+3*365*day);es.s&quot;
+&quot;etTime(ct+30*60*1000);f0=&#039;Cookies Not Supported&#039;;f1=&#039;First Visit&#039;;f&quot;
+&quot;2=&#039;More than 30 days&#039;;f3=&#039;More than 7 days&#039;;f4=&#039;Less than 7 days&#039;;f&quot;
+&quot;5=&#039;Less than 1 day&#039;;cval=s.c_r(c);if(cval.length==0){s.c_w(c,ct,e);&quot;
+&quot;s.c_w(c+&#039;_s&#039;,f1,es);}else{var d=ct-cval;if(d&gt;30*60*1000){if(d&gt;30*da&quot;
+&quot;y){s.c_w(c,ct,e);s.c_w(c+&#039;_s&#039;,f2,es);}else if(d&lt;30*day+1 &amp;amp;&amp;amp; d&gt;7*day&quot;
+&quot;){s.c_w(c,ct,e);s.c_w(c+&#039;_s&#039;,f3,es);}else if(d&lt;7*day+1 &amp;amp;&amp;amp; d&gt;day){s.&quot;
+&quot;c_w(c,ct,e);s.c_w(c+&#039;_s&#039;,f4,es);}else if(d&lt;day+1){s.c_w(c,ct,e);s.c&quot;
+&quot;_w(c+&#039;_s&#039;,f5,es);}}else{s.c_w(c,ct,e);cval_ss=s.c_r(c+&#039;_s&#039;);s.c_w(c&quot;
+&quot;+&#039;_s&#039;,cval_ss,es);}}cval_s=s.c_r(c+&#039;_s&#039;);if(cval_s.length==0) retur&quot;
+&quot;n f0;else if(cval_s!=f1&amp;amp;&amp;amp;cval_s!=f2&amp;amp;&amp;amp;cval_s!=f3&amp;amp;&amp;amp;cval_s!=f4&amp;amp;&amp;amp;cval_s&quot;
+&quot;!=f5) return &#039;&#039;;else return cval_s;&quot;);
</pre>
<p>Any of these can also be used to populate an eVar, and you can use them with the getValOnce plugin to grab each value one time per visit, then you can use these in conjunction with any of your success events to give you a greater insight on your site&#8217;s visits.</p>
<p>Please consult Client Care before using any of these to see if they are a good fit for your site and what you are trying to accomplish with your analytics investment.</p>
]]></content:encoded>
			<wfw:commentRss>http://webanalyticsland.com/sitecatalyst-implementation/three-sitecatalyst-plugins-to-add-detail-to-visits/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

