<?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</title>
	<atom:link href="http://webanalyticsland.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://webanalyticsland.com</link>
	<description>Omniture SiteCatalyst Implementation Optimization.</description>
	<lastBuildDate>Thu, 19 Aug 2010 15:01:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Implement Adobe SiteCatalyst in 5 Minutes (or less!)</title>
		<link>http://webanalyticsland.com/sitecatalyst-implementation/implement-sitecatalyst-in-5-minutes/</link>
		<comments>http://webanalyticsland.com/sitecatalyst-implementation/implement-sitecatalyst-in-5-minutes/#comments</comments>
		<pubDate>Thu, 19 Aug 2010 15:01:26 +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[sitecatalyst]]></category>
		<category><![CDATA[s_code.js]]></category>
		<category><![CDATA[tracking]]></category>

		<guid isPermaLink="false">http://webanalyticsland.com/?p=378</guid>
		<description><![CDATA[One of the biggest things I always hear from people considering moving to Adobe SiteCatalyst is the fear of a difficult implementation. It feels to me that most people think they need to implement everything at once, and that is not so. You can just take baby steps and implement small sections at a time. [...]]]></description>
			<content:encoded><![CDATA[<p>One of the biggest things I always hear from people considering moving to Adobe SiteCatalyst is the fear of a difficult implementation. It feels to me that most people think they need to implement everything at once, and that is not so. You can just take baby steps and implement small sections at a time. Let&#8217;s get started with just a standard implementation to get things going. I&#8217;m going to show you how to do a basic implementation of SiteCatalyst in 5 minutes. </p>
<p>First we need to set up a new report suite from the SiteCatalyst Admin Console Report Suite Manager. That can be found by selecting <strong>Admin > Report Suites</strong>.<br />
<img src="http://webanalyticsland.com/images/5min1.gif" alt="Admin Console" /><br />
Once we are in the Report Suite Manager, select <strong>Create New > Report Suite</strong>.<br />
<img src="http://webanalyticsland.com/images/5min2.gif" alt="Create New" /><br />
This will open up the New Report Suite setup page. On this page we have two sections to deal with, the first being where we can choose what type of site we are creating the report suite for. I recommend just leaving this set at the default suite type. Since we plan of adding some neat customizations in the future as our analytics needs increase, the default will work fine for us right now.<br />
<img src="http://webanalyticsland.com/images/5min3.gif" alt="Suite Type" /><br />
Next on this page we have five items that need to be filled in. They are all marked with red stars, with the most important being the first one, Report Suite ID. Why is this the most important? Because it the only one we cannot change later. I recommend it should be something you can easily understand what it means. If your site is apple.com then I would just simply choose <strong>apple</strong> and not something cryptic like <strong>89e7rghv9e7gh</strong> (yes I have seen that done before). It actually doesn&#8217;t matter what you choose (in case you had your heart set on using 89e7rghv9e7gh), anything will work, but choosing something simple may save some headaches in the future. The Site Title is what you want it to be referred to by in the SiteCatalyst interface, Time Zone is your time zone, Go Live Date is when the site is expected to launch (it must be a date in the future), and Estimated Page Views per Day is just what it says. This number is used by the Adobe engineers to determine what resources to dedicate to your site to ensure everything is recorded correctly. Remember any of these items (except Report Suite ID) can be changed later if you need to. There are other things listed here and you can fill them out or change them if you would like, they are not required in setting up the report suite. Fill out the five required fields, click submit and the report suite is created.<br />
<img src="http://webanalyticsland.com/images/5min4.gif" alt="Configure Suite" /><br />
There are some additional things we need to set up before we start with the actual data collection code. Head back to the Report Suite Manager and find you new suite in the list. Click it to highlight it and then mouse over the Edit Settings link. This will bring up a list of additional settings we can adjust. Remember this section. Later when you get more advanced with your SiteCatalyst data collection, this is where you will go to turn on and off variables for more advanced tracking. There are only two items we need to touch right now, and are going to be located under <strong>General</strong>. </p>
<p>Under Internal URL Filters you need to set what the domain of your site is. On every single page view there is a referrer. When your visitors go from your home page to your about us page, the referrer to that page is the home page. You do not want that showing up in your referrer reports, so this is where you list out the domain names that you do not want included in those reports. <strong>Quick tip:</strong> If your site is www.homes.com, and you enter <strong>homes.com</strong> in the URL filter, it will also filter out sites that have that name included in it, for example newhomes.com or cheaphomes.com. Add a period to the front of the domain name to make sure that only your site is filtered, <strong>.homes.com</strong>. You can also enter the subdomain with the URL in the filter if your site only lives at a single subdomain, or you can list all of them in the filter.<br />
<img src="http://webanalyticsland.com/images/5min5.gif" alt="Internal URL FIlter" /></p>
<p>Next you want to hit the Paid Search Detection. In here you need to set up a query sting parameter that will be used for your paid search. Even if you do not plan on doing paid search fill this out any way. It is important in making sure your Search Engine and Search Keywords reports work properly.<br />
<img src="http://webanalyticsland.com/images/5min6.gif" alt="Configure Suite" /></p>
<p>We created our report suite, filled out a handful of variables and we are now ready to start playing with the actual collection code. From the Admin Console Home you can find a direct link to the Code Manager, or you can find it from the navigation menu on the left.<br />
<img src="http://webanalyticsland.com/images/5min7.gif" alt="Admin Console Home" /></p>
<p>In the Code Manger we can generate all types of code for what ever we decide to track. From mobile phone apps to flash video players, all the collection code is here. We just want to generate the simple JavaScript Tracking code. Nothing fancy. Select your report suite, set your character encoding or your currency type and click <strong>Generate Code</strong>. You will get a little pop up warning you to make sure you know what you are doing or the world will end. Just click OK and move on.<br />
<img src="http://webanalyticsland.com/images/5min8.gif" alt="Code Manager" /></p>
<p>Your code is generated now. Take the contents that are under the <strong>Core Javascript File</strong> tab and save them in a file that you name <strong>s_code.js</strong>. Take that file and upload it to your web server where it can be accessed from every page of the site.<br />
<img src="http://webanalyticsland.com/images/5min9.gif" alt="Code Manager" /><br />
 Now take the contents under the <strong>Page Code</strong> tab and paste that to every page of your site, right before the closing body tag. In that code you will see the place marked <strong>INSERT-DOMAIN-AND-PATH-TO-CODE-HERE</strong>. In this position enter the path to the s_code.js file that you previously uploaded. </p>
<p>That&#8217;s all there is to it. This should be easily to be accomplished in 5 minutes or less. We setup the report suite, generated the page code and the s_code and added them to the site. This will give us the basic recording of the site traffic, referrals and visitor information. After this is up and running we can go back and add in some additional elements to the s_code file and the page code to customize your SiteCatalyst implementation to your specific site.</p>
<p>Enjoy!</p>
<img src="http://webanalyticsland.com/?ak_action=api_record_view&id=378&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://webanalyticsland.com/sitecatalyst-implementation/implement-sitecatalyst-in-5-minutes/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Google Indexes Omniture SiteCatalyst Tracking codes</title>
		<link>http://webanalyticsland.com/sitecatalyst-implementation/google-indexes-omniture-sitecatalyst-tracking-codes/</link>
		<comments>http://webanalyticsland.com/sitecatalyst-implementation/google-indexes-omniture-sitecatalyst-tracking-codes/#comments</comments>
		<pubDate>Wed, 02 Jun 2010 16:40:19 +0000</pubDate>
		<dc:creator>VaBeachKevin</dc:creator>
				<category><![CDATA[SiteCatalyst Implementation]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[tracking code]]></category>
		<category><![CDATA[webmaster tools]]></category>

		<guid isPermaLink="false">http://webanalyticsland.com/?p=368</guid>
		<description><![CDATA[Tracking codes are an important part of Web Analytics. They are used by every single analytics tool. I recently came across a problem with how Google handles these tracking codes. Here is what I have set up. We run the site RV Trader. The site lives at rvtraderonline.com. We also own the domain rvtrader.com, which [...]]]></description>
			<content:encoded><![CDATA[<p>Tracking codes are an important part of Web Analytics. They are used by every single analytics tool. I recently came across a problem with how Google handles these tracking codes.</p>
<p>Here is what I have set up. We run the site RV Trader. The site lives at rvtraderonline.com. We also own the domain rvtrader.com, which we have set up with a 301 redirect to rvtraderonline.com. Recently we wanted to know how many visitors were accessing our site by going to rvtrader.com and being redirected to our main site. What I did was set up a tracking code on the redirected URL, using the query string parameter ?zmc=rvt. Now whenever anyone lands on the url rvtraderonline.com with that tracking code I will know 100% that they came from rvtrader.com since this is the only place where this tracking code exists. Pretty simple stuff.</p>
<p>I have been using ?zmc= for a long time now, and have it set in Google Webmaster Tools to ignore this parameter. For those who don&#8217;t know, there is a place in Webmaster Tools where you can tell Google what tracking codes that they should ignore. I have it set up to tell Google that it should not index any query string parameters that contain ?zmc=. I just double checked it and I do see that it is still there.<br />
<img src="http://webanalyticsland.com/images/wmt-2.png" alt="Google Webmaster Tools" width="95%" /></p>
<p>Then today we take a look in Google and what do I see:<br />
<img src="http://webanalyticsland.com/images/wmt-1.png" alt="Google Indexing Tracking Codes" width="95%" /></p>
<p>How many of my other tracking codes have been indexed? Can I trust the reporting of any of my Omniture SiteCatalyst tracking code reports now? How many other analystics customers are going to have this problem? Is Google indexing tracking codes from any other Web Analytics tools? </p>
<p>If you are noticing any abnormalities in your tracking code reporting this may be why.</p>
<img src="http://webanalyticsland.com/?ak_action=api_record_view&id=368&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://webanalyticsland.com/sitecatalyst-implementation/google-indexes-omniture-sitecatalyst-tracking-codes/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>4 Cool Features of Omniture SiteCatalyst 14.7</title>
		<link>http://webanalyticsland.com/sitecatalyst-implementation/4-cool-features-of-omniture-sitecatalyst-14-7/</link>
		<comments>http://webanalyticsland.com/sitecatalyst-implementation/4-cool-features-of-omniture-sitecatalyst-14-7/#comments</comments>
		<pubDate>Thu, 08 Apr 2010 22:41:33 +0000</pubDate>
		<dc:creator>VaBeachKevin</dc:creator>
				<category><![CDATA[SiteCatalyst Implementation]]></category>
		<category><![CDATA[omniture]]></category>
		<category><![CDATA[sitecatalyst]]></category>

		<guid isPermaLink="false">http://webanalyticsland.com/?p=347</guid>
		<description><![CDATA[Today Omniture released the 14.7 version of their analytics platform SiteCatalyst. While most of the excitement will be over the new Dashboard functionality, here are a 4 other new items that I really like. Trend by day of week The ability to trend by day of week is a really nice addition. When looking at [...]]]></description>
			<content:encoded><![CDATA[<p>Today Omniture released the 14.7 version of their analytics platform SiteCatalyst. While most of the excitement will be over the new Dashboard functionality, here are a 4 other new items that I really like.</p>
<p><strong>Trend by day of week</strong><br />
 The ability to trend by day of week is a really nice addition. When looking at a report if you trend it over time you will see in the report option&#8217;s section a drop down to choose a day. You now have a very easy way to monitor your conversions and custom traffic metrics by any day of the week.<br />
<img src="http://webanalyticsland.com/images/147-c.png" alt="Day of Week" /></p>
<p><strong>New User Welcome Email</strong><br />
When setting up a new user you now have the ability to send them a welcome email. This email can include things like their login information, and who to contact in your organization for support. I have found this to be extremely useful.<br />
<img src="http://webanalyticsland.com/images/147-b.png" alt="Welcome Email" /></p>
<p><strong>New User Default Dashboards</strong><br />
While you are still setting up that new user, you now have the option to set them up with a default dashboard. If your organization already has one created that you would like everyone to use, you can set their account up with it right when you create their login.<br />
<img src="http://webanalyticsland.com/images/147-a.png" alt="Default Dashboards" /></p>
<p><strong>Transfer User Settings</strong><br />
When someone leaves your organization and they have a lot of dashboards and scheduled reports, if you want to keep these items meant having to keep their account around as well. Not anymore. Now you will notice another option to the main user list screen, the ability to Transfer.<br />
<img src="http://webanalyticsland.com/images/147-e.png" alt="Transfer" /><br />
Now before deleting a user account you can transfer all of their dashboards and scheduled reports to another user.<br />
<img src="http://webanalyticsland.com/images/147-d.png" alt="Transfer" /></p>
<p>Other features of the 14.7 release include Percentage Graphs in report tables, alerts on classifications, and the ability to duplicate report suite settings. Oh yeah, and those sexy new dashboards.</p>
<p> <img src='http://webanalyticsland.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  Enjoy!</p>
<img src="http://webanalyticsland.com/?ak_action=api_record_view&id=347&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://webanalyticsland.com/sitecatalyst-implementation/4-cool-features-of-omniture-sitecatalyst-14-7/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Getting Started With the Omniture PHP Measurement Library</title>
		<link>http://webanalyticsland.com/sitecatalyst-implementation/omniture-php-measurement-library/</link>
		<comments>http://webanalyticsland.com/sitecatalyst-implementation/omniture-php-measurement-library/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 14:34:41 +0000</pubDate>
		<dc:creator>VaBeachKevin</dc:creator>
				<category><![CDATA[SiteCatalyst Implementation]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[implementation]]></category>
		<category><![CDATA[omniture]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[sitecatalyst]]></category>
		<category><![CDATA[tracking]]></category>

		<guid isPermaLink="false">http://webanalyticsland.com/?p=317</guid>
		<description><![CDATA[The Omniture PHP Measurement Library lets you use PHP to record your visitor&#8217;s activity on your Web site. At first glance it can look a little intimidating, but it really is not that complicated. Once you have it implemented, all that you will see in the source code of your pages is the image request [...]]]></description>
			<content:encoded><![CDATA[<p>The Omniture PHP Measurement Library lets you use PHP to record your visitor&#8217;s activity on your Web site. At first glance it can look a little intimidating, but it really is not that complicated. Once you have it implemented, all that you will see in the source code of your pages is the image request for the standard Omniture tracking pixel. <a target="_new" href="http://webanalyticsland.com/demo1.php">This is what it looks like implemented</a>. </p>
<p>Here is how to get started with it. From the Code Manager, download the <strong>OmnitureMeasurement.class.php</strong> file and add it to your server in a place so it can be referenced from every page of your site. Next you will need to include the Omniture PHP code on every page of your site.</p>
<p>Here is what a basic version of the PHP page code would look like:</p>
<pre class="brush: php">
&lt;?php
require_once &#039;OmnitureMeasurement.class.php&#039;;
$s = new OmnitureMeasurement();
$s-&gt;account = &#039;ACCOUNT NAME HERE&#039;;
$s-&gt;botDetection = true;

$s-&gt;pageName = &quot;Homepage&quot;;
$s-&gt;server = &quot;Server&quot;;
$s-&gt;channel = &quot;Channel&quot;;

$s-&gt;events = &quot;events&quot;;
$s-&gt;prop1 = &quot;prop1&quot;;
$s-&gt;prop2 = &quot;prop2&quot;;
$s-&gt;eVar1 = &quot;eVar1&quot;;
$s-&gt;eVar2 = &quot;eVar2&quot;;

$s-&gt;currencyCode = &#039;USD&#039;;
$s-&gt;imageDimensions = &#039;5x5&#039;;
$s-&gt;trackingServer = &#039;dominionenterprises.112.2o7.net&#039;;
$s-&gt;sendFromServer = false;
$s-&gt;debugTracking = false;
$s-&gt;track();
?&gt;
</pre>
<p>Lets break it down by section so you will see what is going on here. Here is the first section of the code:</p>
<pre class="brush: php">
&lt;?php
require_once &#039;OmnitureMeasurement.class.php&#039;;
$s = new OmnitureMeasurement();
$s-&gt;account = &#039;ACCOUNT NAME HERE&#039;;
$s-&gt;botDetection = true;
</pre>
<p>The first thing we have here is the call to the Omniture Measurement class <strong>require_once &#8216;OmnitureMeasurement.class.php&#8217;;</strong>. This is what makes the Omniture PHP tracking work. As I said you can download it from the Admin section of SiteCatalyst. That is followed by a line of code that will get the tracking started <strong>$s = new OmnitureMeasurement();</strong>. Next is the place where you enter the report suite id that is associated with the site you plan on tracking. Finally we have a line to detect bots. When this is set to <strong>true</strong>, the Measurement Library detects if the HTTP User-Agent field is a bot, and does not send bot-generated data to Omniture. If this is not included it is set to false by default. If you decide to not include that, then be prepared to see Googlebot show up in your reporting.<br />
<img src="http://webanalyticsland.com/images/user-agent.jpg" alt="Googlebot User Agent" /></p>
<pre class="brush: php">
$s-&gt;pageName = &quot;Homepage&quot;;
$s-&gt;server = &quot;Server&quot;;
$s-&gt;channel = &quot;Channel&quot;;
</pre>
<p>This next section should be pretty self explanatory. This is where I set the pageName, the server, and the channel variables. On my 404 error page this is where I also include the pageType variable, which would look like <strong>$s->pageType=&#8221;errorPage&#8221;;</strong>. </p>
<p><strong>EXTRA:</strong><em> For a lot of my sites I like to use the folder name of the URL as the page name. Here is how you can do that using PHP. I insert this code before the Omniture tracking section:</em></p>
<pre class="brush: php">
&lt;?php
$pNme = parse_url($url, PHP_URL_PATH);
if ($pNme==&quot;/&quot;)$pNme = &quot;Home Page&quot;;
?&gt;
</pre>
<p><em>Then in the measurement library code I include:</em></p>
<pre class="brush: php">
$s-&gt;pageName = $pNme;
</pre>
<p><em>This pulls the file name from the URL and uses that as the page name. I also added a line that looks if all it finds is a slash / then I know they are on the Home Page and use that instead.</em></p>
<pre class="brush: php">
$s-&gt;events = &quot;events&quot;;
$s-&gt;prop1 = &quot;prop1&quot;;
$s-&gt;prop2 = &quot;prop2&quot;;
$s-&gt;eVar1 = &quot;eVar1&quot;;
$s-&gt;eVar2 = &quot;eVar2&quot;;
</pre>
<p>This next section is where we are going to add the Custom Traffic variables, Custom Conversion variables, and Success Events. Again, this section should be pretty straight forward. If you know how to set props and eVars on the page and in the s_code file, you should know what to do here.</p>
<pre class="brush: php">
$s-&gt;currencyCode = &#039;USD&#039;;
$s-&gt;debugTracking = false;
$s-&gt;imageDimensions = &#039;5x5&#039;;
$s-&gt;trackingServer = &#039;112.2o7.net&#039;;
$s-&gt;sendFromServer = false;
$s-&gt;debugTracking = false;
$s-&gt;track();
</pre>
<p>This final section contains some pretty important elements. The first thing you will see is where you declare the Currency Code used for purchases or currency events. You can see I have mine set to US currency, USD. Next I have the call that specifies the width and height of the image request, in pixels. By default, this variable is 1&#215;1. You can see I have mine changed to 5&#215;5 to ensure support for all mobile devices. Next I enter my tracking server info. You should be able to find that in your s_code.js file.</p>
<p>The next two lines are pretty cool. Let&#8217;s say you do not to show any Omniture code on the page. You have the option to not have any thing appear in the source code. When <strong>$s->sendFromServer</strong> is set to true, the Measurement Library makes a direct HTTP request from the server instead of rendering an image tag to the Web browser. If you view the source of the page you will not see anything but the visitor will still be fully tracked. <a target="_new" href="http://webanalyticsland.com/demo2.php">You can see a live example of it here.</a></p>
<p>Without any code on the page it can be difficult to debug the code to make sure everything is being passed in successfully. That&#8217;s where the next variable comes in, <strong>$s->debugTracking</strong>. With this set to false then we do not see anything. If it is set to true then you will see an output on the page of the metrics that are being passed into Omniture. <a target="_new" href="http://webanalyticsland.com/demo3.php">You can see a live example of it here.</a></p>
<p>The problem with that is you either have it off all the time, or you have it on where all of your visitors can see a bunch of code on the page. What I like to do is to add in a little bit of extra code that will only allow the debug code to appear only for me. I do this based off of my ip address. I include this bit of code before the Omniture code:</p>
<pre class="brush: php">
$ip=$_SERVER[&#039;REMOTE_ADDR&#039;];
if ($ip==&quot;xxx.xxx.xx.xxx&quot;) {
	$atHome = true;
} else {
	$atHome = false;
}
</pre>
<p>And then In the Omniture code I have it set as:</p>
<pre class="brush: php">
$s-&gt;debugTracking = $atHome;
</pre>
<p>What this does is allows me to see the variables that are being set every time I visit the site, but none of my visitors have to see it.</p>
<p>The last thing you will see listed in this section is <strong>$s->track();</strong> which is the call to fire off the code. Without this nothing works. This is the equivalent of having the line <strong>var s_code=s.t();if(s_code)document.write(s_code)</strong> in the standard JavaScript tracking. In other words, make sure you include this line.</p>
<p>OK, what else can we do with this? Well as many people know I am a big fan of using plug-ins. Here is one to get you started. One of the more useful ones is the Time Parting plug-in. <a href="http://webanalyticsland.com/sitecatalyst-implementation/time-parting-granularity-using-saint/">As I have written about before</a>, I like combining all of the time variables so I only use a single prop/eVar, so it looks something like <strong>s.prop1=&#8221;thursday|10:00pm&#8221;</strong> and then using a SAINT classification to break it out. How do we replicate this using the PHP Library? Here you go.</p>
<p>Above the Omniture Measurement code I include this:</p>
<pre class="brush: php">
$dayname = date(&#039;l&#039;);
$dayname = strtolower($dayname);
$hourname = date(&#039;g&#039;);
$minname = date(&#039;i&#039;);
$ampmname = date(&#039;a&#039;); 

if ($minname &lt;= &quot;14&quot;) {
	$mintype = &quot;00&quot;;
} else if ($minname &gt;= &quot;15&quot; &amp;&amp; $minname &lt;= &quot;29&quot;){
	$mintype = &quot;15&quot;;
} else if ($minname &gt;= &quot;30&quot; &amp;&amp; $minname &lt;= &quot;44&quot;){
	$mintype = &quot;30&quot;;
} else if ($minname &gt;= &quot;45&quot; &amp;&amp; $minname &lt;= &quot;59&quot;){
	$mintype = &quot;45&quot;;
}
$fulldayparting = &quot;$dayname|$hourname:$mintype$ampmname&quot;;
</pre>
<p>Then in one of the available props in the code I have:</p>
<pre class="brush: php">
$s-&gt;prop16 = $fulldayparting;
</pre>
<p>This returns something like <strong>thursday|10:00pm</strong>, exactly like the Javascript plug-in does. I also like to copy this same value to an eVar, but I only want to do it once per visit. I like using the eVar for when the visit started, and the prop for every page view. Here is how I get that same value recorded only once per visit. </p>
<p>At the top of all my &#8216;extra&#8217; code that I have included before the Omniture measurement code, I include this:</p>
<pre class="brush: php">
$sesionnumber = $_SESSION[&#039;count&#039;];
if ($sesionnumber == &#039;1&#039;) {
     $fulldaypartingsession = $fulldayparting;
} else {
     $fulldaypartingsession = &#039;&#039;;
}
</pre>
<p>And then with the available eVars I include:</p>
<pre class="brush: php">
$s-&gt;eVar16 = $fulldaypartingsession;
</pre>
<p>What this does is on the first page of the session it will set the Time Parting value, but will just leave it blank for the rest of the session giving you a good session start time.</p>
<p>Hopefully this is enough to get you started. There are a lot of other cool PHP tricks that will allow you to replicate most of the functions of the Javascript tracking. Make sure you download and read the <strong>PHP Measurement Library Implementation Guide</strong> from the Omniture Help Section for additional details. </p>
<p>Enjoy!</p>
<img src="http://webanalyticsland.com/?ak_action=api_record_view&id=317&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://webanalyticsland.com/sitecatalyst-implementation/omniture-php-measurement-library/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Track Hash Query Parameters in Omniture SiteCatalyst</title>
		<link>http://webanalyticsland.com/sitecatalyst-implementation/track-hash-query-parameters/</link>
		<comments>http://webanalyticsland.com/sitecatalyst-implementation/track-hash-query-parameters/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 04:50:13 +0000</pubDate>
		<dc:creator>VaBeachKevin</dc:creator>
				<category><![CDATA[SiteCatalyst Implementation]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[getqueryparam]]></category>
		<category><![CDATA[hash]]></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[tracking]]></category>

		<guid isPermaLink="false">http://webanalyticsland.com/?p=320</guid>
		<description><![CDATA[Do you have a site that uses a hash symbol in the URL with query parameters and you want a way to track them in SiteCatalyst? Well you have come to the right place. What am I talking about? Lets say you have a URL that looks like this: http://webanalyticsland.com/#cid=Hash_Param_Test and you want to capture [...]]]></description>
			<content:encoded><![CDATA[<p>Do you have a site that uses a hash symbol in the URL with query parameters and you want a way to track them in SiteCatalyst? Well you have come to the right place. </p>
<p>What am I talking about? Lets say you have a URL that looks like this:<br />
<a href="http://webanalyticsland.com/#cid=Hash_Param_Test">http://webanalyticsland.com/#cid=Hash_Param_Test</a><br />
and you want to capture the value of <strong>cid=</strong>. The standard getQueryParam plugin will not work in this case. It looks for a question mark in the URL, and as you can see this one did not have one.  </p>
<p>To capture this value we can use the <strong>getHashQueryParam</strong> s_code.js plug-in. What this plug-in does is looks for the hash symbol <strong>#</strong> at the end of the URL, then looks for the parameter you have listed in the function, then inserts the value in to the associated variable. This works just like the standard getQueryParam plugin, but looks for the hash instead.</p>
<p>Here&#8217;s how to use it. Insert this line of code in the s_doPlugins(s) section of your s_code.js file. Make sure you use the correct variable you want the metrics recorded in and which query string you want it to be associated with. I&#8217;m using <strong>s.prop17</strong> and <strong>cid</strong> in this example.</p>
<pre class="brush: jscript">
s.prop17=getHashQueryParam(&#039;cid&#039;);
</pre>
<p>Next enter this code in the plug-in&#8217;s section of your s_code file:</p>
<pre class="brush: jscript">
/*
 * Plugin: getHashQueryParam
 */
function getHashQueryParam(a){
var QueryString=window.location.search.substring(1);
if(QueryString==&#039;&#039;){var WinExtra=window.location.hash;
if(WinExtra.length &gt; 0){if(WinExtra.indexOf(a)&gt;-1){
QueryString=WinExtra.substr(WinExtra.indexOf(a))}}}
var returnValue=&#039;&#039;;var keyValPairs=QueryString.split(&#039;&amp;&#039;);
if(!keyValPairs){ keyValPairs = new Array();
keyValPairs[keyValPairs.length]=QueryString}
for(var counter=0;counter&lt;keyValPairs.length;counter++){
var keyVal=keyValPairs[counter].split(&#039;=&#039;);if(keyVal[0]==a){
returnValue=keyVal[1];break;}}return returnValue;}
</pre>
<p><a href="http://webanalyticsland.com/#cid=Hash_Param_Test">Here is an example of it live in action.</a> After you click on the link, open the debugger you will see the value entered in s.prop17.</p>
<p>Enjoy!</p>
<img src="http://webanalyticsland.com/?ak_action=api_record_view&id=320&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://webanalyticsland.com/sitecatalyst-implementation/track-hash-query-parameters/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Don&#8217;t Forget Your SiteCatalyst Utility Functions!</title>
		<link>http://webanalyticsland.com/sitecatalyst-implementation/sitecatalyst-utility-functions/</link>
		<comments>http://webanalyticsland.com/sitecatalyst-implementation/sitecatalyst-utility-functions/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 15:56:48 +0000</pubDate>
		<dc:creator>VaBeachKevin</dc:creator>
				<category><![CDATA[SiteCatalyst Implementation]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[enhancements]]></category>
		<category><![CDATA[implementation]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[sitecatalyst]]></category>
		<category><![CDATA[s_code.js]]></category>

		<guid isPermaLink="false">http://webanalyticsland.com/?p=314</guid>
		<description><![CDATA[Have you ever tried to use a new plug-in and found it did not work? You were probably missing a utility function. Utility functions are designed to work with SiteCatalyst plug-ins. There are 6 utility functions that are commonly used. They are apl, p_c, p_gh, split, replace, and join. These functions do things like join [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever tried to use a new plug-in and found it did not work? You were probably missing a utility function. Utility functions are designed to work with SiteCatalyst plug-ins. There are 6 utility functions that are commonly used. They are <strong>apl</strong>, <strong>p_c</strong>, <strong>p_gh</strong>, <strong>split</strong>, <strong>replace</strong>, and <strong>join</strong>.</p>
<p>These functions do things like join elements of an array into a string delimiter by a string, replaces characters in a string, splits a string on a specific character, append a value to any delimited lists, and more. THese utility functions are referenced by several standard plug-ins.</p>
<p>Here&#8217;s how I do it. I take all these utility functions and wrap them all up in one neat package, and include this as one of my standard plug-ins to add when creating a s_code file. This way not thing is missed, nothing is forgotten and all of my plug-ins will work no problem.</p>
<p>Here&#8217;s what it looks like:</p>
<pre class="brush: jscript">
/*
 * Utility Functions: apl, p_c, p_gh, split, replace, join
 */
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;);
s.p_c=new Function(&quot;v&quot;,&quot;c&quot;,&quot;&quot;
+&quot;var x=v.indexOf(&#039;=&#039;);return c.toLowerCase()==v.substring(0,x&lt;0?v.le&quot;
+&quot;ngth:x).toLowerCase()?v:0&quot;);
s.p_gh=new Function(&quot;&quot;
+&quot;var s=this;if(!s.eo&amp;&amp;!s.lnk)return &#039;&#039;;var o=s.eo?s.eo:s.lnk,y=s.ot(&quot;
+&quot;o),n=s.oid(o),x=o.s_oidt;if(s.eo&amp;&amp;o==s.eo){while(o&amp;&amp;!n&amp;&amp;y!=&#039;BODY&#039;){&quot;
+&quot;o=o.parentElement?o.parentElement:o.parentNode;if(!o)return &#039;&#039;;y=s.&quot;
+&quot;ot(o);n=s.oid(o);x=o.s_oidt}}return o.href?o.href:&#039;&#039;;&quot;);
s.split=new Function(&quot;l&quot;,&quot;d&quot;,&quot;&quot;
+&quot;var i,x=0,a=new Array;while(l){i=l.indexOf(d);i=i&gt;-1?i:l.length;a[x&quot;
+&quot;++]=l.substring(0,i);l=l.substring(i+d.length);}return a&quot;);
s.repl=new Function(&quot;x&quot;,&quot;o&quot;,&quot;n&quot;,&quot;&quot;
+&quot;var i=x.indexOf(o),l=n.length;while(x&amp;&amp;i&gt;=0){x=x.substring(0,i)+n+x.&quot;
+&quot;substring(i+o.length);i=x.indexOf(o,i+l)}return x&quot;);
s.join = new Function(&quot;v&quot;,&quot;p&quot;,&quot;&quot;
+&quot;var s = this;var f,b,d,w;if(p){f=p.front?p.front:&#039;&#039;;b=p.back?p.back&quot;
+&quot;:&#039;&#039;;d=p.delim?p.delim:&#039;&#039;;w=p.wrap?p.wrap:&#039;&#039;;}var str=&#039;&#039;;for(var x=0&quot;
+&quot;;x&lt;v.length;x++){if(typeof(v[x])==&#039;object&#039; )str+=s.join( v[x],p);el&quot;
+&quot;se str+=w+v[x]+w;if(x&lt;v.length-1)str+=d;}return f+str+b;&quot;);
</pre>
<p>I just make sure that is block is included in every s_code file. Then I am assured that every plug-in I use can find the correct utility function it needs to work properly.</p>
<p>Enjoy!</p>
<img src="http://webanalyticsland.com/?ak_action=api_record_view&id=314&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://webanalyticsland.com/sitecatalyst-implementation/sitecatalyst-utility-functions/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Optimize the Time Parting Plugin to get More Detail and Use Less Variables</title>
		<link>http://webanalyticsland.com/sitecatalyst-implementation/time-parting-granularity-using-saint/</link>
		<comments>http://webanalyticsland.com/sitecatalyst-implementation/time-parting-granularity-using-saint/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 21:12:32 +0000</pubDate>
		<dc:creator>VaBeachKevin</dc:creator>
				<category><![CDATA[SiteCatalyst Implementation]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[day parting]]></category>
		<category><![CDATA[enhancements]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[omniture]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[time parting]]></category>
		<category><![CDATA[tracking]]></category>

		<guid isPermaLink="false">http://webanalyticsland.com/?p=269</guid>
		<description><![CDATA[The Time Parting Plug-in is one of the more popular SiteCatalyst plug-ins available. A standard implementation of the Time Parting plug-in will consume 3 variables. One for Time of Day, one for the Day of Week, and one for Weekday/Weekend. How can we improve this to get more information, and more importantly use less variables? [...]]]></description>
			<content:encoded><![CDATA[<p>The Time Parting Plug-in is one of the more popular SiteCatalyst plug-ins available. A standard implementation of the <a href="http://webanalyticsland.com/sitecatalyst-implementation/dayparting-plugin-in-sitecatalyst/">Time Parting plug-in</a> will consume 3 variables. One for <strong>Time of Day</strong>, one for the <strong>Day of Week</strong>, and one for <strong>Weekday/Weekend</strong>. How can we improve this to get more information, and more importantly use less variables? Here is how I have been doing it.</p>
<p>I use a combination of stacking the variables and SAINT uploads. For those of you who are not familiar with SAINT, Omniture describes it as, <em>&#8220;&#8230;an acronym for SiteCatalyst Attribute Importing and Naming Tool. This tool enables you to download the classifications template, apply attributes to it, and then upload the data, thereby enhancing your SiteCatalyst reports with the new attributes.&#8221;</em> This will allow us to upload a lot of detail about any variable you record.</p>
<p>Here&#8217;s how I&#8217;m doing it on this site. First I am using the 2.0 version of the plug-in and not the 1.4 version that I describe in a <a href="http://webanalyticsland.com/sitecatalyst-implementation/dayparting-plugin-in-sitecatalyst/">previous post</a>. The 2.0 version includes support for Daylight Savings time and globalizes the year. You can find the 2.0 version from the SiteCatalyst Knowledge Base. If you prefer to use the 1.4 version, you can find it on this site.</p>
<pre class="brush: jscript">
/* Set Time Parting Variables */
s_hour=s.getTimeParting(&#039;h&#039;,&#039;-5&#039;);
s_day=s.getTimeParting(&#039;d&#039;,&#039;-5&#039;);
s_timepart=s_day+&quot;|&quot;+s_hour;
s.prop16=s_timepart.toLowerCase();
if (s.visEvent) s.eVar16=s.prop16;
</pre>
<p>Ok, let me explain whats going on here. As I said before the Time Parting plug-in captures 3 variables. If you notice in my code I am only using two of them. I don&#8217;t need to capture Weekday/Weekend anymore. I will take care of that later. The other two, I capture in two blank variables I created, s_day and s_hour. Next I combine the two of them in a single variable I call s_timepart, separated by a pipe. Then to ensure everything is consistent I copy the variable in all lower case to the prop that I am going to use. This next part is a little different. In the eVar I only want capture this value once per visit. Typically a simple getValOnce will be enough to get it done. Well then what happens when the visit extends from one time part into another? In that situation the Time Parting value will be different and therefore getValOnce will capture this as a new value since it has changed. I don&#8217;t want that to happen, I only want it once per visit. So this is when I tie in using the <a href="http://webanalyticsland.com/plugins/Get_Visit_Start_Plugin.pdf">get Visit Start</a> plug-in. This guarantees I will only capture the value only one time per visit.</p>
<p>This will return a report that looks like this:<br />
<img src="http://webanalyticsland.com/images/time-parting.jpg" alt="Time Parting Report in SiteCatalyst" /></p>
<p>We now have a total of 672 possible options in this report. The next thing we want to do is to classify these using SAINT. I set up 5 different categories to use. Weekday/Weekend (this is why we don&#8217;t need to capture it in the code, Day of Week, Hour of Day, Hour Part and AM/PM.<br />
<img src="http://webanalyticsland.com/images/saint-setup.png" alt="SAINT Setup" /></p>
<p>I then created the template to use that contains all of these values.<br />
<img src="http://webanalyticsland.com/images/time-parting-saint-template.png" alt="SAINT Template" /><br />
<a href="http://webanalyticsland.com/dayparting-saint.txt">You can download a copy of the template that I use here.</a><br />
Upload the template and that&#8217;s all there is to it. Do you have more conversions in the bottom of the hour or the top of the hour? How about morning vs afternoon? Which whole hour is the most profitable? Now you have an easy way to break down your time parting with finer granularity, at the sime time saving your self a couple of variables.</p>
<p>Enjoy! </p>
<img src="http://webanalyticsland.com/?ak_action=api_record_view&id=269&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://webanalyticsland.com/sitecatalyst-implementation/time-parting-granularity-using-saint/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Track Your Visitors Copied Text With SiteCatalyst Plug-in</title>
		<link>http://webanalyticsland.com/sitecatalyst-implementation/track-copied-text-plugin/</link>
		<comments>http://webanalyticsland.com/sitecatalyst-implementation/track-copied-text-plugin/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 11:00:56 +0000</pubDate>
		<dc:creator>VaBeachKevin</dc:creator>
				<category><![CDATA[SiteCatalyst Implementation]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[enhancements]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[omniture]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[s_code.js]]></category>
		<category><![CDATA[visitors]]></category>

		<guid isPermaLink="false">http://webanalyticsland.com/?p=295</guid>
		<description><![CDATA[To me Web Analytics is the science of analyzing visitor behavior in order to improve the Web Site for the purpose of increasing conversion. Anytime I can use web analytics to help the visitor find what they are looking for, I feel I&#8217;m doing my job. But lets say your visitors are finding what they [...]]]></description>
			<content:encoded><![CDATA[<p>To me Web Analytics is the science of analyzing visitor behavior in order to improve the Web Site for the purpose of increasing conversion. Anytime I can use web analytics to help the visitor find what they are looking for, I feel I&#8217;m doing my job. But lets say your visitors are finding what they are looking for, but it is just not as easy as it could be? How would I know?</p>
<p>One thing I have been playing with is to monitor what content my visitors are selecting and copying from the site. If I see a lot of visitors copying my email address, maybe I should make the contact form a little easier to be found. If I see a lot of copying of some sample code, maybe I should make it easier to download it, or include a pdf copy. But how do I find out how to capture what my visitors copy? Here you go. </p>
<p>This is all done by adding a plug-in and a bit of code to the s_code file. This code looks for any time some text is copied and sets it in a prop and fires an event. This will work if the visitor highlights text and goes the right click/copy route, or by hitting Control/Command + C. You will need either 1 eVar and 1 event, or a 1 prop to use. If you want to go the eVar and event route, take this code and place it some where BEFORE the <strong>function s_doPlugins(s)</strong> call: </p>
<pre class="brush: jscript">
var eventAttached=false;
if(!eventAttached){eventAttached = true;
function trackCopy(){
var overrides = {&#039;events&#039;:&#039;event8&#039;,&#039;eVar18&#039;:getCopiedText()};
	s.templtv=s.linkTrackVars;
	s.templte=s.linkTrackEvents;
   	s.linkTrackVars=&#039;eVar18,events&#039;;
	s.linkTrackEvents=s.events=&#039;event8&#039;;
	s.tl(true, &#039;o&#039;, &#039;Text Copied&#039;, overrides);
	if(s.templtv) s.linkTrackVars=s.templtv;
	if(s.templte) s.linkTrackEvents=s.templte;
}
</pre>
<p>Insert the eVar and event you are going to use where you see them in the code. If you decide to just use a single prop instead, then use this bit of code, again before the <strong>function s_doPlugins(s)</strong> call: </p>
<pre class="brush: jscript">
var eventAttached=false;
if(!eventAttached){eventAttached = true;
function trackCopy(){
var overrides = {&#039;prop49&#039;:getCopiedText()};
	s.templtv=s.linkTrackVars;
   	s.linkTrackVars=&#039;prop49&#039;;
	s.tl(true, &#039;o&#039;, &#039;Text Copied&#039;, overrides);
	if(s.templtv) s.linkTrackVars=s.templtv;
}
</pre>
<p>Insert the prop you want to use where you see it set. Next take this code and put it in the plug-in&#8217;s section of the s_code file:</p>
<pre class="brush: jscript">
function getCopiedText() {
if (document.selection){return document.selection.createRange().text;}
else if (window.getSelection){return window.getSelection();}return &#039;&#039;;}
if(document.body &amp;&amp; document.body.attachEvent){
document.body.attachEvent(&quot;oncopy&quot;, trackCopy);}
else if (document.body &amp;&amp; document.body.addEventListener){
document.body.addEventListener(&#039;copy&#039;,trackCopy, false);}}
</pre>
<p>What are we going to end up with? You will get a report that looks like this:<br />
<img src="http://webanalyticsland.com/images/copied-text.png" alt="Copied Text Report" /></p>
<p>It&#8217;s pretty interesting to see what your visitors are choosing to copy. Now do I expect to find huge some game changing incite that will lead me to make a change to the Web Site that will increase my conversion rate 100% with this report? Probably not. Do I expect to find one more place that allows me to make another 1% improvement? I sure do. Remember, all those 1% improvements add up. <img src='http://webanalyticsland.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Big thanks to <strong>kgs/ksmith</strong> in the Omniture Developer Connection for the original idea to do this.</p>
<p>Enjoy!</p>
<img src="http://webanalyticsland.com/?ak_action=api_record_view&id=295&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://webanalyticsland.com/sitecatalyst-implementation/track-copied-text-plugin/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Additional Methods To Measure Interaction Using The Get Time To Complete Plug-In</title>
		<link>http://webanalyticsland.com/sitecatalyst-implementation/additional-methods-to-measure-interaction-using-the-get-time-to-complete-plug-in/</link>
		<comments>http://webanalyticsland.com/sitecatalyst-implementation/additional-methods-to-measure-interaction-using-the-get-time-to-complete-plug-in/#comments</comments>
		<pubDate>Fri, 11 Dec 2009 15:58:54 +0000</pubDate>
		<dc:creator>VaBeachKevin</dc:creator>
				<category><![CDATA[SiteCatalyst Implementation]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[cookies]]></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[tracking]]></category>
		<category><![CDATA[visitors]]></category>

		<guid isPermaLink="false">http://webanalyticsland.com/?p=284</guid>
		<description><![CDATA[Recently there was a great article on the Omniture Blog all about Capturing Time Spent on . . . well, just about anything. It&#8217;s a great post and definitely worth checking out. After reading it I was wondering if there was another way to do it? Of course there is! I present the Time To [...]]]></description>
			<content:encoded><![CDATA[<p>Recently there was a great article on the Omniture Blog all about <a href="http://blogs.omniture.com/2009/12/10/time-spent-interacting-with-just-about-anything/">Capturing Time Spent on . . . well, just about anything</a>. It&#8217;s a great post and definitely worth checking out. After reading it I was wondering if there was another way to do it? Of course there is! I present the Time To Complete Plug-in. </p>
<p>The getTimeToComplete plug-in will track the time it takes a user to complete some process on your site. The &#8220;clock&#8221; begins when you call the plug-in with the value &#8220;start&#8221; and stops when the plug-in with the value &#8220;stop&#8221;. The plug-in can be used to track the time to complete a checkout process, to track the time to complete an application process, to track the time a user spends viewing/using Rich Internet Applications (RIA), or to track the time between a download and a purchase.</p>
<pre class="brush: jscript">
s.getTimeToComplete( v, cn, e )
</pre>
<p>v is the Value &#8211; &#8216;start&#8217; or &#8216;stop&#8217;<br />
cn is the Cookie Name – example: &#8216;ttc&#8217;<br />
e is the Expiration &#8211; days to expiration of the cookie, 0 for session<br />
This function will return an empty string &#8221; or a value in days, hours, minutes or seconds</p>
<p>There is a bunch of different ways to use this plug-in. I like this first method because you do not have to add a single of code to the page to make it work (I have found it is much easier to get a development team to simply upload a new s_code file as opposed to adding additional code to the site.) Lets say you want to track a form on your site. Lets say the form is at /my-form.php. Once the visitor fills out the form, they are taken to the thank you page which lets say is at /my-form-thanks.php. I would add this bit of code to the s_code file:</p>
<pre class="brush: jscript">
if (window.location.pathname==&#039;/my-form.php&#039;) s.ttc=&#039;start&#039;;
if (window.location.pathname==&#039;/my-form-thanks.php&#039;) s.ttc=&#039;stop&#039;;
s.prop1=s.getTimeToComplete(s.ttc,&#039;ttc&#039;,0);
</pre>
<p>What this does is looks for the path in the URL for /my-form.php and sets <strong>start</strong> in s.ttc. When the plug-in see&#8217;s this it set&#8217;s the cookie <strong>ttc</strong> with a start time Then when the URL path is /my-form-thanks.php <strong>stop</strong> is set. When the plug-in see&#8217;s <strong>stop</strong>, it then reads the <strong>ttc</strong> plug-in and records the time difference in s.prop1. The time value that you will get will have days and hours rounded to .2 (e.g. 1.4 days), minutes to .5 (e.g. 2.5 minutes), and seconds to 5 (e.g. 15 seconds).</p>
<p><strong>NOTE:</strong>When this is implemented, if you check the debugger you will not see any value for s.prop1 until you have reached the stop point of the process.</p>
<p>Here is another way to use the code. Let&#8217;s say you have some events set right on the pages of your site. We want to know how long it takes to get from when event1 is set to when event2 is set. I would add this code into the s_code file:</p>
<pre class="brush: jscript">
if(s.events.indexOf(&#039;event1&#039;)&gt;-1) s.ttc=&#039;start&#039;;
if(s.events.indexOf(&#039;event2&#039;)&gt;-1) s.ttc=&#039;stop&#039;;
s.prop1=s.getTimeToComplete(s.ttc,&#039;ttc&#039;,0);
</pre>
<p>What this does is look for when event1 happens, then set <strong>start</strong> in s.ttc. When event2 happens <strong>stop</strong> is set, and the time value is set in s.prop1.</p>
<p><strong>NOTE:</strong> Another thing to remember is this can be used to record the time of many different processes or paths on your site. If you do that I suggest using a different cookie name and variable value in each one so there are no issues.</p>
<p>Here is the actual plug-in code:<br />
The getTimeToComplete plug-in returns the time to complete a task. When v is &#8216;start&#8217; a cookie is written with the timestamp. When v is &#8216;stop&#8217; the cookie is read and the expired time is returned in days, hours, minutes, or seconds.</p>
<pre class="brush: jscript">
/*
 * Plugin: getTimeToComplete
 */
s.getTimeToComplete=new Function(&quot;v&quot;,&quot;cn&quot;,&quot;e&quot;,&quot;&quot;
+&quot;var s=this,d=new Date,x=d,k;if(!s.ttcr){e=e?e:0;if(v==&#039;start&#039;||v==&#039;&quot;
+&quot;stop&#039;)s.ttcr=1;x.setTime(x.getTime()+e*86400000);if(v==&#039;start&#039;){s.c&quot;
+&quot;_w(cn,d.getTime(),e?x:0);return &#039;&#039;;}if(v==&#039;stop&#039;){k=s.c_r(cn);if(!s&quot;
+&quot;.c_w(cn,&#039;&#039;,d)||!k)return &#039;&#039;;v=(d.getTime()-k)/1000;var td=86400,th=&quot;
+&quot;3600,tm=60,r=5,u,un;if(v&gt;td){u=td;un=&#039;days&#039;;}else if(v&gt;th){u=th;un=&quot;
+&quot;&#039;hours&#039;;}else if(v&gt;tm){r=2;u=tm;un=&#039;minutes&#039;;}else{r=.2;u=1;un=&#039;sec&quot;
+&quot;onds&#039;;}v=v*r/u;return (Math.round(v)/r)+&#039; &#039;+un;}}return &#039;&#039;;&quot;);
</pre>
<p>I really like this plug-in because you end up with a report that is completely dedicated to the time it takes to complete that exact action. </p>
<p>Enjoy!</p>
<img src="http://webanalyticsland.com/?ak_action=api_record_view&id=284&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://webanalyticsland.com/sitecatalyst-implementation/additional-methods-to-measure-interaction-using-the-get-time-to-complete-plug-in/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Enhance Your SiteCatalyst S_Code Using Server-Side Scripting</title>
		<link>http://webanalyticsland.com/sitecatalyst-implementation/enhance-your-sitecatalyst-s_code-using-server-side-scripting/</link>
		<comments>http://webanalyticsland.com/sitecatalyst-implementation/enhance-your-sitecatalyst-s_code-using-server-side-scripting/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 03:13:23 +0000</pubDate>
		<dc:creator>VaBeachKevin</dc:creator>
				<category><![CDATA[SiteCatalyst Implementation]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[enhancements]]></category>
		<category><![CDATA[implementation]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[s_code.js]]></category>
		<category><![CDATA[tracking]]></category>

		<guid isPermaLink="false">http://webanalyticsland.com/?p=273</guid>
		<description><![CDATA[I receive a lot of questions from people working on their own SiteCatalyst implementations and I&#8217;m always happy to help. One that I got recently is &#8220;why is your s_code file a php file&#8221;? I figured there were not too many people out there doing it like this or even know about this, so I [...]]]></description>
			<content:encoded><![CDATA[<p>I receive a lot of questions from people working on their own SiteCatalyst implementations and I&#8217;m always happy to help. One that I got recently is &#8220;why is your s_code file a php file&#8221;? I figured there were not too many people out there doing it like this or even know about this, so I thought I would help out those that were interested in what the advantages of using server side code to enhance your data collection.</p>
<p>The reason I use a php file to house all of my s_code script is simple. I want to be able to do what is not easily done with using standard JavaScript. Here are a couple of examples.</p>
<p>First things first. How do I get a php file to act like JavaScript? It&#8217;s actually pretty easy. First thing you do is in the top of your file add this small bit of code:</p>
<pre class="brush: php">
&lt;?php header(&#039;Content-type: application/javascript&#039;); ?&gt;
</pre>
<p>The purpose of this line is just to say &#8216;hey, unless instructed otherwise, treat everything you are going to see here as JavaScript. Next change your file extension from .js to .php. That&#8217;s all you need to do to start adding in some php scripting into your file.</p>
<p>Here are some things I am using it for. I like capturing the IP address of my visitors. I like to track this because I have had problems with spammers, scraper bots and general bad visitors in the past, and I just like keeping my eye on things. Here is the code to capture IP address.</p>
<pre class="brush: php">
s.eVar17=&quot;&lt;?php echo $_SERVER[&#039;REMOTE_ADDR&#039;]?&gt;&quot;;
</pre>
<p>I also have this matched with the <a href="http://webanalyticsland.com/plugins/Get_Val_Once_Plugin.pdf">get Val Once</a> plug-in. </p>
<p>Another thing I like to capture is User Agent. How many people come to my site from a specific build of IE6? Is Googlebot executing my JavaScript when crawling my site? Here is how I capture User Agent.</p>
<pre class="brush: php">
s.eVar23=&quot;&lt;?php echo $_SERVER[&#039;HTTP_USER_AGENT&#039;]?&gt;&quot;;
</pre>
<p>Again I match this up with the get Val Once plug-in.</p>
<p>Another thing I like to do is use php to populate the configuration variables of the Time Parting plug-in. The latest version of the plug-in, 2.0, uses specific daylight savings time variables (the 2.0 version is available from the Omniture Help section. The version I host here on the site is the older 1.4 version). The 3 variables that need to be configured for the plug-in are Daylight Savings Time start day for the current year, Daylight Savings Time end day for the current year, and the Current Year. Now all of these can be hard coded, but I&#8217;d rather do a little bit of one time coding and never have to worry about it again. Here is how I set those variables using php.</p>
<pre class="brush: php">
s.dstStart=&quot;&lt;?php echo date(&#039;m/d/Y&#039;, strtotime(&quot;Second Sunday March 0&quot;));?&gt;&quot;;
s.dstEnd=&quot;&lt;?php echo date(&#039;m/d/Y&#039;, strtotime(&quot;First Sunday November 0&quot;));?&gt;&quot;;
s.currentYear=&quot;&lt;?php echo date(&#039;Y&#039;);?&gt;&quot;;
</pre>
<p>All of these take advantage of the date() functionality of php. Combine that with a little bit of extra code, and with the fact that I know that daylight savings time always begins the second Sunday of March and ends on the first Sunday of November, I never need to touch those variables again.</p>
<img src="http://webanalyticsland.com/?ak_action=api_record_view&id=273&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://webanalyticsland.com/sitecatalyst-implementation/enhance-your-sitecatalyst-s_code-using-server-side-scripting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
