<?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; Hierarchies</title>
	<atom:link href="http://www.rudishumpert.com/tag/hierarchies/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>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>
	</channel>
</rss>
