<?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; Google Mini</title>
	<atom:link href="http://www.rudishumpert.com/tag/google-mini/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>Pathing:  Internal Search Analysis.  (not just for page views)</title>
		<link>http://www.rudishumpert.com/2009/10/16/pathing-internal-search/</link>
		<comments>http://www.rudishumpert.com/2009/10/16/pathing-internal-search/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 15:35:21 +0000</pubDate>
		<dc:creator>Rudi</dc:creator>
				<category><![CDATA[Code Snipets]]></category>
		<category><![CDATA[Omniture]]></category>
		<category><![CDATA[Web Analytics]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Google Mini]]></category>
		<category><![CDATA[Search Analysis]]></category>

		<guid isPermaLink="false">http://www.rudishumpert.com/?p=252</guid>
		<description><![CDATA[When I was at the Omniture training class a few weeks back, the instructor mentioned that an advantage of storing the internal search terms in a s.prop was that you could get pathing enabled on the s.prop and you would then be able to see not only what your visitors were searching on, but how [...]]]></description>
			<content:encoded><![CDATA[<p>When I was at the Omniture training class a few weeks back, the instructor mentioned that an advantage of storing the internal search terms in a s.prop was that you could get pathing enabled on the s.prop and you would then be able to see not only what your visitors were searching on, but how they refined their search.</p>
<blockquote><p><strong>Note:</strong> After you choose which s.prop you are going to use to store/capture the data in, you will need to contact Omniture Client Care to get pathing enabled for that s.prop</p></blockquote>
<div id="attachment_254" class="wp-caption aligncenter" style="width: 610px"><img class="size-full wp-image-254" title="Where does your path take you?" src="http://www.rudishumpert.com/wp-content/uploads/2009/10/pathing.jpg" alt="pathing" width="600" height="361" /><p class="wp-caption-text">Where does your path take you?</p></div>
<p><span id="more-252"></span><br />
In a previous post, I went over how we capture the search terms from the Google Mini.   So when I returned from the training, I contacted client care and had then enable pathing on the s.prop and "Shazam!".  We now have pathing on the internal search terms.</p>
<p>This has been working great, and I've been really pleased with being able to see exactly how visitors refine their searches.  Recently, I had the opportunity to chat with Susan Fariss, at the American Chemical Society (<a href="http://twitter.com/soozantf">@soozantf)</a> about search analytics and the questions came up on do we know where the user was on the site when they initiated the search and then what search result did they click on.. if any?   Well... I did not have those answers, but I sure wanted to.</p>
<p>So the question was could the following be accomplished:</p>
<ul>
<li>Detect/capture where visitor was on the web site when the search was initiated</li>
<li>Modify the google mini xslt to tag all of the search results so that the result clicked could be captured</li>
<li>Would this provide the full search pathing expected</li>
</ul>
<p><strong>Detect/capture where visitor was on the web site when the search was initiated:</strong><br />
This was the easy part of the adventure for sure.  I already had a JavaScript function handling the initial search, so I added another function call in that</p>
<pre class="brush: plain;">
			function recordInternalSearchOmniture(){
				var s = s_gi(s_account);
				s.linkTrackVars=&quot;prop1&quot;;
				s.prop1 = s.pageName;
				s.tl(document.location.href,'o','InternalSearch');
				s.linkTrackVars=&quot;&quot;;
			}
</pre>
<p>This code snippet simply pulls the s.pageName and puts it into the same s.prop used to store the actual search terms, creating the "entry point" of our search path.</p>
<p><strong>Modify the google mini xslt to tag all of the search results so that the result clicked could be captured:</strong><br />
This proved to be the pesky part of the adventure.  The challenge was to be able to add the jQuery function to tag the search results someplace where the Google xslt could access it.  After a few missteps I added the jQuery to a main .js file (not the s_code.js) that I was able to link to inside the xslt.   But first I needed to add a div with a specific Id to the xslt so that I would be able to tag the results with the tracking codes.  So inside the xslt I did the following.</p>
<pre class="brush: plain;">
&lt;!-- **********************************************************************
 Search results (do not customize)
     ********************************************************************** --&gt;
.
.
.
&lt;div id=&quot;googleSearch&quot;&gt;
&lt;!-- *** Customer's own result page header *** --&gt;
.
.
&lt;!-- *** HTML footer *** --&gt;
&lt;/div&gt;
</pre>
<p>So find the section that says "Search results (do not customize)"  <img src='http://www.rudishumpert.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  - I viewed this as more of a suggestion than a hard rule.  Inside this section, wrap the header/footer items with a new div with the id of "googleSearch" (or some other id of your choosing).  This is needed so that the jQuery function can find the elements that need the new tags.  Once that div is in place add a jQuery function to find all results in that div and tag them.  The first function below binds a function call to the a href tags in the search results.  The second function does pulls in the location of the search results and records where the user clicked.  This provides the "exit point" to our path.</p>
<pre class="brush: plain;">
$(document).ready(function(){
$('#googleSearch a').each(function(i) {
  var hrefval = $(this).attr('href');
  $(this).bind('click',function (event){
  	omniGoogleSearchResultClicked('Search Result Clicked',hrefval)
  	});
});
.
.
function omniGoogleSearchResultClicked(propTitle,hrefVal){
	var s = s_gi(s_account);
	s.linkTrackVars=&quot;prop1&quot;;
	s.prop1 = hrefVal;
	s.tl(document.location.href,'o',propTitle);
	s.linkTrackVars=&quot;&quot;;
}
</pre>
<p><strong>Would this provide the full search pathing expected:</strong><br />
Yes!  This does indeed provide a full search path.</p>
<div id="attachment_263" class="wp-caption aligncenter" style="width: 279px"><a href="http://www.rudishumpert.com/2009/09/02/i-loathe-ie-6/"><img class="size-full wp-image-263" title="It is true!" src="http://www.rudishumpert.com/wp-content/uploads/2009/10/searchpathing.png" alt="It is true!" width="269" height="134" /></a><p class="wp-caption-text">I knew IE6 was evil!</p></div>
<p style="text-align: center;">
<p>Ok..  so maybe I changed the actual values, but this is the type of search pathing you can achieve with tracking the entry and exit points in the same s.prop as the search terms and having pathing enabled on that s.prop.</p>
<p>-Rudi</p>
<p><a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.rudishumpert.com%2F2009%2F10%2F16%2Fpathing-internal-search%2F&amp;linkname=Pathing%3A%20%20Internal%20Search%20Analysis.%20%20%28not%20just%20for%20page%20views%29" 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%2F16%2Fpathing-internal-search%2F&amp;linkname=Pathing%3A%20%20Internal%20Search%20Analysis.%20%20%28not%20just%20for%20page%20views%29" 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%2F16%2Fpathing-internal-search%2F&amp;linkname=Pathing%3A%20%20Internal%20Search%20Analysis.%20%20%28not%20just%20for%20page%20views%29" 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%2F16%2Fpathing-internal-search%2F&amp;linkname=Pathing%3A%20%20Internal%20Search%20Analysis.%20%20%28not%20just%20for%20page%20views%29" 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/16/pathing-internal-search/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Capture Search Terms From Your Google Mini into Omniture</title>
		<link>http://www.rudishumpert.com/2009/08/26/capture-search-terms-from-your-google-mini-into-omniture/</link>
		<comments>http://www.rudishumpert.com/2009/08/26/capture-search-terms-from-your-google-mini-into-omniture/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 14:16:36 +0000</pubDate>
		<dc:creator>Rudi</dc:creator>
				<category><![CDATA[Code Snipets]]></category>
		<category><![CDATA[Omniture]]></category>
		<category><![CDATA[Web Analytics]]></category>
		<category><![CDATA[Google Mini]]></category>
		<category><![CDATA[Site Catalyst]]></category>
		<category><![CDATA[Web Analystics]]></category>

		<guid isPermaLink="false">http://www.rudishumpert.com/?p=97</guid>
		<description><![CDATA[Yesterday, saw a twitter from @omtrdeveloper about tracking Google Site Search in Omniture.  This reminded me that I needed to do that for our site, except we do not use the Google Site Search, we use the Google Mini Search Appliance.

Here are the steps I took to integrate/capture the search terms into Site Catalyst.
Step 1.  [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday, saw a twitter from <a href="http://twitter.com/omtrdeveloper" target="_blank">@omtrdeveloper</a> about tracking Google Site Search in Omniture.  This reminded me that I needed to do that for our site, except we do not use the Google Site Search, we use the Google Mini Search Appliance.</p>
<p><img class="aligncenter size-medium wp-image-96" title="Google Mini" src="http://www.rudishumpert.com/wp-content/uploads/2009/08/google-mini-300x225.jpg" alt="Google Mini" width="300" height="225" /></p>
<p>Here are the steps I took to integrate/capture the search terms into Site Catalyst.</p>
<p>Step 1.  Locate and backup your searchtemplate.xslt file.</p>
<p>Step 2.  In the section of the code that has the sections labeled "(can be customized)" add this code block.</p>
<pre class="brush: plain;">
&lt;!-- **********************************************************************
 Omniture SiteCatalyst code (can be customized)
 ********************************************************************** --&gt;

&lt;xsl:template name=&quot;sitecatalyst&quot;&gt;
 &lt;xsl:param name=&quot;query&quot;/&gt;
 &lt;xsl:param name=&quot;matches&quot;/&gt;
 &lt;xsl:comment&gt;
 SiteCatalyst : Google Mini Search Integration
 &lt;/xsl:comment&gt;
 &lt;script language=&quot;JavaScript&quot; type=&quot;text/javascript&quot; src=&quot;INSERT-DOMAIN-AND-PATH-TO-CODE/s_code.js&quot;&gt;&lt;/script&gt;
 &lt;script language=&quot;JavaScript&quot; type=&quot;text/javascript&quot;&gt;
 &lt;xsl:comment&gt;
 s.eVar1=&quot;&lt;xsl:value-of select='$query'/&gt;&quot;
 var s_code=s.t();if(s_code)document.write(s_code)
 &lt;/xsl:comment&gt;
 &lt;/script&gt;
 &lt;script language=&quot;JavaScript&quot; type=&quot;text/javascript&quot;&gt;
 &lt;xsl:comment&gt;
 if(navigator.appVersion.indexOf('MSIE')&gt;=0)
 document.write(&quot;unescape('%3C')+'!-'+'-'&quot;)
 &lt;/xsl:comment&gt;
 &lt;/script&gt;
 &lt;xsl:comment&gt;
 End SiteCatalyst : Google Mini Search Integration
 &lt;/xsl:comment&gt;
&lt;/xsl:template&gt;
</pre>
<p>NOTES:<br />
1. Replace the"INSERT-DOMAIN-AND-PATH-TO-CODE" with the location where you uploadedthe s_code.js file:<br />
2. Be sure to use an absolute path.  http://www.rudishumpert.com/subfolder/s_code.js<br />
3. Code above assumes you are using s.prop1.  Change value as needed.</p>
<p>Step 3.  Next, locate the XSL template named, search_results.</p>
<pre class="brush: plain;">
&lt;!-- **********************************************************************
Search results (do not customize)
 ********************************************************************** --&gt;
&lt;xsl:template name=&quot;search_results&quot;&gt;
...
...
&lt;body onLoad=&quot;resetForms()&quot; dir=&quot;ltr&quot;&gt;
</pre>
<p>and place the following code  opening &lt;body&gt; tag:</p>
<pre class="brush: plain;">
 &lt;!-- *** Add Omniture SiteCatalyst code *** --&gt;
 &lt;xsl:choose&gt;
 &lt;xsl:when test=&quot;RES&quot;&gt;
 &lt;xsl:call-template name=&quot;sitecatalyst&quot;&gt;
 &lt;xsl:with-param name=&quot;query&quot; select=&quot;Q&quot;/&gt;
 &lt;/xsl:call-template&gt;
 &lt;/xsl:when&gt;
 &lt;xsl:otherwise&gt;
 &lt;xsl:call-template name=&quot;sitecatalyst&quot;&gt;
 &lt;xsl:with-param name=&quot;query&quot; select=&quot;Q&quot;/&gt;
 &lt;/xsl:call-template&gt;
 &lt;/xsl:otherwise&gt;
 &lt;/xsl:choose&gt;
</pre>
<p>Step 4.  Deploy code to test/production making sure to backup a copy of your existing XSLT template (just in case).</p>
<p>You should now be able to see the search terms being passed to Omniture using your debugging tool of choice.</p>
<p>-Rudi</p>
<p>EDIT:  changed the Omniture variable used from prop1 to evar1 so we could add sub relations to the element.</p>
<p><a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.rudishumpert.com%2F2009%2F08%2F26%2Fcapture-search-terms-from-your-google-mini-into-omniture%2F&amp;linkname=Capture%20Search%20Terms%20From%20Your%20Google%20Mini%20into%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%2F08%2F26%2Fcapture-search-terms-from-your-google-mini-into-omniture%2F&amp;linkname=Capture%20Search%20Terms%20From%20Your%20Google%20Mini%20into%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%2F08%2F26%2Fcapture-search-terms-from-your-google-mini-into-omniture%2F&amp;linkname=Capture%20Search%20Terms%20From%20Your%20Google%20Mini%20into%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%2F08%2F26%2Fcapture-search-terms-from-your-google-mini-into-omniture%2F&amp;linkname=Capture%20Search%20Terms%20From%20Your%20Google%20Mini%20into%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/08/26/capture-search-terms-from-your-google-mini-into-omniture/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
