<?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>Rudi Shumpert : Code By Numbers &#187; ColdFusion</title>
	<atom:link href="http://www.rudishumpert.com/tag/coldfusion/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rudishumpert.com</link>
	<description>Adventures in web development and analytics</description>
	<lastBuildDate>Wed, 21 Jul 2010 17:51:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Share This Page &#8211; On Your Terms!</title>
		<link>http://www.rudishumpert.com/2010/07/21/share-this-page-on-your-terms/</link>
		<comments>http://www.rudishumpert.com/2010/07/21/share-this-page-on-your-terms/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 12:16:00 +0000</pubDate>
		<dc:creator>Rudi</dc:creator>
				<category><![CDATA[Code Snipets]]></category>
		<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Data Collection]]></category>
		<category><![CDATA[Omniture]]></category>
		<category><![CDATA[Practical Analytics]]></category>
		<category><![CDATA[Web Analytics]]></category>
		<category><![CDATA[Share This Page]]></category>
		<category><![CDATA[Social Media]]></category>

		<guid isPermaLink="false">http://www.rudishumpert.com/?p=621</guid>
		<description><![CDATA[Build your own "Share this page" feature!
Not too long ago I added one of the "Share this page" scripts, AddToAny, to our web site.  This seemed like it was going to work fine but this approach had 3 major drawbacks.

 Most of these services require you to link to their JavaScript file on their servers.  [...]]]></description>
			<content:encoded><![CDATA[<p>Build your own "Share this page" feature!</p>
<p>Not too long ago I added one of the "Share this page" scripts, AddToAny, to our web site.  This seemed like it was going to work fine but this approach had 3 major drawbacks.</p>
<ol>
<li> Most of these services require you to link to their JavaScript file on their servers.  Sure this is fairly reliable but I am not a fan of this approach.</li>
<li>Limited tracking / analytic capabilities.</li>
<li>Cookies you can not control.</li>
</ol>
<p>The first two issues are not huge issues, but while we were testing the site, we noticed that the scripts were adding a few of their own cookies to our users.  I understand why this is, but I did not like it and the feature was pulled.  So I tested out another one, Share This, and it did the same thing. Not only do they add cookies to your users, but they are also tracking usage of their tool on your site.  I don't blame them for this, after all they are providing this as a free service but I still do not like it.</p>
<p>After looking at the scripts for a while I decided that it could not be that difficult to write my own "Share this page" feature.</p>
<p>My goal was to create a widget to let users share the current web page without the limitations listed above.  With just a wee bit of research I found the methods needed to be able to share a page via email, Twitter, Facebook, and LinkedIn.  And then track the usage of data in Omniture SiteCatalyst.</p>
<pre class="brush: plain;">
&lt;ul&gt;
  &lt;li&gt;&lt;A onClick=&quot;jsFunctionToRecordClick('Email');&quot; HREF=&quot;mailto:?subject=#variables.emailSubject#&amp;body=#variables.emailMessage#&quot;&gt;Email &lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a onClick=&quot;jsFunctionToRecordClick('Twitter');&quot; href=&quot;http://twitter.com/home?status=#variables.twitterLink#&quot; target=&quot;_blank&quot;&gt;Twitter &lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a onClick=&quot;jsFunctionToRecordClick('LinkedIn');&quot; href=&quot;http://www.linkedin.com/shareArticle?mini=true&amp;url=www.rudishumpert.com&amp;title=AmazingArticle&amp;summary=This is the best ever&amp;source=Rudi&quot;  target=&quot;_blank&quot;&gt;LinkedIn &lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a onClick=&quot;jsFunctionToRecordClick('Facebook');&quot; href=&quot;http://www.facebook.com/share.php?src=bm&amp;u=#variables.currentPage#&amp;t=#variables.twitterLink#&amp;v=3&quot; target=&quot;_blank&quot;&gt;Facebook &lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</pre>
<p>Sample links without the tracking added:</p>
<ul>
<li><a onclick="jsFunctionToRecordClick('Email');" href="mailto:?subject=Check this out!&amp;body=Message with Link Goes Here: http://www.rudishumpert.com">Email </a></li>
<li><a onclick="jsFunctionToRecordClick('Twitter');" href="http://twitter.com/home?status=Share%20This%20urlhere%20Build%20your%20own!%20measure" target="_blank">Twitter </a></li>
<li><a onclick="jsFunctionToRecordClick('LinkedIn');" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=www.rudishumpert.com&amp;title=AmazingArticle&amp;summary=This is the best ever&amp;source=Rudi" target="_blank">LinkedIn </a></li>
<li><a onclick="jsFunctionToRecordClick('Facebook');" href="http://www.facebook.com/share.php?src=bm&amp;u=www.rudishumpert.com&amp;t=Share This: http://wp.me/pCbAx-a1 Build your own!&amp;v=3" target="_blank">Facebook </a></li>
</ul>
<p>And then the JS Function: Note the JS function is specific to Omniture tracking but this could be leverage for any analytic solution with some minor tweaking.</p>
<pre class="brush: plain;">
			function jsFunctionToRecordClick(category){
				var s = s_gi(s_account);
				s.linkTrackVars=&quot;events,eVarN,propN,propN&quot;;
				s.linkTrackEvents=&quot;eventN&quot;;
				s.events=&quot;eventN&quot;;
				s.eVarN=''+category+'';
				s.propN=''+category+'';
				s.propN=''+category+' | '+s.pageName+'';
				s.tl();
				s.events=&quot;&quot;;
				s.linkTrackEvents=&quot;&quot;;
				s.linkTrackVars=&quot;&quot;;
				s.eVarN='';
				s.propN='';
				s.propN='';
			}
</pre>
<p>The feature is added to the page using a jQuery menu script that creates the same mouse-over drop down effect that the free scripts use, but you can use any sort of presentation approach that fits your web site's style.</p>
<p>And that is it.  You know have your own custom share this web page feature that your can style however you like and maintain complete control over what cookies are used on your site and what level of tracking you would like to get out of the widget.</p>
<p><a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.rudishumpert.com%2F2010%2F07%2F21%2Fshare-this-page-on-your-terms%2F&amp;linkname=Share%20This%20Page%20%26%238211%3B%20On%20Your%20Terms%21" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.rudishumpert.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.rudishumpert.com%2F2010%2F07%2F21%2Fshare-this-page-on-your-terms%2F&amp;linkname=Share%20This%20Page%20%26%238211%3B%20On%20Your%20Terms%21" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.rudishumpert.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a> <a href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.rudishumpert.com%2F2010%2F07%2F21%2Fshare-this-page-on-your-terms%2F&amp;linkname=Share%20This%20Page%20%26%238211%3B%20On%20Your%20Terms%21" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.rudishumpert.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.rudishumpert.com%2F2010%2F07%2F21%2Fshare-this-page-on-your-terms%2F&amp;linkname=Share%20This%20Page%20%26%238211%3B%20On%20Your%20Terms%21" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.rudishumpert.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save">Share/Save</a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.rudishumpert.com/2010/07/21/share-this-page-on-your-terms/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>ColdFusion User Group Presentations</title>
		<link>http://www.rudishumpert.com/2010/02/04/acfug/</link>
		<comments>http://www.rudishumpert.com/2010/02/04/acfug/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 14:34:01 +0000</pubDate>
		<dc:creator>Rudi</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Data Collection]]></category>
		<category><![CDATA[Omniture]]></category>
		<category><![CDATA[Web Analytics]]></category>
		<category><![CDATA[ACFUG]]></category>

		<guid isPermaLink="false">http://www.rudishumpert.com/?p=481</guid>
		<description><![CDATA[At the February 2010 Atlanta ColdFusion User Group (ACFUG) meeting  &#38;  at the ColdFusion Meetup I gave a presentation on working with Omniture &#38; ColdFusion.   I based the presentation on a blog post I wrote last September.
As promised here are the presentation materials:

Presentation

Blog Posts with examples from presentation:

Form Abandonment
Social Media
Video Tracking
Page Load Times




Code Samples
Tools / [...]]]></description>
			<content:encoded><![CDATA[<p>At the February 2010 <a href="http://www.acfug.com" target="_blank">Atlanta ColdFusion User Group</a> (ACFUG) meeting  &amp;  at the <a href="http://www.meetup.com/coldfusionmeetup/calendar/12551647/" target="_blank">ColdFusion Meetup</a> I gave a presentation on working with Omniture &amp; ColdFusion.   I based the presentation on a blog post I wrote last <a href="http://www.rudishumpert.com/2009/09/19/omniture-coldfusion-why-you-should-care/" target="_blank">September</a>.</p>
<p>As promised here are the presentation materials:</p>
<ul>
<li><a href="http://www.rudishumpert.com/wp-content/uploads/2010/02/ACFUG-2-2010.pdf" target="_blank">Presentation</a>
<ul>
<li>Blog Posts with examples from presentation:
<ul>
<li><a href="http://www.rudishumpert.com/2009/11/11/form-abandonment/" target="_blank">Form Abandonment</a></li>
<li><a href="http://www.rudishumpert.com/2009/08/12/pipes-to-omniture/" target="_blank">Social Media</a></li>
<li><a href="http://www.rudishumpert.com/2009/08/19/one-player-to-rule-them-all/">Video Tracking</a></li>
<li><a href="http://www.rudishumpert.com/2010/01/26/tracking-page-load-times/" target="_blank">Page Load Times</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="http://www.rudishumpert.com/wp-content/uploads/2010/02/acfug-2-2010-code.zip" target="_blank">Code Samples</a></li>
<li>Tools / Links Referenced:
<ul>
<li><a href="http://www.longtailvideo.com/" target="_blank">JW  Player (LongTail Video)</a></li>
<li><a href="http://webanalyticssolutionprofiler.com/" target="_blank">W.A.S.P.</a></li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/966">Tamper Data</a></li>
<li><a href="http://www.rosssimpson.com/dev/omnibug.html" target="_blank">Omnibug</a></li>
</ul>
</li>
</ul>
<h4>Bonus Resources:</h4>
<p>In addition to numerous articles I have posted here on my blog, below are some great resources related to Omniture and web analytics in general.  If you have questions or comments, please leave them below.</p>
<p>Omniture Resources:</p>
<ul>
<li><a href="http://blogs.omniture.com/" target="_blank">Omniture Blogs</a></li>
<li><a href="http://developer.omniture.com" target="_blank">Omniture Developer Forums</a></li>
<li><a href="http://www.the-omni-man.com/" target="_blank">The Omni-Man Blog</a></li>
<li><a href="http://twitter.com/OmnitureCare" target="_blank">@OmnitureCare</a> on twitter</li>
</ul>
<p>Web Analytics Resources:</p>
<ul>
<li><a href="http://www.kaushik.net/avinash/" target="_blank">Occam's Razor</a></li>
<li><a href="http://www.webanalyticsassociation.org/" target="_blank">Web Analytics Association</a></li>
<li><a href="http://www.beyondwebanalytics.com/" target="_blank">Beyond Web Analytics - Podcast</a></li>
<li><a href="http://webanalyticsland.com/" target="_blank">Web Analytics Land</a></li>
<li><a href="http://emptymind.org/" target="_blank">The Empty Mind</a></li>
</ul>
<p>Books:</p>
<ul>
<li><a href="http://www.amazon.com/Web-Analytics-Hour-Avinash-Kaushik/dp/0470130652/" target="_blank">Web Analytics: An Hour a Day</a></li>
<li><a href="http://bit.ly/orwa20" target="_blank">Web Analytics 2.0</a></li>
<li><a href="http://www.amazon.com/Competing-Analytics-New-Science-Winning/dp/1422103323" target="_blank">Competing on Analytics</a></li>
</ul>
<p>-Rudi</p>
<p><a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.rudishumpert.com%2F2010%2F02%2F04%2Facfug%2F&amp;linkname=ColdFusion%20User%20Group%20Presentations" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.rudishumpert.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.rudishumpert.com%2F2010%2F02%2F04%2Facfug%2F&amp;linkname=ColdFusion%20User%20Group%20Presentations" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.rudishumpert.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a> <a href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.rudishumpert.com%2F2010%2F02%2F04%2Facfug%2F&amp;linkname=ColdFusion%20User%20Group%20Presentations" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.rudishumpert.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.rudishumpert.com%2F2010%2F02%2F04%2Facfug%2F&amp;linkname=ColdFusion%20User%20Group%20Presentations" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.rudishumpert.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save">Share/Save</a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.rudishumpert.com/2010/02/04/acfug/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tracking Page Load Times</title>
		<link>http://www.rudishumpert.com/2010/01/26/tracking-page-load-times/</link>
		<comments>http://www.rudishumpert.com/2010/01/26/tracking-page-load-times/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 00:01:32 +0000</pubDate>
		<dc:creator>Rudi</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Data Collection]]></category>
		<category><![CDATA[Omniture]]></category>
		<category><![CDATA[Web Analytics]]></category>
		<category><![CDATA[Page Load Time]]></category>

		<guid isPermaLink="false">http://www.rudishumpert.com/?p=457</guid>
		<description><![CDATA[One of my favorite things about ColdFusion is the level of detail you can get from the debugging information.  The ColdFusion server will provide upon request and the right permissions: variable scopes, sql query information,  server information, and execution / load times.  This is very useful information to have while coding and is invaluable when [...]]]></description>
			<content:encoded><![CDATA[<p>One of my favorite things about ColdFusion is the level of detail you can get from the debugging information.  The ColdFusion server will provide upon request and the right permissions: variable scopes, sql query information,  server information, and execution / load times.  This is very useful information to have while coding and is invaluable when you are trying to optimize the speed and performance of the site. However, is it hard to get good benchmark for this data over time from the perspective of your end users.</p>
<p>Earlier this week, I set out to see if there was a way I could get access to the page load data and send it along to Omniture so that I could first get a benchmark of what the performance of the web site was over time, and second be able to tell if changes we made to the site had any impact on performance.</p>
<p>My first attempt in accomplishing my goal was to try and access the same Java object that the debugging code used to get the execution times.  I thought, well I see it in the output on the screen, it should be easy enough to grab that data element and pass it along.</p>
<p><span id="more-457"></span></p>
<pre class="brush: plain;">    &lt;cfset codeFactory = CreateObject(&quot;java&quot;,&quot;coldfusion.server.ServiceFactory&quot;) /&gt;
    &lt;cfset getDebugDataSet = codeFactory.getDebuggingService()&gt;
    &lt;cfset getDebugData = getDebugDataSet.getDebugger().getData()&gt;</pre>
<p>This call returned an object that I was able to parse using  the same methods you would use to parse a query object.  It ran great on my development box, but when I moved it to production: Fail.   ColdFusion provided this lovely error message:</p>
<blockquote>
<pre>Detail Its possible that a method called on a Java object created by CreateObject  returned null.</pre>
</blockquote>
<p>I tried adjusting a few settings and was not able to resolve the issues.  I reached out to the <a href="http://www.acfug.org" target="_blank">Atlanta ColdFusion</a> community, and received some very good guidance on the matter.  The reason for the error was I had debugging enabled on my development box, but did not on my production server.   And no matter what creative method I could come up with, would not justify enabling debugging on a production ColdFusion server.  The performance loss by doing this would outweigh the data gained.</p>
<p>The method that turned out to be the best, was also the easiest.   ColdFusion applications can take advantage of a global application file and two great methods within it: onRequestStart() and onRequestEnd().   The functions do exactly as their names would suggest, they will execute the code within each of them at the start and end of every request for every page in the application.</p>
<p>So inside the onRequestStart() function, you get a start time. And within the onRequestEnd() you get the end time and take the difference to get the page load time in milliseconds.  Pseudo code below:</p>
<pre class="brush: plain;">
&lt;cfset startTime = getTickCount() /&gt;
&lt;!--- something that you want to measure ---&gt;
&lt;cfoutput&gt;That took #(getTickCount()-startTime)#ms!&lt;/cfoutput&gt;
</pre>
<blockquote><p><strong>Note:</strong> While the methods I used are specific to ColdFusion, any site that uses a global header and footer, should be able to achieve the data data with javascript or jQuery.</p></blockquote>
<p>Now I have the the page load times and I began to pass the data into Omniture.  Soon I had results like this.</p>
<p><a href="http://www.rudishumpert.com/wp-content/uploads/2010/01/Aviary-sc-omniture-com-Picture-1-pageload.png"><img class="alignnone size-full wp-image-461" title="Aviary sc-omniture-com Picture 1-pageload" src="http://www.rudishumpert.com/wp-content/uploads/2010/01/Aviary-sc-omniture-com-Picture-1-pageload.png" alt="" width="840" height="253" /></a></p>
<p>It did not take long to determine that data in this format would not be very useful as I could have values from 0 to in excess of 10,000 milliseconds.   So I created a quick <a href="http://blogs.omniture.com/2008/09/10/classifications-aka-saint-inside-omniture-sitecatalyst/" target="_blank">SAINT classification</a> and was able to group the data together into more logical sections.</p>
<p><a href="http://www.rudishumpert.com/wp-content/uploads/2010/01/Aviary-sc-omniture-com-Picture-1.png"><img class="alignnone size-full wp-image-462" title="Aviary sc-omniture-com Picture 1" src="http://www.rudishumpert.com/wp-content/uploads/2010/01/Aviary-sc-omniture-com-Picture-1.png" alt="" width="940" height="290" /></a></p>
<p>Now, this was better, but not perfect and I did not like the data groupings and the time being reported into milliseconds.   After thinking a bit on this, I decided to convert the time to seconds on the ColdFusion side and do the grouping on the web side as well.  I grouped the data into the following sections and passed the data into an sProp:</p>
<ul>
<li> &lt; 1 Second</li>
<li>1-2 Seconds</li>
<li>2-3 Seconds</li>
<li>3-5 Seconds</li>
<li>&gt; 5 Seconds</li>
</ul>
<p>I then took this data and concatenated it with the page name to send in a second sProp:  &lt; 1s | Home Page.   Doing this gave me these sets of data.</p>
<p><a href="http://www.rudishumpert.com/wp-content/uploads/2010/01/pageLoad.png"><img class="alignnone size-full wp-image-464" title="pageLoad" src="http://www.rudishumpert.com/wp-content/uploads/2010/01/pageLoad.png" alt="" width="897" height="290" /></a></p>
<p>....and....</p>
<p><a href="http://www.rudishumpert.com/wp-content/uploads/2010/01/pageload2.gif"><img class="alignnone size-full wp-image-465" title="pageload2" src="http://www.rudishumpert.com/wp-content/uploads/2010/01/pageload2.gif" alt="" width="886" height="451" /></a></p>
<blockquote><p><strong>Note: </strong>These may not be the absolute accurate page load times, but they will be close enough to get a good idea of overall site performance.</p></blockquote>
<p>Success!  Now, before and after major code changes to the site we will be able to go and see if the changes we made had an impact on the performance of the site.   So why go through all the effort to put this into Omniture, when there are other methods to get this type of performance data?  Now that you are able to send this data to Omniture, what else could you do with it?</p>
<ul>
<li>Send it in an eVar to see how performance impacts conversions.</li>
<li>Apply a bounce rate metric to see how performance impacts bounce rates.</li>
<li>Justify the modification or removal of  slow pages/functionality.</li>
<li>Add pathing to the second concatenated sProp to see how users move through the site with performance</li>
</ul>
<p>These are just a few ideas I had.  What would you do with this data inside of your Analytics tool if you could?</p>
<p>-Rudi</p>
<p><a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.rudishumpert.com%2F2010%2F01%2F26%2Ftracking-page-load-times%2F&amp;linkname=Tracking%20Page%20Load%20Times" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.rudishumpert.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.rudishumpert.com%2F2010%2F01%2F26%2Ftracking-page-load-times%2F&amp;linkname=Tracking%20Page%20Load%20Times" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.rudishumpert.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a> <a href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.rudishumpert.com%2F2010%2F01%2F26%2Ftracking-page-load-times%2F&amp;linkname=Tracking%20Page%20Load%20Times" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.rudishumpert.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.rudishumpert.com%2F2010%2F01%2F26%2Ftracking-page-load-times%2F&amp;linkname=Tracking%20Page%20Load%20Times" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.rudishumpert.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save">Share/Save</a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.rudishumpert.com/2010/01/26/tracking-page-load-times/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Form Abandonment</title>
		<link>http://www.rudishumpert.com/2009/11/11/form-abandonment/</link>
		<comments>http://www.rudishumpert.com/2009/11/11/form-abandonment/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 19:26:11 +0000</pubDate>
		<dc:creator>Rudi</dc:creator>
				<category><![CDATA[Code Snipets]]></category>
		<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Omniture]]></category>
		<category><![CDATA[Web Analytics]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Form Abandonment]]></category>

		<guid isPermaLink="false">http://www.rudishumpert.com/?p=280</guid>
		<description><![CDATA[NOTE:  The code samples below are merely a proof of concept.  This solution is not actively in place in any production environmetn that I am involved with.
I was talking to a fellow ColdFusion developer about a web site he was working on, specifically a registration form, and what were some of the best [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p><strong>NOTE:</strong>  The code samples below are merely a proof of concept.  This solution is not actively in place in any production environmetn that I am involved with.</p></blockquote>
<p>I was talking to a fellow ColdFusion developer about a web site he was working on, specifically a registration form, and what were some of the best practices with form length and such that would facilitate users filling out the form and submitting.   This is a common issue with web sites that will not be going away anytime soon.  In fact the questions he had are the same ones I have seen in dozens of blog posts trying to figure this out.</p>
<ul>
<li>How many questions to put on a form?</li>
<li>What type of questions work the best?</li>
<li>What question(s) scared off a user and kept them from completing the form?</li>
</ul>
<p>I know that there are a few "Form Abandonment" plug-ins out there for Omniture and the likes, but from what I've seen the data you get is somewhat limited.   If your form has 20 elements on it and the plug-in only lets you know what the last element with focus was, you have to really think about the validity of that data.  How do you know for sure that the user filled out the elements in order?  Did the developer of the form set the tab index correctly?  Did the user glance at the form, click somewhere near the bottom and then bail?  Did the user fill out half the form the shut down the browser?</p>
<p><span id="more-280"></span></p>
<p>From my understanding of the tools out there today, you are not able to get accurate answers to the questions above.     However, this is an very interesting problem that got me thinking on how I could leverage ColdFusion to be able to capture and get more meaningful data from the abandoned forms.</p>
<p>The Challenge:</p>
<ul>
<li>Capture data by users from abandoned forms</li>
<li>Push that data into Omniture SiteCatalyst</li>
<li>Create a report with real, actionable data on form abandonment</li>
</ul>
<p>The Setup:</p>
<ul>
<li>ColdFusion 8</li>
<li> Client Variables stored in a database (SQL)</li>
<li> jQuery</li>
</ul>
<p><strong>Step 1</strong>:  Capture the form data</p>
<p>The trick to capturing the data would be to find a way to save the form data in some persistent variable so that the data could be retrieved later.  Right away I thought of the <a title="More Information on ColdFusion Client Scope" href="http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=sharedVars_08.html" target="_blank">Client Scope</a> .   Then the task was to find a method that could be deployed to multiple forms across a site with minimal re-coding.    For that I wrote this snippet of jQuery:</p>
<pre class="brush: plain;">
&lt;script language=&quot;JavaScript&quot; type=&quot;text/javascript&quot;&gt;
$(document).ready(function(){
// Form Handling/Analysis Test
$('#Form2BeTracked').children().each(function() {
$(this).bind('change',function (event){
$.post(&quot;/includes/processFormProgress.cfm&quot;, $('#Form2BeTracked').serializeArray() );

});

});

});
&lt;/script&gt;
</pre>
<p>This jQuery function simply binds an onChange event to every form on the page it finds with the id: Form2BeTracked.   This is an easy to deploy script site wide and has no impact on the normal form behavior.</p>
<p>The code on the proccessFormProgress.cfm is all of 3 lines :</p>
<pre class="brush: plain;">
&lt;cfparam name=&quot;client.formProgress&quot; default=&quot;#session.cfid##session.cftoken#&quot;&gt;
&lt;cfwddx action=&quot;cfml2wddx&quot; input=&quot;#form#&quot; output=&quot;wddxSession&quot;&gt;
&lt;cfset client.formProgress = wddxSession&gt;
</pre>
<p>This code takes the entire Form Struct and saves it into the client scope/database</p>
<div id="attachment_293" class="wp-caption aligncenter" style="width: 460px"><img class="size-full wp-image-293" title="Form Data in the Client Scope" src="http://www.rudishumpert.com/wp-content/uploads/2009/11/clientScope.png" alt="Form data is saved real time in the client scope." width="450" height="358" /><p class="wp-caption-text">Form data is saved real time in the client scope.</p></div>
<p>The nice part about this is that by default, ColdFusion saves the list of form elements in the form.fieldnames variable.  Using that we can get a count of the number of variables for this form, and then see that only 2 of the fields were filled out and what the values of those fields are.  All of this without the user clicking submit.</p>
<p><strong>Step 2</strong>:  Clear data on form submit</p>
<p>If the user submits the form, we need to clear the data in the client variable.  This is an easy one line of code to be added on the page that handles the normal submitting of the form.</p>
<pre class="brush: plain;">&lt;cfset client.formProgress = &quot;&quot;&gt;</pre>
<p>This will clear the form data out of the client variable.  This is an important step that can not be skipped or your count of abandoned forms will be inflated.</p>
<p><strong>Step 3</strong>:  Check for abandoned form data</p>
<p>By saving the form data in the client scope it will be held there in the database for as long as the time frame defined in the ColdFusion Administrator.  This setting will determine the frequency that you must check for abandoned form data.</p>
<pre class="brush: plain;">
select cd.cfid, cd.data, cg.lvisit from
CDATA as cd join CGLOBAL as cg
on cd.cfid = cg.cfid
where cg.lvisit &gt;= (your timeframe here )
and cd.data like 'formprogress%'
</pre>
<p>This should pull a result set with all the records of form data that has been saved. ie. abandoned.</p>
<p><img src="http://www.rudishumpert.com/wp-content/uploads/2009/11/form-abandonedquery.png" alt="form-abandonedquery" title="form-abandonedquery" width="673" height="275" class="aligncenter size-full wp-image-298" /></p>
<p>With a little ColdFusion magic </p>
<pre class="brush: plain;">
&lt;cfquery name=&quot;abandoned&quot; datasource=&quot;#REQUEST.dsn#&quot;&gt;
	select cd.cfid, cd.data, cg.lvisit from
	CDATA as cd join CGLOBAL as cg
	on cd.cfid = cg.cfid
	where cg.lvisit &gt;= GETDATE()-1
	and cd.data like 'formprogress%'  

&lt;/cfquery&gt;

&lt;cfset variables.wddx2Convert = abandoned.data&gt;
&lt;cfset variables.wddxLen = len(variables.wddx2Convert)&gt;
&lt;cfset variables.wddx2Convert = right(variables.wddx2Convert,variables.wddxLen-13)&gt;
&lt;cfset variables.wddx2Convert = replacenocase(&quot;#variables.wddx2Convert#&quot;,&quot;##&quot;,&quot;&quot;,&quot;ALL&quot;)&gt;
&lt;cfdump var=&quot;#variables.wddx2Convert#&quot;&gt;

&lt;cfwddx action=&quot;wddx2cfml&quot; input=&quot;#variables.wddx2Convert#&quot; output=&quot;variables.form&quot;&gt;

&lt;cfset variables.formElementList = variables.form[&quot;fieldnames&quot;]&gt;
&lt;cfset variables.formElementCount = listlen(&quot;#variables.formElementList#&quot;)&gt;

&lt;cfset variables.formList = &quot;&quot;&gt;
&lt;cfloop list=&quot;#variables.formElementList#&quot; index=&quot;formItem&quot;&gt;
	&lt;cfset variables.tempValue = variables.form[&quot;#formItem#&quot;] &gt;
	&lt;cfset variables.valuePair = &quot;#formItem#:#variables.tempValue#&quot;&gt;
	&lt;cfset variables.formList = ListAppend(variables.formList,&quot;#variables.valuePair#&quot;,&quot;|&quot;)&gt;
&lt;/cfloop&gt;
</pre>
<p>You end up with a variable string that you can then submit to Omniture using the Data Insertion API. See this <a href="http://www.rudishumpert.com/2009/09/11/use-omnitures-data-insertion-api/">post</a> on details if the API.</p>
<p><img src="http://www.rudishumpert.com/wp-content/uploads/2009/11/form-dataDetail.png" alt="form-dataDetail" title="form-dataDetail" width="574" height="82" class="aligncenter size-full wp-image-299" /></p>
<p>As you can see from the image above, you now have the count of the form elements in the form along with the data values from the form elements that were filled out before the user abandoned the form.   With this, you can choose what format would be the most useful for your needs to really dig into abandoned forms.</p>
<p>-Rudi </p>
<p><a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.rudishumpert.com%2F2009%2F11%2F11%2Fform-abandonment%2F&amp;linkname=Form%20Abandonment" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.rudishumpert.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.rudishumpert.com%2F2009%2F11%2F11%2Fform-abandonment%2F&amp;linkname=Form%20Abandonment" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.rudishumpert.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a> <a href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.rudishumpert.com%2F2009%2F11%2F11%2Fform-abandonment%2F&amp;linkname=Form%20Abandonment" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.rudishumpert.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.rudishumpert.com%2F2009%2F11%2F11%2Fform-abandonment%2F&amp;linkname=Form%20Abandonment" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.rudishumpert.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save">Share/Save</a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.rudishumpert.com/2009/11/11/form-abandonment/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Bing!  You have inflated traffic numbers!</title>
		<link>http://www.rudishumpert.com/2009/10/06/bing-your-stats-are-done/</link>
		<comments>http://www.rudishumpert.com/2009/10/06/bing-your-stats-are-done/#comments</comments>
		<pubDate>Tue, 06 Oct 2009 12:09:47 +0000</pubDate>
		<dc:creator>Rudi</dc:creator>
				<category><![CDATA[Code Snipets]]></category>
		<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Omniture]]></category>
		<category><![CDATA[Web Analytics]]></category>
		<category><![CDATA[Bing Bot]]></category>
		<category><![CDATA[BING Fake Referrer]]></category>
		<category><![CDATA[SiteCatalyst]]></category>

		<guid isPermaLink="false">http://www.rudishumpert.com/?p=230</guid>
		<description><![CDATA[ The past couple of months we noticed a very odd trend the the geo-location / city data that was being saved in Omniture.  The great metropolis of Redmond, Washington was now the number 1 city of origin of our web visitors.  And this was not a small lead, they were the number 1 city [...]]]></description>
			<content:encoded><![CDATA[<p><img class="size-thumbnail wp-image-233 alignleft" style="margin: 5px;" title="Our #1 Fan!  " src="http://www.rudishumpert.com/wp-content/uploads/2009/10/514px-Seal_of_Redmond_Washington-150x150.png" alt="Our #1 Fan!  " width="150" height="150" /> The past couple of months we noticed a very odd trend the the geo-location / city data that was being saved in Omniture.  The great metropolis of Redmond, Washington was now the number 1 city of origin of our web visitors.  And this was not a small lead, they were the number 1 city by more than double the traffic from the number 2 spot.</p>
<p>Trying to find an explanation for all this, I checked the twitter-verse and did a little digging online, but did not have a chance to really dive into the issue until yesterday.<span id="more-230"></span></p>
<p><a href="http://twitter.com/OmnitureCare" target="_blank">@OmnitureCare</a> pointed me in the right direction with this link to a post on the <a href="http://www.bing.com/community/forums/t/648564.aspx">Bing Forum. </a></p>
<blockquote><p><strong>From Bing Forum: </strong>I'm getting a ton of hits from IP 65.55.* that appear to be coming from user searches such as referrer "http://www.bing.com/search?q=copper" and user agents similar to "Mozilla/4.0 (compatible;  MSIE 6.0;  Windows NT 5.1;  SLCC1;  .NET CLR 1.1.4322;  .NET CLR 2.0.40607;  .NET CLR 3.0.04506.648)"</p></blockquote>
<p>The swell folks over at Microsoft claim that they are working on a new spider and working out the kinks.  Well this "kink" has been mucking with my data and is very annoying. Kink FAIL!   I pulled the web log files and began to search for all traffic from the IP Range of 65.55.*.*  Here is what I found:</p>
<pre class="brush: plain;">
2009-10-04 00:12:34 W3SVC1 127.0.0.1 GET /filename - 80 - 65.55.207.50 msnbot/2.0b+(+http://search.msn.com/msnbot.htm) 404 0 0
2009-10-04 00:12:48 W3SVC1 127.0.0.1 GET /filename - 80 - 65.55.109.1 Mozilla/4.0 200 0 0
2009-10-04 00:12:48 W3SVC1 127.0.0.1 GET /filename - 80 - 65.55.109.1 Mozilla/4.0 200 0 0
2009-10-04 00:12:48 W3SVC1 127.0.0.1 GET /filename - 80 - 65.55.109.1 Mozilla/4.0 200 0 0
2009-10-04 00:12:48 W3SVC1 127.0.0.1 GET /filename - 80 - 65.55.109.1 Mozilla/4.0 200 0 0
</pre>
<p>The first line above looks ok.  The bot clearly identifies itself and does not fire off the tracking JS code.  The next few lines appear to be normal "real" user traffic and do result in the tracking code being executed.   I check the IP address over at http://www.dnsstuff.com and get back that the IP address does indeed belong to Microsoft.</p>
<p><a href="http://www.dnsstuff.com/tools/whois/?tool_id=66&amp;token=&amp;toolhandler_redirect=0&amp;ip=65.55.109.1"><img class="aligncenter size-full wp-image-234" title="Gee thanks for the spam traffic Microsoft." src="http://www.rudishumpert.com/wp-content/uploads/2009/10/msWhoIS.png" alt="Gee thanks for the spam traffic Microsoft." width="316" height="366" /></a></p>
<p>I could list row after row of data from the log files with countless variations of traffic from various M$ ip addresses that do not identify them as bots.  All of the fake/spoofed traffic has this in common:</p>
<ul>
<li>65.55.*.*  IP address range</li>
<li>User Agent listed as "Mozilla/4.0" only</li>
</ul>
<p>Now that I have the "signature" of the bad traffic, I wanted to find a way to prevent this from falsely inflating our city and other visitor data.  I dug around trying to find an elegant way to do this with JavaScript only, but decided the best approach would be to leverage the ColdFusion platform we use and simply suppress the s_code file from being loaded if I was able to detect the traffic matched the above pattern.</p>
<pre class="brush: plain;">&lt;cfif findnocase(&quot;65.55.&quot;,&quot;#cgi.remote_addr#&quot;) GT 0 AND findnocase(&quot;Mozilla/4.0&quot;,&quot;#cgi.HTTP_USER_AGENT#&quot;) GT 0&gt;</pre>
<p>This IF block checks for the pattern and prevents the Omniture JS code from being loaded if both conditions are met.   I put this code in place around noon yesterday and in less than 24 hours I can see that this is working.</p>
<p><img class="aligncenter size-full wp-image-236" title="Bye Bye Bad Bing Bot Badness" src="http://www.rudishumpert.com/wp-content/uploads/2009/10/redmondfake-traffic.png" alt="Bye Bye Bad Bing Bot Badness" width="578" height="202" /></p>
<p>I will be keeping a close eye on all the traffic reports to make sure that we are not losing any real traffic data, but I am confident that will will keep this current issue from jacking my data any further.</p>
<p>Below are a few sites I found that helped me in my research:</p>
<ul>
<li><a href="http://solaroverpower.com/2009/06/16/is-microsoft-spoofing-blog-visits-to-generate-traffic-back-to-bing/" target="_blank">http://solaroverpower.com/2009/06/16/is-microsoft-spoofing-blog-visits-to-generate-traffic-back-to-bing/</a></li>
<li><a href="http://www.webmasterworld.com/search_engine_spiders/3875363-5-30.htm" target="_blank">http://www.webmasterworld.com/search_engine_spiders/3875363-5-30.htm</a></li>
<li><a href="http://www.webmasterworld.com/search_engine_spiders/3950463.htm" target="_blank">http://www.webmasterworld.com/search_engine_spiders/3950463.htm</a></li>
<li><a href="http://www.bing.com/community/forums/p/648805/9549504.aspx?PageIndex=3" target="_blank">http://www.bing.com/community/forums/p/648805/9549504.aspx?PageIndex=3</a></li>
<li><a href="http://www.bing.com/community/forums/t/648564.aspx" target="_blank">http://www.bing.com/community/forums/t/648564.aspx</a></li>
</ul>
<p>-Rudi</p>
<p>Updated 10/15/2009:</p>
<p>James Dutton found this bug showing up in Yahoo Web Analytics as well.  Read his tips to resolve it!<br />
<a href="http://insightr.com/blog/2009/10/15/yahoo-web-analytics-data-inflated-by-bing-and-how-to-fix-it.html?lastPage=true&amp;postSubmitted=true" target="_blank">Yahoo Web Analytics data inflated by Bing and how to fix it.</a></p>
<p><a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.rudishumpert.com%2F2009%2F10%2F06%2Fbing-your-stats-are-done%2F&amp;linkname=Bing%21%20%20You%20have%20inflated%20traffic%20numbers%21" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.rudishumpert.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.rudishumpert.com%2F2009%2F10%2F06%2Fbing-your-stats-are-done%2F&amp;linkname=Bing%21%20%20You%20have%20inflated%20traffic%20numbers%21" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.rudishumpert.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a> <a href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.rudishumpert.com%2F2009%2F10%2F06%2Fbing-your-stats-are-done%2F&amp;linkname=Bing%21%20%20You%20have%20inflated%20traffic%20numbers%21" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.rudishumpert.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.rudishumpert.com%2F2009%2F10%2F06%2Fbing-your-stats-are-done%2F&amp;linkname=Bing%21%20%20You%20have%20inflated%20traffic%20numbers%21" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.rudishumpert.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save">Share/Save</a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.rudishumpert.com/2009/10/06/bing-your-stats-are-done/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>“If wishes were horses beggars would ride”</title>
		<link>http://www.rudishumpert.com/2009/09/23/omniture-coldfusion-wishlist/</link>
		<comments>http://www.rudishumpert.com/2009/09/23/omniture-coldfusion-wishlist/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 12:24:55 +0000</pubDate>
		<dc:creator>Rudi</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Omniture]]></category>
		<category><![CDATA[Web Analytics]]></category>
		<category><![CDATA[Adobe]]></category>

		<guid isPermaLink="false">http://www.rudishumpert.com/?p=205</guid>
		<description><![CDATA[Thanks to the magic of the internet &#38; twitter I read a request this morning for a wish list of integration ideas for Adobe + Omniture, from @BrettError.  I knew that I would not be able to fit my list in the 140 characters allowed by twitter, so I will list them out here.
Of [...]]]></description>
			<content:encoded><![CDATA[<p>Thanks to the magic of the internet &amp; twitter I read a request this morning for a wish list of integration ideas for <a href="http://www.omniture.com/press/777" target="_blank">Adobe + Omniture</a>, from <a href="http://twitter.com/BrettError" target="_blank">@BrettError</a>.  I knew that I would not be able to fit my list in the 140 characters allowed by twitter, so I will list them out here.</p>
<p>Of all the Adobe products out there I use ColdFusion almost exclusively (not counting reading PDF's with Acrobat), so my list will be very slanted towards items I would love to see from an Omniture + ColdFusion perspective, that would make my job of implementing and optimizing the Omniture code &amp; tags easier.  That being said, this list below could easily be ported over to whatever development platform the site to be tracked is built on.</p>
<p>1) Tag library integration / validation within the soon to be released ColdFusion IDE - <a href="http://blogs.adobe.com/cfbuilder/" target="_blank">CF Builder</a>.  Much like the integrated JS libraries that can be added to other Eclipse based IDE's</p>
<p>2) Dedicated AJAX support - ok, so maybe this one has nothing to do with ColdFusion specifically but it would be great to have a defined/dedicated AJAX tag like s.trackAJAX() instead of having to use the custom link tracking s.tl() to track AJAX events.   More and more of what I do is on RIA, AJAX heavy elements where a user/web visitor can spend a long time and make many clicks on AJAX elements without ever triggering a page reload.</p>
<p>3) Native integration with the ColdFusion session variables to by default populate many of the page specific variables to send to Omniture. (pageName, server, channel, etc.)</p>
<p>4) Built in tags to use the Data Insertion API to push data into Omniture as an alternative to the JS Beacon.   Having this as a CF tag, might make it easier to accomplish #2 above.</p>
<p>5) Community.  The Adobe ColdFusion is a loyal and active community and serves as a great example of the <a title="Read all the comments!" href="http://www.coldfusionjedi.com/index.cfm/2009/9/10/Yahoo-Query-Language" target="_blank">effectiveness</a> of having a great active and supported developer community.</p>
<p>6) Enhance documentation by creating Adobe AIR versions such as <a href="http://blog.brianflove.com/articles/2008/02/19/cfdocs-on-air/" target="_blank">this.</a> I use this version of the Adobe Live Doc's all the time.  Very handy!</p>
<p>So, there it is.  My 2/5's of a nickel on what I would love to see as a results of the Adobe(ColdFusion) + Omniture integration.</p>
<p>-Rudi</p>
<blockquote><p>PS.  The original tweet request for the wish list made me instantly think of a quote my mom often repeated to me when I would say "I Wish...."</p>
<p>“If wishes were horses beggars would ride”</p></blockquote>
<p><a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.rudishumpert.com%2F2009%2F09%2F23%2Fomniture-coldfusion-wishlist%2F&amp;linkname=%E2%80%9CIf%20wishes%20were%20horses%20beggars%20would%20ride%E2%80%9D" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.rudishumpert.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.rudishumpert.com%2F2009%2F09%2F23%2Fomniture-coldfusion-wishlist%2F&amp;linkname=%E2%80%9CIf%20wishes%20were%20horses%20beggars%20would%20ride%E2%80%9D" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.rudishumpert.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a> <a href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.rudishumpert.com%2F2009%2F09%2F23%2Fomniture-coldfusion-wishlist%2F&amp;linkname=%E2%80%9CIf%20wishes%20were%20horses%20beggars%20would%20ride%E2%80%9D" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.rudishumpert.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.rudishumpert.com%2F2009%2F09%2F23%2Fomniture-coldfusion-wishlist%2F&amp;linkname=%E2%80%9CIf%20wishes%20were%20horses%20beggars%20would%20ride%E2%80%9D" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.rudishumpert.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save">Share/Save</a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.rudishumpert.com/2009/09/23/omniture-coldfusion-wishlist/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Omniture &amp; ColdFusion: Why you should care.</title>
		<link>http://www.rudishumpert.com/2009/09/19/omniture-coldfusion-why-you-should-care/</link>
		<comments>http://www.rudishumpert.com/2009/09/19/omniture-coldfusion-why-you-should-care/#comments</comments>
		<pubDate>Sun, 20 Sep 2009 01:00:50 +0000</pubDate>
		<dc:creator>Rudi</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Omniture]]></category>
		<category><![CDATA[Web Analytics]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[SiteCatalyst]]></category>

		<guid isPermaLink="false">http://www.rudishumpert.com/?p=195</guid>
		<description><![CDATA[So you use ColdFusion and by now you have heard the news that Omniture is going to be purchased by Adobe. So what?  Why should you care?


The vast majority of ColdFusion sites I've work on in the past are not public sites, and historically there have been little, if any concern for web analytics.  Sure, [...]]]></description>
			<content:encoded><![CDATA[<p>So you use ColdFusion and by now you have heard the news that <a href="http://www.omniture.com/press/777" target="_blank">Omniture is going to be purchased by Adobe.</a> So what?  Why should you care?</p>
<p><img class="size-full wp-image-196 alignleft" title="omni-cf" src="http://www.rudishumpert.com/wp-content/uploads/2009/09/omni-cf.png" alt="omni-cf" width="318" height="327" /></p>
<p><span id="more-195"></span></p>
<p>The vast majority of ColdFusion sites I've work on in the past are not public sites, and historically there have been little, if any concern for web analytics.  Sure, we had basic usage data, but nothing close to the level of detail that Omniture can provide.  This goes beyond SEO, and just numbers for the marketing department.  It is the ability to gain a true understanding of what your users are doing on your applications.  Which features they really use and which ones they don't.   Imagine building a web application and being able to have the data to drive the design of navigation and layout of these web apps.  Imagine having the data to take to the decision  makers to prove the effectiveness or lack of effectiveness of certain features.  This is what Omniture can do you for.</p>
<p>At it's most basic level, the Omniture code is a Javascript file that you will include on every page of your web application or public web site.  On every page load, the JavaScript file makes an image request to Omniture and in doing so, sends the tracking data to Omniture and is then available within their tools to analyze and slice in almost any way imaginable.   Combine this with the power of ColdFusion and the possibilities are dizzying, especially when you start thinking about adding this type of tracking to Flex, Air, and of course Flash applications as well.</p>
<p><a href="http://www.rudishumpert.com/2009/09/04/hierarchydatainomniture/"><img class="aligncenter size-full wp-image-198" title="Adobe &amp; Omniture" src="http://www.rudishumpert.com/wp-content/uploads/2009/09/omgraphic.jpg" alt="Adobe &amp; Omniture" width="500" height="142" /></a></p>
<p>Most public sites rely heavily on other JavaScript functions to get any data beyond the basic implementation, but with ColdFusion you have one of the most powerful web languages at your disposal to easily gather and send much more advanced levels of data into Omniture.  I have posted several articles here that demonstrate a few things you can leverage ColdFusion for and send the data into Omniture:</p>
<ul>
<li><a href="http://www.rudishumpert.com/2009/08/12/pipes-to-omniture/">Social Media Data</a></li>
<li><a href="http://www.rudishumpert.com/2009/09/04/hierarchydatainomniture/">Hierarchy Data</a></li>
<li><a href="http://www.rudishumpert.com/2009/09/11/use-omnitures-data-insertion-api/">Build Custom XML for Data Insertion</a></li>
<li><a href="http://www.rudishumpert.com/2009/08/19/one-player-to-rule-them-all/">Custom Video Tracking</a></li>
</ul>
<p>I've only been exposed to and been working with the Omniture code for a few months and I'm still learning how powerful this data can be, but I'm a true believer in the value it can bring.  If you made it this far in the past, thanks, and take a look around.  I will be the first to tell you that by no means do I consider myself to be an expert, but I am very excited about the things I have been able to do with Omniture &amp; ColdFusion and I am looking forward to what the merger of Adobe &amp; Omniture could mean for the ColdFusion community.</p>
<p>-Rudi</p>
<p><a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.rudishumpert.com%2F2009%2F09%2F19%2Fomniture-coldfusion-why-you-should-care%2F&amp;linkname=Omniture%20%26%23038%3B%20ColdFusion%3A%20Why%20you%20should%20care." title="Twitter" rel="nofollow" target="_blank"><img src="http://www.rudishumpert.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.rudishumpert.com%2F2009%2F09%2F19%2Fomniture-coldfusion-why-you-should-care%2F&amp;linkname=Omniture%20%26%23038%3B%20ColdFusion%3A%20Why%20you%20should%20care." title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.rudishumpert.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a> <a href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.rudishumpert.com%2F2009%2F09%2F19%2Fomniture-coldfusion-why-you-should-care%2F&amp;linkname=Omniture%20%26%23038%3B%20ColdFusion%3A%20Why%20you%20should%20care." title="Delicious" rel="nofollow" target="_blank"><img src="http://www.rudishumpert.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.rudishumpert.com%2F2009%2F09%2F19%2Fomniture-coldfusion-why-you-should-care%2F&amp;linkname=Omniture%20%26%23038%3B%20ColdFusion%3A%20Why%20you%20should%20care." title="Facebook" rel="nofollow" target="_blank"><img src="http://www.rudishumpert.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save">Share/Save</a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.rudishumpert.com/2009/09/19/omniture-coldfusion-why-you-should-care/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Adventures in Utah!</title>
		<link>http://www.rudishumpert.com/2009/09/18/adventures-in-utah/</link>
		<comments>http://www.rudishumpert.com/2009/09/18/adventures-in-utah/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 05:44:48 +0000</pubDate>
		<dc:creator>Rudi</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Omniture]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Orem]]></category>
		<category><![CDATA[SiteCatalyst]]></category>

		<guid isPermaLink="false">http://www.rudishumpert.com/?p=191</guid>
		<description><![CDATA[This week I had the great fortune to go to Orem Utah for Omniture SiteCatalyst Implementation.   I was excited not only for the training, but also this was my first trip to Utah.   My flight got in well after dark so I did not see the mountains until the next morning, but man is it [...]]]></description>
			<content:encoded><![CDATA[<p>This week I had the great fortune to go to Orem Utah for Omniture SiteCatalyst Implementation.   I was excited not only for the training, but also this was my first trip to Utah.   My flight got in well after dark so I did not see the mountains until the next morning, but man is it pretty out there!</p>
<p style="text-align: center;"><img class="aligncenter size-large wp-image-192" title="Orem UT" src="http://www.rudishumpert.com/wp-content/uploads/2009/09/IMG_1454-1024x768.jpg" alt="Orem UT" width="717" height="538" /></p>
<p>I've been busy for the past few months working to integrate Omniture into our web site, and I have made a lot of good progress and I was quite sure that there was still much to learn in the training, however, I was not prepared for how much I still had to learn.</p>
<p>Despite all I had managed to learn on my own, and the resources I had managed to find on the web, there were some basic concepts that had escaped me (and will be rectified):</p>
<p><strong>Core understanding of the 4 types of Omniture variables. (Traffic, Conversion, Configuration, Automatic):</strong><br />
I had a basic grasp on how each of these variables worked, but had not wrapped my head around how each of these variables not only related to other variables of the same type,  but how to properly format and track each one to maximize the detail you can achieve within SiteCatalyst.</p>
<p><strong>Clearly define business goals &amp; requirements before you code <img src='http://www.rudishumpert.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </strong><br />
In the process of jumping head first into the coding and figuring out ways to get the data we needed into Omniture, the critical step of getting all the goals defined and updating our Solution Design Document to reflect the goals was skipped.</p>
<p><strong>Have Client Care enable additional features:<br />
</strong>Yet another seemingly simple item of having pathing enabled, and adding additional metrics to variables , was missed.</p>
<p>There are a few other small things that I might go into more detail later, but this is as much ignorance on this topic I wish to share at this time.   The major item I am taking away from this training is that no matter how much you think you know, there is always something else to learn.</p>
<p>I would also like to give kudos to the trainers from Omniture!  Our instructor, Doc Cochran, was extremely knowledgeable about SiteCatalyst, and took the time to make sure that any and all of our questions were answered.   He also had a great way of relating each example/item to a real world scenario that all could benefit from.</p>
<p>From this class I have a full list of items to review and address once I am back at work and I am looking forward to applying the new knowledge and getting the full benefit from our investment in Omniture.</p>
<p>_______</p>
<p>I would also like to thank the other Omniture employees that I was able to meet with to discuss past and future initiatives we are working on.   It was great to be able to sit face to face and talk though some past successes and challenges with these folks.</p>
<p>_______</p>
<p>Lastly, it was a little on the surreal side to be in Orem when the news broke that Adobe was buying Omniture.  There are been many, many articles written about this and I will throw in my 2/5's of a nickel.   As a ColdFusion developer I have worked with many folks in the Adobe community for some time and have always been impressed with the dedication to innovation that is part of Adobe's culture.   I truly think that this is a great fit and the communities of both products/companies should benefit greatly from this merger.   I am looking forward to seeing how they will be able to tie the technologies together.</p>
<p>I had an absolutely great trip to Utah.  I learned tons, met great people, and soaked in the amazing landscapes!</p>
<p><img class="aligncenter size-large wp-image-193" title="Bridal Veil Falls" src="http://www.rudishumpert.com/wp-content/uploads/2009/09/IMG_1491-768x1024.jpg" alt="Bridal Veil Falls" width="768" height="1024" /></p>
<p>-Rudi</p>
<p><a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.rudishumpert.com%2F2009%2F09%2F18%2Fadventures-in-utah%2F&amp;linkname=Adventures%20in%20Utah%21" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.rudishumpert.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.rudishumpert.com%2F2009%2F09%2F18%2Fadventures-in-utah%2F&amp;linkname=Adventures%20in%20Utah%21" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.rudishumpert.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a> <a href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.rudishumpert.com%2F2009%2F09%2F18%2Fadventures-in-utah%2F&amp;linkname=Adventures%20in%20Utah%21" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.rudishumpert.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.rudishumpert.com%2F2009%2F09%2F18%2Fadventures-in-utah%2F&amp;linkname=Adventures%20in%20Utah%21" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.rudishumpert.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save">Share/Save</a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.rudishumpert.com/2009/09/18/adventures-in-utah/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Hierarchy Data In Omniture</title>
		<link>http://www.rudishumpert.com/2009/09/04/hierarchydatainomniture/</link>
		<comments>http://www.rudishumpert.com/2009/09/04/hierarchydatainomniture/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 14:41:29 +0000</pubDate>
		<dc:creator>Rudi</dc:creator>
				<category><![CDATA[Code Snipets]]></category>
		<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Omniture]]></category>
		<category><![CDATA[Web Analytics]]></category>
		<category><![CDATA[Hierarchies]]></category>
		<category><![CDATA[SiteCatalyst]]></category>

		<guid isPermaLink="false">http://www.rudishumpert.com/?p=143</guid>
		<description><![CDATA[NOTE:  If your looking for the article on Omniture &#38; ColdFusion: Why you should care. Click Here.  I botched the link in the original tweet.
I was reading a post on WebAnalyticsLand about a SiteCatalyst plugin to populate the s.hierN variables from the URL, and it got the gears turning.  I wonder if I could [...]]]></description>
			<content:encoded><![CDATA[<p>NOTE:  If your looking for the article on <a href="http://www.rudishumpert.com/2009/09/19/omniture-coldfusion-why-you-should-care/">Omniture &amp; ColdFusion: Why you should care. Click Here.  I botched the link in the original tweet.</a></p>
<p>I was reading a post on <a href="http://webanalyticsland.com/sitecatalyst-implementation/new-plugin-function-to-populate-hierarchy-from-url-in-omniture-sitecatalyst/" target="_blank">WebAnalyticsLand about a SiteCatalyst plugin</a> to populate the s.hierN variables from the URL, and it got the gears turning.  I wonder if I could get that to work using a combination of ColdFusion &amp; JS instead of just making edits to the s_code file.</p>
<p>Some things to consider before implementing Hierarchies: (swiped from Omniture's Manual)</p>
<ul>
<li>There are five hierarchy variables available, which must be enabled by Omniture ClientCare.</li>
<li>At the time the hierarchy is enabled, you will need to decide on a delimiter for the variable and the maximum number of levels for the hierarchy.</li>
<li> Before implementing hierarchies, refer to the Channels and Hierarchies white paper.</li>
<li> The delimiter may not be changed once the hierarchy is setup. If the delimiter for your hierarchy must be changed, contact Omniture ClientCare.</li>
<li> The number of levels may not be changed once the hierarchy is set up.</li>
</ul>
<p>Once the hierarchy is activated, you should see it in SiteCatalyst under the Site Content Menu item (In version 14.6)</p>
<p>That concludes the configuration portion of the adventure.  Now to the coding!</p>
<blockquote><p>Note:  I code in a ColdFusion environment in which I have a .cfm page that pulls the s_code.js into it so I can use some built in CFML functions to tweak the data.</p></blockquote>
<p>Goals for this adventure were to:</p>
<ul>
<li>Dynamically set the s.hierN variable on every page</li>
<li>Prevent levels greater than 5 from being passed</li>
<li>Prevent filenames being passed as levels (index.cfm)</li>
<li>And of course..get it all working to provide a hierarchical view of our web traffic. <img src='http://www.rudishumpert.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
</ul>
<pre class="brush: plain;">&lt;cfset variables.omniHierList = cgi.path_info &gt;
&lt;cfset variables.omniHierListLen = ListLen(variables.omniHierList,&quot;/&quot;)&gt;
&lt;cfset variables.newOmniHierList = ListChangeDelims(variables.omniHierList,&quot;|&quot;,&quot;/&quot;)&gt;
&lt;!--- Check the list len to make sure we do no exceed the level depth ---&gt;
&lt;cfset variables.lastItem = ListGetAt(variables.newOmniHierList,variables.omniHierListLen,&quot;|&quot;)&gt;
&lt;cfif FindNoCase(&quot;.&quot;,&quot;#variables.lastItem#&quot;) GT 0&gt;
 &lt;cfset variables.newOmniHierList = ListDeleteAt(variables.newOmniHierList,variables.omniHierListLen,&quot;|&quot;)&gt;
&lt;/cfif&gt;</pre>
<p>This will result in: Assuming of course that your current path is "/root/evil/browsers/IE6/demonspawn/use/firefox.ftw"</p>
<p style="text-align: center;"><a href="http://www.rudishumpert.com/2009/09/02/i-loathe-ie-6/"><img class="aligncenter size-full wp-image-146" title="IE6 is Evil" src="http://www.rudishumpert.com/wp-content/uploads/2009/09/hierStruct-extra.png" alt="Struct" width="405" height="125" /></a></p>
<p>So what I've done is parse through the cgi.path_info variable, change the delimiter to | and removed the filename from the end of the list.  But as you can see I am left with a list of 6 items and I can only send 5 levels to the s.hier I had ClientCare activate.  I was told that the extra's would be ignored, but I do not like to leave things to chance, so I added one more set of code.</p>
<pre class="brush: plain;">&lt;cfif variables.omniHierListLen GT 5&gt;
 &lt;cfset variables.newOmniListTrim = &quot;&quot;&gt;
 &lt;cfloop from=&quot;1&quot; to=&quot;5&quot; index=&quot;i&quot;&gt;
 &lt;cfset variables.newOmniListTrim = ListAppend(variables.newOmniListTrim,ListGetAt(variables.newOmniHierList,#i#,&quot;|&quot;),&quot;|&quot;)&gt;
 &lt;/cfloop&gt;
 &lt;cfset variables.newOmniHierList = variables.newOmniListTrim&gt;
 &lt;/cfif&gt;</pre>
<p>Now you have a list of a max of 5 items to set the s.hierN variable to.</p>
<p style="text-align: center;"><a href="http://www.rudishumpert.com/2009/09/02/i-loathe-ie-6/"><img class="aligncenter size-full wp-image-148" title="IE 6 ... Still Evil" src="http://www.rudishumpert.com/wp-content/uploads/2009/09/hier.png" alt="hier" width="398" height="157" /></a></p>
<p>This was one of the easier Omniture adventures so far!</p>
<p>-Rudi</p>
<p><a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.rudishumpert.com%2F2009%2F09%2F04%2Fhierarchydatainomniture%2F&amp;linkname=Hierarchy%20Data%20In%20Omniture" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.rudishumpert.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.rudishumpert.com%2F2009%2F09%2F04%2Fhierarchydatainomniture%2F&amp;linkname=Hierarchy%20Data%20In%20Omniture" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.rudishumpert.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a> <a href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.rudishumpert.com%2F2009%2F09%2F04%2Fhierarchydatainomniture%2F&amp;linkname=Hierarchy%20Data%20In%20Omniture" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.rudishumpert.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.rudishumpert.com%2F2009%2F09%2F04%2Fhierarchydatainomniture%2F&amp;linkname=Hierarchy%20Data%20In%20Omniture" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.rudishumpert.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save">Share/Save</a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.rudishumpert.com/2009/09/04/hierarchydatainomniture/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>One Player to Rule Them All&#8230;</title>
		<link>http://www.rudishumpert.com/2009/08/19/one-player-to-rule-them-all/</link>
		<comments>http://www.rudishumpert.com/2009/08/19/one-player-to-rule-them-all/#comments</comments>
		<pubDate>Wed, 19 Aug 2009 12:57:27 +0000</pubDate>
		<dc:creator>Rudi</dc:creator>
				<category><![CDATA[Code Snipets]]></category>
		<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Omniture]]></category>
		<category><![CDATA[Web Analytics]]></category>
		<category><![CDATA[JW Player]]></category>
		<category><![CDATA[Video Tracking]]></category>

		<guid isPermaLink="false">http://codebynumbers.solutionworks.net/?p=76</guid>
		<description><![CDATA[Last week I read a great post by Vaugn Denny about the JW Video Player.   And being of the curious sort I had to investigate further.  So I visited the JW Player web site. And I was greeted with a page that claimed that they had a video player that would not [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I read a great post by <a href="http://www.vaughandenny.com/blog/2009/08/jw-players-like-wordpress-for-video/">Vaugn Denny</a> about the JW Video Player.   And being of the curious sort I had to investigate further.  So I visited the <a href="http://www.longtailvideo.com/players/">JW Player web site.</a> And I was greeted with a page that claimed that they had a video player that would not only play flv files, but wmv files as well.  And with further reading the player claims to have an open API with access to the player events.   Could it be true?</p>
<blockquote><p>One Player to rule them all, One Player to track them,<br />
One Player to bring them all and in the darkness correlate them<br />
In the Land of Analytics where the Shadows lie.</p></blockquote>
<p><img class="aligncenter size-medium wp-image-78" title="theringvx6" src="http://codebynumbers.solutionworks.net/wp-content/uploads/2009/08/theringvx6-300x299.jpg" alt="theringvx6" width="300" height="299" /><br />
<span id="more-76"></span><br />
Almost one player.  There are slightly different versions for the <a href="http://www.longtailvideo.com/players/jw-wmv-player/">wmv player</a> and the <a href="http://www.longtailvideo.com/players/jw-flv-player/">flv players</a>, but it's close enough.   So now the question was, could I take these players and have a unified look and feel to the player on the site and be able to track them the way I wanted/needed to with <a href="http://www.omniture.com">Omniture</a>?</p>
<p>This is important to me since we have tons of content already created for our site that we need to track and we have very limited access to action source tools to be able to leverage the action source code that Omniture has.</p>
<p>I downloaded both versions and set to work.  The wmv version requires that <a href="http://developer.longtailvideo.com/trac/wiki/SilverlightOverview">Silverlight</a> be installed on your web server.  This was a pain free process on my local workstation, but provided a small hicup when testing the code on my dev and prod servers.  <a href="http://learn.iis.net/page.aspx/262/silverlight/">You have to add the silverlight extensions to the available MIME types on the server to get it to run.</a> Once you do that, it is smooth sailing.   Using the demos provided I had a working version of the JW Player running a wmv file and I had access to the event listeners in Firefox, IE, and Safari.</p>
<p>The FLV player was even easier to set up.  As I was working with the flv player I discovered that you could put in a link to your favorite YouTube video in the call, and it would pull the video into the player and let you track it as if it was any other media file on your server.</p>
<p>So using the demo sites I found on the LongTail video site I put together this code sample that is ColdFusion based to pull in the information about the file and then serve up the correct player.</p>
<pre class="brush: plain;">

&lt;cfparam name=&quot;variables.mediaFileExt&quot; default=&quot;&quot;&gt;
&lt;cfparam name=&quot;url.mediaFilePath&quot; default=&quot;&quot;&gt;
&lt;cfparam name=&quot;variables.mediaFileName&quot; default=&quot;&quot;&gt;
&lt;cfparam name=&quot;variables.mediaLocation&quot; default=&quot;&quot;&gt;
&lt;cfparam name=&quot;variables.mediaFilePath&quot; default=&quot;&quot;&gt;
&lt;cfparam name=&quot;variables.mediaFileType&quot; default=&quot;&quot;&gt;
&lt;cfparam name=&quot;variables.mediaPreviewImage&quot; default=&quot;preview.png&quot;&gt;
&lt;cfparam name=&quot;variables.mediaHeight&quot; default=&quot;500&quot;&gt;
&lt;cfparam name=&quot;variables.mediaWidth&quot; default=&quot;700&quot;&gt;

&lt;div id=&quot;videoPlayerDiv&quot;&gt;&amp;nbsp;&lt;/div&gt;

&lt;cfif variables.mediaFileExt EQ &quot;wmv&quot;&gt;

	&lt;cfoutput&gt;
	&lt;!--- windows media files ---&gt;
	&lt;script type=&quot;text/javascript&quot; src=&quot;silverlight.js&quot;&gt;&lt;/script&gt;
	&lt;script type=&quot;text/javascript&quot;  src=&quot;wmvplayer.js&quot;&gt;&lt;/script&gt;
	&lt;script type=&quot;text/javascript&quot;&gt;

		// some variables to save
		var currentPosition = 0;
		var currentBuffer = 0;
		var currentVolume = 80;
		var currentState = &quot;NONE&quot;;
		var defaultState = &quot;NONE&quot;;
		var currentLoad = 0;
		var player;

		// This creates the player after the page has finished loading (onload).
		function createPlayer() {
			var cnt = document.getElementById('videoPlayerDiv');
			var src = &quot;/includes/mediaplayers/wmvplayer.xaml&quot;;
			var cfg = {height:&quot;#variables.mediaHeight#&quot;, width:&quot;#variables.mediaWidth#&quot;, file:&quot;#variables.mediaFilePath#&quot;, autostart:&quot;false&quot;,image:'#variables.mediaPreviewImage#'};
			player = new jeroenwijering.Player(cnt,src,cfg);
			addListeners();
		};
		function addListeners() {
			if(player.view) {
				player.addListener('STATE',stateUpdate);
				player.addListener('TIME',timeUpdate);
			} else {
				setTimeout(&quot;addListeners()&quot;,100);
			}
		};
		// These are the event listeners
		function stateUpdate(ost,nst) {
			currentState = nst;

		    if (defaultState == &quot;NONE&quot;) {
		    	//alert(&quot;started&quot;);
		    	defaultState = &quot;started&quot;;
		    	getTimeValue();
		    }

		     currentTime = getPosValue();
		    if (currentState == &quot;Completed&quot;)
		 	  {
		  		omniMediaTrackingDone('#variables.mediaFileName#');
		  	  }
		    if (currentState == &quot;Playing&quot;)
		 	  {
		  		omniMediaTrackingResume('#variables.mediaFileName#',currentTime);
		  	  }
		    if (currentState == &quot;Paused&quot;)
		 	  {
		  		omniMediaTrackingStop('#variables.mediaFileName#',currentTime);
		  	  }

		};

		function timeUpdate(pos,dur) {
			currentPosition = pos;
			var tmp = document.getElementById(&quot;time&quot;);
			if (tmp) { tmp.innerHTML = pos; }
			var tmp = document.getElementById(&quot;dur&quot;);
			if (tmp) { tmp.innerHTML = dur; }
		};
		// you can not combine the listener events, so the functions below are a workaround to get the length/pos of the video file
		function getTimeValue(){
			var tmp = document.getElementById(&quot;dur&quot;);
			var tv = tmp.innerHTML;
			if (tv == &quot;0&quot;)
				{
				setTimeout(&quot;getTimeValue()&quot;,100);
				}
			else
			{
				omniInitMediaTracking('#variables.mediaFileName#',tv,'#variables.playerName#');
			}
		}

		function getPosValue() {
			var tmp = document.getElementById(&quot;time&quot;);
			var pv = tmp.innerHTML;
			return pv;
		}
	&lt;/script&gt;
	&lt;/cfoutput&gt;
	&lt;div style=&quot;display:none;&quot; id=&quot;buffer&quot;&gt;&lt;/div&gt;
	&lt;div style=&quot;display:none;&quot;  id=&quot;state&quot;&gt;&lt;/div&gt;
	&lt;div style=&quot;display:none;&quot;  id=&quot;time&quot;&gt;&lt;/div&gt;
	&lt;div style=&quot;display:none;&quot;  id=&quot;load&quot;&gt;&lt;/div&gt;
	&lt;div style=&quot;display:none;&quot;  id=&quot;dur&quot;&gt;&lt;/div&gt;
&lt;script&gt;
	setTimeout(&quot;createPlayer()&quot;,500);
&lt;/script&gt;
&lt;cfelse&gt;

&lt;!--- flv &amp; youtube use the same js script code ---&gt;
	&lt;script type=&quot;text/javascript&quot; src=&quot;/includes/mediaplayers/swfobject.js&quot;&gt;&lt;/script&gt;

	&lt;cfoutput&gt;
	&lt;div id=&quot;timevalue&quot; style=&quot;display:none;&quot;&gt;0&lt;/div&gt;
	&lt;div id=&quot;posValue&quot; style=&quot;display:none;&quot;&gt;0&lt;/div&gt;
	&lt;div id=&quot;flashbanner&quot;&gt;this will be replaced by the SWF.&lt;/div&gt;

	&lt;cfif variables.mediaFileExt EQ &quot;yt&quot;&gt;
		&lt;script type='text/javascript'&gt;
		  var so = new SWFObject('/includes/mediaplayers/player.swf','ply','#variables.mediaWidth#','#variables.mediaHeight#','9','##ffffff');
		  so.addParam('allowfullscreen','true');
		  so.addParam('allowscriptaccess','always');
		  so.addParam('wmode','opaque');
		  so.addVariable('file','#variables.mediaFilePath#');
		  so.write('flashbanner');
		&lt;/script&gt;
	&lt;cfelse&gt;
		&lt;script type=&quot;text/javascript&quot;&gt;
		  var so = new SWFObject('/includes/mediaplayers/player.swf','aribaFLVVideoPlayer','#variables.mediaWidth#','#variables.mediaHeight#','9');
		  so.addParam('allowfullscreen','true');
		  so.addParam('flashvars','file=#variables.mediaFilePath#&amp;image=#variables.mediaPreviewImage#');
		  so.write('flashbanner');
		&lt;/script&gt;
	&lt;/cfif&gt;

	&lt;script&gt;
		playerReady();

		var currentPosition = 0;
		var currentVolume = 0;
		var currentMute = false;
		var currentState = &quot;NONE&quot;;
		var defaultState = &quot;NONE&quot;;
		var clipduration = 0;

		var player = document.getElementById('aribaFLVVideoPlayer');

		function playerReady() {
		   var player = document.getElementById('aribaFLVVideoPlayer');
		    addListeners();
		}

		function addListeners() {
		    if (player) {
		        addAllModelListeners();
		    } else {
		        setTimeout(&quot;addListeners()&quot;,100);
		    }
		}

		function addAllModelListeners() {
			 if (typeof player.addModelListener == &quot;function&quot;) {
		         player.addModelListener(&quot;BUFFER&quot;, &quot;doNothing&quot;); //{percentage,id,client,version}.
		         player.addModelListener(&quot;ERROR&quot;, &quot;doNothing&quot;); //{message,id,client,version}.
		         player.addModelListener(&quot;LOADED&quot;, &quot;doNothing&quot;); //{loaded,total,offset,id,client,version}.
		         player.addModelListener(&quot;META&quot;, &quot;doNothing&quot;); //{variable1,variable2,variable3,...,id,client,version}.
		         player.addModelListener(&quot;STATE&quot;, &quot;stateListener&quot;);//{newstate,oldstate,id,client,version}.
		         player.addModelListener(&quot;TIME&quot;, &quot;positionListener&quot;); //{position,duration,id,client,version}.
			}

		}

		function doNothing(obj) { //nothing
		}

		function positionListener(obj) {
		    currentPosition = obj.position;
		     clipduration = obj.duration;
		    var tmp = document.getElementById(&quot;posValue&quot;);
		    if (tmp) { tmp.innerHTML = currentPosition; }
		      var tmp2 = document.getElementById(&quot;timevalue&quot;);
		    if (tmp2) { tmp2.innerHTML = clipduration; }
		}

		function stateListener(obj) {
			oldState = obj.oldstate;

		    if (defaultState == &quot;NONE&quot;) {
		    	//alert(&quot;started&quot;);
		    	defaultState = &quot;started&quot;;
		    	getTimeValue();
		    }
		     currentState = obj.newstate;
		     currentTime = getPosValue();
		    if (currentState == &quot;COMPLETED&quot;)
		 	  {
		  		omniMediaTrackingDone('#variables.mediaFileName#');
		  	  }
		    if (currentState == &quot;PLAYING&quot;)
		 	  {
		  		omniMediaTrackingResume('#variables.mediaFileName#',currentTime);
		  	  }
		    if (currentState == &quot;PAUSED&quot;)
		 	  {
		  		omniMediaTrackingStop('#variables.mediaFileName#',currentTime);
		  	  }

		}

		// you can not combine the listener events, so the functions below are a workaround to get the length/pos of the video file
		function getTimeValue(){
			var tmp = document.getElementById(&quot;timevalue&quot;);
			var tv = tmp.innerHTML;
			if (tv == &quot;0&quot;)
				{
				setTimeout(&quot;getTimeValue()&quot;,100);
				}
			else
			{
				omniInitMediaTracking('#variables.mediaFileName#',tv,'#variables.playerName#');
			}
		}

		function getPosValue() {
			var tmp = document.getElementById(&quot;posValue&quot;);
			var pv = tmp.innerHTML;
			return pv;
		}

	&lt;/script&gt;
	&lt;/cfoutput&gt;
&lt;/cfif&gt;
</pre>
<p>The only workaround the event listeners I had to deal with was tracking the initial play of the video.  The listener events can not be combined in a function, or at least I could not get that to work, so I came up with the solution to let the listeners track the position and duration of the file in a hidden div that I could pull the value from there when I needed it.  Then it is a matter of just calling the JS functions I added to my tracking / omniture page code to pass the data to Omniture.</p>
<p>I am very pleased with this player and the ability I have to track all the video formats we use.   The player also claims that it is skinable and seems easy enough to to that, but I have not tried that yet.</p>
<p>Demo sites:</p>
<ul>
<li><a href="http://home5.inet.tele.dk/nyboe/silverlight/wmvplayer/wmvjavascript.htm">wmv</a></li>
<li><a href="http://www.longtailvideo.com/support/tutorials/Javascript-API-Examples">flv</a></li>
<li><a href="http://www.longtailvideo.com/support/jw-player-setup-wizard?example=5">YouTube</a></li>
</ul>
<blockquote><p>Be sure to read this article by <a href="http://topcweb.com/content/multimedia-tracking-analytics-omniture-jwplayer" target="_blank">Brian Thopsey</a> on how he used the JW player with Omniture too.</p></blockquote>
<p><a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.rudishumpert.com%2F2009%2F08%2F19%2Fone-player-to-rule-them-all%2F&amp;linkname=One%20Player%20to%20Rule%20Them%20All%26%238230%3B" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.rudishumpert.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.rudishumpert.com%2F2009%2F08%2F19%2Fone-player-to-rule-them-all%2F&amp;linkname=One%20Player%20to%20Rule%20Them%20All%26%238230%3B" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.rudishumpert.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a> <a href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.rudishumpert.com%2F2009%2F08%2F19%2Fone-player-to-rule-them-all%2F&amp;linkname=One%20Player%20to%20Rule%20Them%20All%26%238230%3B" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.rudishumpert.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.rudishumpert.com%2F2009%2F08%2F19%2Fone-player-to-rule-them-all%2F&amp;linkname=One%20Player%20to%20Rule%20Them%20All%26%238230%3B" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.rudishumpert.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save">Share/Save</a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.rudishumpert.com/2009/08/19/one-player-to-rule-them-all/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
