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

<channel>
	<title>Web Analytics Land &#187; code</title>
	<atom:link href="http://webanalyticsland.com/sitecatalyst-implementation/tag/code/feed" rel="self" type="application/rss+xml" />
	<link>http://webanalyticsland.com</link>
	<description>Omniture SiteCatalyst Implementation Optimization.</description>
	<lastBuildDate>Wed, 04 Apr 2012 04:00:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Google Changes Referrer Values Again For Secure Searches</title>
		<link>http://webanalyticsland.com/sitecatalyst-implementation/google-changes-referrer-values-again-for-secure-searches</link>
		<comments>http://webanalyticsland.com/sitecatalyst-implementation/google-changes-referrer-values-again-for-secure-searches#comments</comments>
		<pubDate>Tue, 20 Mar 2012 07:41:30 +0000</pubDate>
		<dc:creator>VaBeachKevin</dc:creator>
				<category><![CDATA[SiteCatalyst Implementation]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[enhancements]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[omniture]]></category>
		<category><![CDATA[Referrers]]></category>
		<category><![CDATA[secure]]></category>
		<category><![CDATA[s_code.js]]></category>

		<guid isPermaLink="false">http://webanalyticsland.com/?p=761</guid>
		<description><![CDATA[Over the past 6 months Google has made changes to their search experience in an attempt to increase the privacy and security of their signed in users. What this has meant for analytics tools is that the referring URL for those signed in users was stripped of any searched keywords when clicking on Google organic [...]]]></description>
			<content:encoded><![CDATA[<p>Over the past 6 months Google has made <a href="http://googleblog.blogspot.com/2011/10/making-search-more-secure.html" title="Making search more secure" target="_blank">changes</a> to their search experience in an attempt to increase the privacy and security of their signed in users. What this has meant for analytics tools is that the referring URL for those signed in users was stripped of any searched keywords when clicking on Google organic search results. </p>
<p>Here&#8217;s what has been happening behind the scenes. All signed in users are now on a secure version of Google (https), and a redirect has been added to each search results click. That redirect is to a non-secure page (http), where the referring URL is changed before the visitor arrives at the page they requested. That new referring URL value has had its keywords removed, but still contains enough information to determine it was a Google Secure search. Workarounds were created to help <a href="http://www.keystonesolutions.com/community/2011/10/tracking-google-secure-search-in-sitecatalyst/" title="Tracking Google Secure Search in SiteCatalyst" target="_blank">identify a Google Secure search in SiteCatalyst keyword reporting</a>, as well as <a href="http://blogs.omniture.com/2011/10/19/the-impact-of-google-encrypted-search/" title="The Impact of Google Encrypted Search" target="_blank">Omniture making a change</a> to try and account for those searches. </p>
<p>Since making that change Google has determined that the additional redirect is unnecessary and potentially slowed down the users experience, so they have decided to eliminate it (unfortunately that does not mean analytics tools will be able to see those keywords again).</p>
<p>Today <a href="http://googlewebmastercentral.blogspot.com/2012/03/upcoming-changes-in-googles-http.html" title="Upcoming changes in Google’s HTTP Referrer" target="_blank">Google announced a change</a> to the way they plan on handling referring URL’s starting in April 2012. Google has decided that they will now begin to use the <a href="http://wiki.whatwg.org/wiki/Meta_referrer" title="Meta Referrer" target="_blank">referrer meta tag</a> for browsers that will support it, as opposed to the redirect to the non secure page. Currently the only major browser that supports it is Google Chrome. </p>
<p>If you are not familiar with the referrer meta tag, what it does is it lets each web page decide how referrer from it should be handled. For example, here&#8217;s what a meta referrer tag looks like:</p>
<pre class="brush: jscript">
&lt;meta name=&quot;referrer&quot; content=&quot;never&quot;&gt;
</pre>
<p>What this tag will do is that it tells the browser to never pass any referring information from the page its on. The browser should then set the referrer header value to a blank string for referrers from that page.</p>
<p>Fortunately Google is not going to that extreme. They have decided to use the &#8220;origin&#8221; value:</p>
<pre class="brush: jscript">
&lt;meta name=&quot;referrer&quot; content=&quot;origin&quot;&gt;
</pre>
<p>This is the referrer meta tag value that Google will begin to use in April 2012. When the change goes live, all search clicks from signed in users will now only have the referrer value of <strong>https://www.google.com/</strong>. There will be no other information in the referring URL, so no way to determine that it was specifically a Google secure search other than the URL being simply that host value. Non-secure searches, ones made from a user not logged into a Google account, will continue to function in the same way as they do now.</p>
<p>Currently the referrer meta tag is not currently supported in all browsers. I tried it using Chrome 17 and it is working. Testing it in Safari 5.1.4 and Firefox 11, the referrer meta tag has no impact.  </p>
<p>So what does this mean as far as SiteCatalyst reporting? According to the <a href="http://omniture.custhelp.com/app/answers/detail/a_id/5329" title="How does SiteCatalyst determine that a referrer comes from a search engine to populate the Search Keywords report and the Search Engines reports?" target="_blank">Knowledge Base answer #5329</a>, <em>&#8220;If the domain of the referrer corresponds to that of a recognized search engine (e.g. &#8220;google.com&#8221;) and contains the recognized search keyword query parameter for the given search engine domain (e.g. for Google this is &#8220;q=&#8221;), then the referrer is considered a search engine, and the value of the keyword query parameter is taken as the search keyword.&#8221;</em> So no search keyword query parameter, no search is counted. Currently for a Google secure search, the parameter is still there, but it&#8217;s unpopulated. Now Google plans to remove it all together.</p>
<p>Hopefully before Google rolls this out publicly Adobe will come up with a solution for SiteCatalyst so there are no interruptions in the Search Engine reporting. If Adobe does not get to it in time, or if Google decides to push the change out before April, then a couple of lines of code added to your s_code.js file will keep the impact to a minimum while Adobe works out a solution.</p>
<pre class="brush: jscript">
if(document.referrer==&quot;https://www.google.com/&quot;){
	s.referrer=&quot;https://www.google.com/?q=google%20secure%20search&quot;;
}
</pre>
<p>What this will do is look for a referrer with the exact value of https://www.google.com/ and append a q= value to it with the keyword of <strong>google secure search</strong>. If the .com version of Google is not the one most used by your visitors, then just replace it with the correct tld version applicable to your site. This snippet of code will make sure the search is still counted, and you will continue to keep the same level of reporting that you have now.</p>
<p><strong>UPDATE: If your your visitors are coming to your site from multiple country specific versions of Google, then I have you covered. Just include this plugin in your s_code file and all Google secure searches from every Google domain will automatically be handled. All you need to do is cut and paste.</strong></p>
<pre class="brush: jscript">
s.getGoogle=new Function(&quot;&quot;
+&quot;var s=this,a=document.referrer,b=a.split(&#039;/&#039;)[3],c=a.substring(0,19&quot;
+&quot;);a&amp;&amp;26&gt;=a.length&amp;&amp;(b||c==&#039;https://www.google.&#039;&amp;&amp;(this.s.referrer=a&quot;
+&quot;+&#039;?q=google%20secure%20search&#039;));return this.s.referrer&quot;)();
</pre>
<p>enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://webanalyticsland.com/sitecatalyst-implementation/google-changes-referrer-values-again-for-secure-searches/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>How To Improve Referring Domain Reporting In SiteCatalyst</title>
		<link>http://webanalyticsland.com/sitecatalyst-implementation/improve-referring-domain-reporting-in-sitecatalyst</link>
		<comments>http://webanalyticsland.com/sitecatalyst-implementation/improve-referring-domain-reporting-in-sitecatalyst#comments</comments>
		<pubDate>Tue, 13 Mar 2012 13:00:38 +0000</pubDate>
		<dc:creator>VaBeachKevin</dc:creator>
				<category><![CDATA[SiteCatalyst Implementation]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[implementation]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[referring domains]]></category>
		<category><![CDATA[reports]]></category>
		<category><![CDATA[sitecatalyst]]></category>

		<guid isPermaLink="false">http://webanalyticsland.com/?p=714</guid>
		<description><![CDATA[While going over my Traffic Sources reports recently, I realized that I had a problem with how my referrers were reported. Not a problem with bad data coming into SiteCatalyst, like the recent issue I fixed regarding the Google Plus referrers, but this was a problem with the Referrers and Referring Domains reports themselves.
Both reports [...]]]></description>
			<content:encoded><![CDATA[<p>While going over my Traffic Sources reports recently, I realized that I had a problem with how my referrers were reported. Not a problem with bad data coming into SiteCatalyst, like the recent issue I fixed regarding the <a href="http://webanalyticsland.com/sitecatalyst-implementation/fix-google-plus-referrer-values-in-sitecatalyst" title="How To Fix Google Plus Referrer Values In SiteCatalyst">Google Plus referrers</a>, but this was a problem with the Referrers and Referring Domains reports themselves.</p>
<p>Both reports are working as they were designed, but the problem is that both reports are on opposite ends of the spectrum from one another. I feel that at times the Referrers report gives me too much information, while the Referring Domains report doesn&#8217;t give me enough. I need a something a bit more in the middle. </p>
<p>Here&#8217;s an example of the problem. Checking the Referring Domain report in SiteCatalyst, this is a snippet of what I see:<br />
<img src="http://webanalyticsland.com/images/referring_domains_report.png" alt="Referring Domains Report in SiteCatalyst" /> </p>
<p>I can see that some of my visitors came from Google, and some from Yahoo, and that&#8217;s all this report tells me. When I see something like that, I start to wonder which sections of the referring site lead to the visitors deciding to come to my site. Well, the first thing I could do in an attempt to answer my question would be to click the magnifying glass icon next to each line item in the Referring Domains report to get a quick view of what referrers specifically mades up that value. Unfortunately the little popup window doesn&#8217;t break out the referrers in any kind of a useful way, and I can&#8217;t do anything with that popup report myself because there is no export option in that window, so that option&#8217;s out. I could do a standard sub-relation breakdown of the two reports, then export the results into Excel, then do some sorting and filtering and could probably get the answer I need for a single Referring Domain value in roughly 5 to 10 minutes. But then I&#8217;m stuck having to go back and do that whole process again for the other Referring Domains. This method could end up taking a while, so this option is also out. I&#8217;m sure I could whip something up in Data Warehouse, but I won&#8217;t see that report anytime soon either. I could go set up a ton of Processing Rules, but that won&#8217;t work because I would end up using all the rules just to help me  populate one variable. So how do I get the report I need? Looks like it time for some more s_code magic. </p>
<p>And voilà. I give to you the <strong>s.getFullReferringDomains</strong> plugin. What this will do is look at that referrer  value and grab not only the domain name, but any subdomains it may have as well. This uses the same s.linkInternalFilters values that you&#8217;ve already set up to ensure that this will only set its value when there is an external referrer. So now I will get a better, quicker, easier look at my referring domains:<br />
<img src="http://webanalyticsland.com/images/full_referring_domains.png" alt="Full Referring Domains Report in SiteCatalyst" /> </p>
<p>All that needs to be done is to choose an unused variable, and call the plugin from it. This should be placed inside of the doPlugins section of the s_code.js file.</p>
<pre class="brush: jscript">
s.eVar1 = s.getFullReferringDomains();
</pre>
<p>Then just add the plugin itself to the plugins section of your s_code file.</p>
<pre class="brush: jscript">
/*
 * Get Full Referring Domains
 */
s.getFullReferringDomains=new Function(&quot;&quot;
+&quot;var s=this,dr=window.document.referrer,n=s.linkInternalFilters.spli&quot;
+&quot;t(&#039;,&#039;);if(dr){var r=dr.split(&#039;/&#039;)[2],l=n.length;for(i=0;i&lt;=l;i++){i&quot;
+&quot;f(r.indexOf(n[i])!=-1){r=&#039;&#039;;i=l+1;}}return r}&quot;);
</pre>
<p>One last thing I like to do with this new report is to go into the Report Suite manager in the Admin Console, and move it to the Traffic sources menu. This way all of your referrer related reports will all live in one spot. It looks like it should have lived there all along.</p>
<p><img src="http://webanalyticsland.com/images/full_referring_domains_menu.png" alt="Full Referring Domains Traffic Sources Report in SiteCatalyst" /> </p>
<p>enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://webanalyticsland.com/sitecatalyst-implementation/improve-referring-domain-reporting-in-sitecatalyst/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Capture Mobile Device Screen Orientation In SiteCatalyst</title>
		<link>http://webanalyticsland.com/sitecatalyst-implementation/capture-mobile-device-screen-orientation-in-sitecatalyst</link>
		<comments>http://webanalyticsland.com/sitecatalyst-implementation/capture-mobile-device-screen-orientation-in-sitecatalyst#comments</comments>
		<pubDate>Sat, 19 Nov 2011 02:24:17 +0000</pubDate>
		<dc:creator>VaBeachKevin</dc:creator>
				<category><![CDATA[SiteCatalyst Implementation]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[implementation]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[omniture]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[reports]]></category>
		<category><![CDATA[sitecatalyst]]></category>

		<guid isPermaLink="false">http://webanalyticsland.com/?p=647</guid>
		<description><![CDATA[Recently I was speaking to someone who was in the process of creating an tablet experience for their visitors. At one point they asked the question &#8220;of my iPad visitors, how do I find out in what format do they view my site the most in, landscape or portrait?&#8221;. I started going through all of [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I was speaking to someone who was in the process of creating an tablet experience for their visitors. At one point they asked the question &#8220;of my iPad visitors, how do I find out in what format do they view my site the most in, landscape or portrait?&#8221;. I started going through all of the reports in SiteCatalyst and tried to find the answer, but that information just was not available. So I decided to whip a little bit of code that would figure this out for us. I call this the screenOrientation plug-in.  </p>
<p>Basically what this will do is it will check to see in what position the mobile visitor is viewing the site in, whether they are viewing the site in a portrait or a landscape view when the page loads, and capture that value into a SiteCatalyst variable. </p>
<p>To implement this plug-in you first need to take this code, and add it to your s_code file near the rest of your plug-ins.</p>
<pre class="brush: jscript">
function screenOrientation(){switch(window.orientation){case 0:case 180:return(&quot;Portrait&quot;);break;case 90:case -90:return(&quot;Landscape&quot;);}window.scroll(0,0)}
</pre>
<p>Next in the do_plugins section of the s_code file, add the call to the plug-in to what ever SiteCatalyst variable you want this data captured in. In the example here you can see I am capturing it in s.prop1</p>
<pre class="brush: jscript">
s.prop1=screenOrientation();
</pre>
<p>Thats all it takes. Once the code is implemented, if the device does not have an orientation value the variable will not capture anything, but if the visitor is on a mobile device with an orientation value, the value of Landscape or Portrait will be captured on each page load. You will end up with a report that looks something like this:<br />
<br />
<img alt="Mobile Screen Orientation Report" src="http://webanalyticsland.com/images/so2.jpg" title="Mobile Screen Orientation Report" class="alignnone" width="796" height="406" /><br />
<br />
To make it easier to access the report I also moved it into the Mobile report menu by using the customize menus option in the admin console of SiteCatalyst.<br />
<br />
<img alt="SiteCatalyst Mobile Reports" src="http://webanalyticsland.com/images/so11.png" title="SiteCatalyst Mobile Reports" class="alignnone" width="485" height="354" /></p>
<p>enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://webanalyticsland.com/sitecatalyst-implementation/capture-mobile-device-screen-orientation-in-sitecatalyst/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Capture A Query String Parameter From A Referring URL In SiteCatalyst</title>
		<link>http://webanalyticsland.com/sitecatalyst-implementation/capture-query-string-parameter-from-referring-url</link>
		<comments>http://webanalyticsland.com/sitecatalyst-implementation/capture-query-string-parameter-from-referring-url#comments</comments>
		<pubDate>Thu, 31 Mar 2011 02:13:42 +0000</pubDate>
		<dc:creator>VaBeachKevin</dc:creator>
				<category><![CDATA[SiteCatalyst Implementation]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[implementation]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[sitecatalyst]]></category>
		<category><![CDATA[s_code.js]]></category>
		<category><![CDATA[tracking]]></category>

		<guid isPermaLink="false">http://webanalyticsland.com/?p=617</guid>
		<description><![CDATA[Recently someone had asked the question, how do I capture a query string parameter that&#8217;s on referring URL? We all know how to grab a query string parameter from the current page URL by using the getQueryParam SiteCatalyst plug-in, but most people don&#8217;t know that plug-in can be used to get a query string parameter [...]]]></description>
			<content:encoded><![CDATA[<p>Recently someone had asked the question, <em>how do I capture a query string parameter that&#8217;s on referring URL?</em> We all know how to grab a query string parameter from the current page URL by using the <a href="http://webanalyticsland.com/sitecatalyst-plugins/getqueryparam/">getQueryParam SiteCatalyst plug-in</a>, but most people don&#8217;t know that plug-in can be used to get a query string parameter from the referring URL as well. I once had a real unique implementation that was not using that plug-in and needed to capture that value. I wanted to keep the implementation really light so I decided to give it a try using a smaller bit of code. I broke out a little JavaScript magic to see if I could make it happen simpler than using that plug-in. Turns out it&#8217;s not too difficult to accomplish, in fact I got it down to just a single line of code.<br />
</p>
<pre class="brush: jscript">
function getRefQueryParam(a){a=a.replace(/[\[]/,&quot;\\[&quot;).replace(/[\]]/,&quot;\\]&quot;);a=RegExp(&quot;[\\?&amp;]&quot;+a+&quot;=([^&amp;#]*)&quot;).exec(document.referrer);return a==null?&quot;&quot;:a[1]};
</pre>
<p>
Its a little function called getRefQueryParam. To use it just place that code in your s_code file, and then call it with the name of the query string parameter you want to capture. In this example I want to capture the value of the parameter forumID= from the referring URL and record it in s.prop1.<br />
</p>
<pre class="brush: jscript">
s.prop1=getRefQueryParam(&#039;forumID&#039;);
</pre>
<p>
With a little JavaScript goodness it is an easy value to capture.<br />
<br />
Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://webanalyticsland.com/sitecatalyst-implementation/capture-query-string-parameter-from-referring-url/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Stop Google Preview From Being Counted In SiteCatalyst &#8211; Updated</title>
		<link>http://webanalyticsland.com/sitecatalyst-implementation/how-to-stop-google-preview-from-being-counted-in-sitecatalyst</link>
		<comments>http://webanalyticsland.com/sitecatalyst-implementation/how-to-stop-google-preview-from-being-counted-in-sitecatalyst#comments</comments>
		<pubDate>Wed, 17 Nov 2010 04:23:40 +0000</pubDate>
		<dc:creator>VaBeachKevin</dc:creator>
				<category><![CDATA[SiteCatalyst Implementation]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[implementation]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[omniture]]></category>
		<category><![CDATA[reports]]></category>
		<category><![CDATA[sitecatalyst]]></category>
		<category><![CDATA[s_code.js]]></category>
		<category><![CDATA[tracking]]></category>

		<guid isPermaLink="false">http://webanalyticsland.com/?p=451</guid>
		<description><![CDATA[UPDATE: I have a much better way to block the Google Web Preview bot from being tracked as a visitor in SiteCatalyst. The original solution I had posted here, required a block of code to be placed at the very top of the s_code file, and your account ID was put into a function call. [...]]]></description>
			<content:encoded><![CDATA[<p><strong>UPDATE:</strong> <em>I have a much better way to block the Google Web Preview bot from being tracked as a visitor in SiteCatalyst. The original solution I had posted here, required a block of code to be placed at the very top of the s_code file, and your account ID was put into a function call. Then when the s_code was fired, a function would first check the user agent of the visitor to see if it was the Google Web Preview bot, and if so then swap out the account ID with a blank value. The SiteCatalyst code would still fire, but when Omniture received the image request it would get discarded because of the missing account ID. The more I thought about this I figured there had to be a better way. No reason to execute all the s_code javascript and fire off the beacon call when I don&#8217;t want that visitor (Google) to be tracked. So after a little brainstorming I came up with a new and improved way to do this. Now when the user agent is determined to be the Google Web Preview bot, then the SiteCatalyst code is prevented from even firing (how it should have been originally). Even better, this can now be done by simply adding a tiny bit of code to the plugin&#8217;s section of your s_code file, right next to all your other plugin code. Thats it. No other changes need to happen. No code at the top of the page, no adding calls to functions in the account variable. Just cut, paste, and done.</p>
<p>Here is the code. Just add this right next to all of your other plugins.</em></p>
<pre class="brush: jscript">
/*
 *  Block the Google Web Preview Bot from firing SiteCatalyst code
 */
if(s.u.toLowerCase().indexOf(&#039;google web preview&#039;)!=-1){s.t=function(){}}
</pre>
<p><em>If you are using the original version from below make sure you remove it. And as with any code, make sure you fully test it before deploying to a live site.<br />
<strong>~kevin</strong></em></p>
<p>Google Instant Preview, designed to show you a visual preview of your search results, rolled out in early November 2010. You now have the ability to click a small magnifying glass icon next to each search result to get a snapshot of what the page looks like.<br />
<img src="http://webanalyticsland.com/images/google-preview.jpg" alt="Google Instant Preview" /><br />
<br />
Seems like a pretty helpful feature, but how do they do it? Well it would appear that Google has a new spider that crawls the web and takes snapshots of each page in its results. In order for them to get an accurate look at what the page looks like, this new bot needs to able to execute JavaScript. Here is the problem. Since it is executing JavaScript that means it is also firing off the SiteCatalyst code and is being counted as another visitor and is registering page views.<br />
<br />
How can you tell if this new Google Web Preview bot hit your site? If you are capturing User Agent you can see it show up in that report:<br />
<img src="http://webanalyticsland.com/images/user-agent-report.jpg" alt="User Agent Report" /><br />
<br />
<em><strong>NOTE: If you are not capturing user agent and would like to, a super simple way would be to use the <a href="http://blogs.omniture.com/2009/11/24/trimming-the-fat-with-dynamic-variables/">SiteCatalyst Dynamic Variable</a> functionality and include s.eVarX=&#8221;D=User-Agent&#8221;; in your s_code.js file. Just insert the number of the eVar you would like to use (a s.prop would work too) and you are all set.</strong></em><br />
<br />
Another way to see if you are being affected with spider traffic in your report suite from the Google Preview Bot would be to check out a Browser report (Visitor Profile > Technology > Browsers) and filter it to only show visitors using Safari 3.1 and then trend it.<br />
<img src="http://webanalyticsland.com/images/browser-report.jpg" alt="Browser Report" /><br />
We can see that this report suite has recorded about an additional 15,000 visitors over the last week that is just attributed to Safari 3.1. Checking the User Agent we saw earlier, the Google Web Preview bot is registering itself as Safari 3.1.<br />
<br />
Now that we can see that the Google Web Preview bot is having an effect on our traffic how do we get rid of it? We could block that bot in our robots.txt file, but I like having that additional functionality available for my visitors in the Google search results. I just don&#8217;t want it to execute my SiteCatalyst code. Well here is how to do it.<br />
<br />
I call this my <strong>bot detection code</strong> (real catchy title, right?). I currently have it just set to look for the Google Web Preview bot, but it could easily be modified to exclude other bots that can execute JavaScript. Here is how you implement it. In your s_code file, at the top you will have a s_account variable that contains your report suite id. It will look something like this:</p>
<pre class="brush: jscript">
var s_account=&quot;dead&quot;
</pre>
<p>To implement the bot detection code you will want to change that line to include the function call. It should look like this:</p>
<pre class="brush: jscript">
var s_account=botCheck(&quot;dead&quot;)
</pre>
<p>Pretty simple so far, right? We just added the function call and included our report suite id in it. Next we have a block of code that needs to be added to the plug-ins section of the s_code file:</p>
<pre class="brush: jscript">
function botCheck(b){var c=navigator.userAgent.toLowerCase(),a=&quot;&quot;;a+=c.indexOf(&quot;google web preview&quot;)!=-1?&quot;&quot;:b;return a};
</pre>
<p>And that&#8217;s all there is to it. So how does it work you ask? What it does is it removes your report suite id if it is the Google Web Preview bot that is accessing the page. The SiteCatalyst code will still fire off, but it will not include the report suite id so it will be discarded by SiteCatalyst and it will not affect your metrics.<br />
<br />
Want to see it in action? I thought you&#8217;d never ask! Check out the page <a href="http://webanalyticsland.com/test.php">http://webanalyticsland.com/test.php</a>. On this page I have a basic SiteCatalyst implementation, one line of code that displays your user agent, and then I print the results of the SiteCatalyst debugger right to the screen. Opening this page in a standard Firefox browser we can see that the SiteCatalyst code has fired off properly, it has displayed the correct user agent and the report suite id is contained within the image request string.<br />
<img src="http://webanalyticsland.com/images/testing1.jpg" alt="Test 1" target="_new" /><br />
So far so good. Using the <a href="https://addons.mozilla.org/en-US/firefox/addon/59/">User Agent switcher</a> plug-in for Firefox, we can switch out user agent to the one that we found in the SiteCatalyst report to mimic the Google Web Preview bot.<br />
<img src="http://webanalyticsland.com/images/testing2.jpg" alt="Test 2" /><br />
We can now see that when we use that bot&#8217;s user agent string, the report suite id is missing from the image request call. Any action that happens now will not be recorded in my report suite, and when SiteCatalyst receives this request it will be discarded. I&#8217;ve had this running for a few days now and have not found any issues, but since this is a pretty new chunk of code be sure to test it out before using it on your production site.<br />
<br />
Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://webanalyticsland.com/sitecatalyst-implementation/how-to-stop-google-preview-from-being-counted-in-sitecatalyst/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Pro Tip: Keep a Solution Design Document For Your SiteCatalyst Implementation</title>
		<link>http://webanalyticsland.com/sitecatalyst-implementation/sitecatalyst-solution-design-document</link>
		<comments>http://webanalyticsland.com/sitecatalyst-implementation/sitecatalyst-solution-design-document#comments</comments>
		<pubDate>Thu, 11 Nov 2010 16:05:09 +0000</pubDate>
		<dc:creator>VaBeachKevin</dc:creator>
				<category><![CDATA[SiteCatalyst Implementation]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[implementation]]></category>
		<category><![CDATA[omniture]]></category>
		<category><![CDATA[sitecatalyst]]></category>
		<category><![CDATA[solution design document]]></category>
		<category><![CDATA[web analytics]]></category>

		<guid isPermaLink="false">http://webanalyticsland.com/?p=432</guid>
		<description><![CDATA[A Solution Design Document is a complete blueprint of your web analytics implementation. It outlines where every variable is set and why. It can really be a lifesaver. You should start keeping a solution design document as soon as you begin your implementation. Every time you add a prop, an evar, an event or any [...]]]></description>
			<content:encoded><![CDATA[<p>A Solution Design Document is a complete blueprint of your web analytics implementation. It outlines where every variable is set and why. It can really be a lifesaver. You should start keeping a solution design document as soon as you begin your implementation. Every time you add a prop, an evar, an event or any other variable, make sure you add it in there. Every time you make a change to your implementation, make note of it in there. It&#8217;s an easy place to go to see what variables are being used for what where they are being set and which ones are still available.  </p>
<p><em>&#8220;But do I really need to keep track of everything to that level of detail, just checking the Admin console has been working well for us.&#8221;</em> Well have you ever opened a report and find information there that shouldn&#8217;t be there?<br />
<img src="http://webanalyticsland.com/images/sdd.png" alt="Bad Report" /><br />
How did that get in there? It&#8217;s being set somewhere in our implementation, but where? What page sets that variable? What function could set it? A quick check of our solution design document and we can see every place were that particular prop is set, well where they <em>should</em> be set. If one of your developers decided to get the implementation and set a variable in a non traditional way, it can be a real nightmare trying to figure out what was done. Without that you could waste a lot of time hunting through code searching for where a random variable is being set.</p>
<p>Here is an example spreadsheet that you can use as a basis to start your Solution Design Document:<br />
<a href="http://webanalyticsland.com/solution_design_document.xlsx">Sample Solution Design Document</a><br />
<br />
If you have a large team that all have their hands in your web analytics implementation, it may be beneficial to could place the solution design document in a location where the different members of your team can have access and add to it, like for example Google Docs or some other shared folder or public drive.</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://webanalyticsland.com/sitecatalyst-implementation/sitecatalyst-solution-design-document/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Track HBX Style Links in SiteCatalyst</title>
		<link>http://webanalyticsland.com/sitecatalyst-implementation/track-hbx-style-links-in-sitecatalyst</link>
		<comments>http://webanalyticsland.com/sitecatalyst-implementation/track-hbx-style-links-in-sitecatalyst#comments</comments>
		<pubDate>Wed, 08 Sep 2010 20:44:40 +0000</pubDate>
		<dc:creator>VaBeachKevin</dc:creator>
				<category><![CDATA[SiteCatalyst Implementation]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[HBX]]></category>
		<category><![CDATA[implementation]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[omniture]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[sitecatalyst]]></category>
		<category><![CDATA[s_code.js]]></category>
		<category><![CDATA[tracking]]></category>

		<guid isPermaLink="false">http://webanalyticsland.com/?p=398</guid>
		<description><![CDATA[I hear from a lot of people migrating from HBX to SiteCatalyst who are looking for ways to make that process a little easier. One of the hurdles I see is trying to migrate all of their HBX link tracking that is already in place to a format that SiteCatalyst can easily understand. That is [...]]]></description>
			<content:encoded><![CDATA[<p>I hear from a lot of people migrating from HBX to SiteCatalyst who are looking for ways to make that process a little easier. One of the hurdles I see is trying to migrate all of their HBX link tracking that is already in place to a format that SiteCatalyst can easily understand. That is an easy one to tackle. It&#8217;s called the setupLinkTrack plug-in.</p>
<p>Other than tracking all of you current HBX coded links, any SiteCatalyst user can get some benefit from it. Here is another great use for this plug-in. Recently I was reading a great article from <a href="http://twitter.com/adamgreco">@adamgreco</a> about <a href="http://www.the-omni-man.com/sitecatalyst/adamgreco/2010/08/23/tracking-navigation/">learning to track website navigation</a>. It is a really great article and if you have not had a chance to read it you should go check it out. In one part of the article Adam writes <em>&#8220;you should have your developer write code that will pass the name of the link to a Traffic Variable (sProp) when a visitor clicks on each link in your navigation&#8221;</em>. Well I&#8217;m the guy responsible for the tracking code for my website, so how can I track those links without adding a whole ton of JavaScript onclicks or some other server side hacks? This plug-in will easily handle that, without adding the extra server calls that come with the standard SiteCatalyst link tracking.</p>
<p>First take the plug-in code and add it to the plug-in section of your s_code.js file. Make sure you have the <a href="http://webanalyticsland.com/sitecatalyst-implementation/sitecatalyst-utility-functions/">utility functions</a> s.split and s.apl.</p>
<pre class="brush: jscript">
/*
 * Plugin: setupLinkTrack 2.0 - return links for HBX-based link
 *         tracking in SiteCatalyst (requires s.split and s.apl)
 */
s.setupLinkTrack=new Function(&quot;vl&quot;,&quot;c&quot;,&quot;&quot;
+&quot;var s=this;var l=s.d.links,cv,cva,vla,h,i,l,t,b,o,y,n,oc,d=&#039;&#039;;cv=s.&quot;
+&quot;c_r(c);if(vl&amp;&amp;cv!=&#039;&#039;){cva=s.split(cv,&#039;^^&#039;);vla=s.split(vl,&#039;,&#039;);for(&quot;
+&quot;x in vla)s._hbxm(vla[x])?s[vla[x]]=cva[x]:&#039;&#039;;}s.c_w(c,&#039;&#039;,0);if(!s.e&quot;
+&quot;o&amp;&amp;!s.lnk)return &#039;&#039;;o=s.eo?s.eo:s.lnk;y=s.ot(o);n=s.oid(o);if(s.eo&amp;&quot;
+&quot;&amp;o==s.eo){while(o&amp;&amp;!n&amp;&amp;y!=&#039;BODY&#039;){o=o.parentElement?o.parentElement&quot;
+&quot;:o.parentNode;if(!o)return &#039;&#039;;y=s.ot(o);n=s.oid(o);}for(i=0;i&lt;4;i++&quot;
+&quot;)if(o.tagName)if(o.tagName.toLowerCase()!=&#039;a&#039;)if(o.tagName.toLowerC&quot;
+&quot;ase()!=&#039;area&#039;)o=o.parentElement;}b=s._LN(o);o.lid=b[0];o.lpos=b[1];&quot;
+&quot;if(s.hbx_lt&amp;&amp;s.hbx_lt!=&#039;manual&#039;){if((o.tagName&amp;&amp;s._TL(o.tagName)==&#039;&quot;
+&quot;area&#039;)){if(!s._IL(o.lid)){if(o.parentNode){if(o.parentNode.name)o.l&quot;
+&quot;id=o.parentNode.name;else o.lid=o.parentNode.id}}if(!s._IL(o.lpos))&quot;
+&quot;o.lpos=o.coords}else{if(s._IL(o.lid)&lt;1)o.lid=s._LS(o.lid=o.text?o.t&quot;
+&quot;ext:o.innerText?o.innerText:&#039;&#039;);if(!s._IL(o.lid)||s._II(s._TL(o.lid&quot;
+&quot;),&#039;&lt;img&#039;)&gt;-1){h=&#039;&#039;+o.innerHTML;bu=s._TL(h);i=s._II(bu,&#039;&lt;img&#039;);if(bu&quot;
+&quot;&amp;&amp;i&gt;-1){eval(\&quot;__f=/ src\s*=\s*[\&#039;\\\&quot;]?([^\&#039;\\\&quot; ]+)[\&#039;\\\&quot;]?/i\&quot;)&quot;
+&quot;;__f.exec(h);if(RegExp.$1)h=RegExp.$1}o.lid=h}}}h=o.href?o.href:&#039;&#039;;&quot;
+&quot;i=h.indexOf(&#039;?&#039;);h=s.linkLeaveQueryString||i&lt;0?h:h.substring(0,i);l&quot;
+&quot;=s.linkName?s.linkName:s._hbxln(h);t=s.linkType?s.linkType.toLowerC&quot;
+&quot;ase():s.lt(h);oc=o.onclick?&#039;&#039;+o.onclick:&#039;&#039;;cv=s.pageName+&#039;^^&#039;+o.lid&quot;
+&quot;+&#039;^^&#039;+s.pageName+&#039; | &#039;+(o.lid=o.lid?o.lid:&#039;no &amp;lid&#039;)+&#039;^^&#039;+o.lpos;if&quot;
+&quot;(t&amp;&amp;(h||l)){cva=s.split(cv,&#039;^^&#039;);vla=s.split(vl,&#039;,&#039;);for(x in vla)s&quot;
+&quot;._hbxm(vla[x])?s[vla[x]]=cva[x]:&#039;&#039;;}else if(!t&amp;&amp;oc.indexOf(&#039;.tl(&#039;)&lt;&quot;
+&quot;0){s.c_w(c,cv,0);}else return &#039;&#039;&quot;);
s._IL=new Function(&quot;a&quot;,&quot;var s=this;return a!=&#039;undefined&#039;?a.length:0&quot;);
s._II=new Function(&quot;a&quot;,&quot;b&quot;,&quot;c&quot;,&quot;var s=this;return a.indexOf(b,c?c:0)&quot;);
s._IS=new Function(&quot;a&quot;,&quot;b&quot;,&quot;c&quot;,&quot;&quot;
+&quot;var s=this;return b&gt;s._IL(a)?&#039;&#039;:a.substring(b,c!=null?c:s._IL(a))&quot;);
s._LN=new Function(&quot;a&quot;,&quot;b&quot;,&quot;c&quot;,&quot;d&quot;,&quot;&quot;
+&quot;var s=this;b=a.href;b+=a.name?a.name:&#039;&#039;;c=s._LVP(b,&#039;lid&#039;);d=s._LVP(&quot;
+&quot;b,&#039;lpos&#039;);return[c,d]&quot;);
s._LVP=new Function(&quot;a&quot;,&quot;b&quot;,&quot;c&quot;,&quot;d&quot;,&quot;e&quot;,&quot;&quot;
+&quot;var s=this;c=s._II(a,&#039;&amp;&#039;+b+&#039;=&#039;);c=c&lt;0?s._II(a,&#039;?&#039;+b+&#039;=&#039;):c;if(c&gt;-1)&quot;
+&quot;{d=s._II(a,&#039;&amp;&#039;,c+s._IL(b)+2);e=s._IS(a,c+s._IL(b)+2,d&gt;-1?d:s._IL(a)&quot;
+&quot;);return e}return &#039;&#039;&quot;);
s._LS=new Function(&quot;a&quot;,&quot;&quot;
+&quot;var s=this,b,c=100,d,e,f,g;b=(s._IL(a)&gt;c)?escape(s._IS(a,0,c)):esca&quot;
+&quot;pe(a);b=s._LSP(b,&#039;%0A&#039;,&#039;%20&#039;);b=s._LSP(b,&#039;%0D&#039;,&#039;%20&#039;);b=s._LSP(b,&#039;%&quot;
+&quot;09&#039;,&#039;%20&#039;);c=s._IP(b,&#039;%20&#039;);d=s._NA();e=0;for(f=0;f&lt;s._IL(c);f++){g&quot;
+&quot;=s._RP(c[f],&#039;%20&#039;,&#039;&#039;);if(s._IL(g)&gt;0){d[e++]=g}}b=d.join(&#039;%20&#039;);retu&quot;
+&quot;rn unescape(b)&quot;);
s._LSP=new Function(&quot;a&quot;,&quot;b&quot;,&quot;c&quot;,&quot;d&quot;,&quot;var s=this;d=s._IP(a,b);return d&quot;
+&quot;.join(c)&quot;);
s._IP=new Function(&quot;a&quot;,&quot;b&quot;,&quot;var s=this;return a.split(b)&quot;);
s._RP=new Function(&quot;a&quot;,&quot;b&quot;,&quot;c&quot;,&quot;d&quot;,&quot;&quot;
+&quot;var s=this;d=s._II(a,b);if(d&gt;-1){a=s._RP(s._IS(a,0,d)+&#039;,&#039;+s._IS(a,d&quot;
+&quot;+s._IL(b),s._IL(a)),b,c)}return a&quot;);
s._TL=new Function(&quot;a&quot;,&quot;var s=this;return a.toLowerCase()&quot;);
s._NA=new Function(&quot;a&quot;,&quot;var s=this;return new Array(a?a:0)&quot;);
s._hbxm=new Function(&quot;m&quot;,&quot;var s=this;return (&#039;&#039;+m).indexOf(&#039;{&#039;)&lt;0&quot;);
s._hbxln=new Function(&quot;h&quot;,&quot;var s=this,n=s.linkNames;if(n)return s.pt(&quot;
+&quot;n,&#039;,&#039;,&#039;lnf&#039;,h);return &#039;&#039;&quot;);
</pre>
<p>Next in the s_doPlugins section of the s_code file you need a couple lines of setup.<br />
<strong><code><br />
s.hbx_lt = "auto" // manual, auto<br />
s.setupLinkTrack("prop1,prop2,prop3,prop4","SC_LINKS");<br />
</code></strong><br />
The plug-in will use 4 variables and a name for a cookie it will set. For this example I am going to use props 1 thru 4. </p>
<p>Next we have the actual code that will appear in the anchor tag that the plug-in will look for. It is a simple name attribute tag of <strong>lid</strong> and <strong>lpos</strong>. This is what a link would look like with the code properly formatted.<br />
<strong><code><br />
&lt;a href="my-page.php" name="&#038;lid=Featured Articles&#038;lpos=Left Nav"&gt;Cool Article Name&lt;/a&gt;<br />
</code></strong></p>
<p>Here&#8217;s what it will do. After clicking on a link that contains a lid and lpos (the exact link shown above), this is what you will find in the debugger on the page you land on:<br />
<img src="http://webanalyticsland.com/images/db1.jpg" alt="Debugger 1" /><br />
The plug-in entered the s.pageName value of the page that the click occurred into prop1, the value of lid into prop2, a combination of the prop1 and the value of lid into prop3 and the value of lpos in prop4. </p>
<p>Lets change up what we include in the actual link code. Lets remove the lid from the tag and just use this link:<br />
<strong><code><br />
&lt;a href="my-page.php" name="&#038;lpos=Left Nav"&gt;Cool Article Name&lt;/a&gt;<br />
</code></strong></p>
<p>This is what we will get from the debugger:<br />
<img src="http://webanalyticsland.com/images/db2.jpg" alt="Debugger 2" /><br />
You can see by not using the lid tag then the plug-in will use the actual anchor text in those positions.</p>
<p>Now lets say you are not interested in capturing the previous pageName value, or the combined previous pageName/lid value. You can just omit those variables in the plug-in setup. Change the code to:<br />
<strong><code><br />
s.hbx_lt = "auto" // manual, auto<br />
s.setupLinkTrack(",prop2,,prop4","SC_LINKS");<br />
</code><br />
</strong><br />
You can see I left the commas in there as empty place holders. Clicking the link with that setup and a lid and lpos value will return this in the debugger:<br />
<img src="http://webanalyticsland.com/images/db3.jpg" alt="Debugger 3" /></p>
<p>What about the other links on the page? What if they do not include a lid or lpos value? The plug-in will track those also. Clicking one of those links will return this in the debugger:<br />
<img src="http://webanalyticsland.com/images/db4.jpg" alt="Debugger 4" /><br />
The plug-in will still capture the previous pageName value, the anchor text and the combined values of the two.</p>
<p>I&#8217;m sure by now you noticed that auto/manual setting. Up to now its been set on auto. Let&#8217;s flip it to manual and click a link on the page that does not include any code. Here is what you will get:<br />
<img src="http://webanalyticsland.com/images/db5.jpg" alt="Debugger 5" /><br />
You will only get the two previous pageName values. If I would have omitted those two variables like I did earlier then it would have not returned anything. If you click on a link with a lid and lpos variables then  it will perform the same as if it were set to auto.</p>
<p>If you want to not add the code to the links so you can track all of the links on a page, but you only want to do it on a specific page and not the whole site you can then wrap the code in an if statement like this:<br />
<strong><code><br />
if(s.pageName=='Home'){<br />
s.hbx_lt = "auto" // manual, auto<br />
s.setupLinkTrack(",prop2,,prop4","SC_LINKS");<br />
}<br />
</code></strong><br />
You could also do that using document.location (or a million other ways to identify a specific page).</p>
<p>Since it also grabs the previous page value I no longer need the previous pageName plug-in (useful when using the getPercentPageViewed plug-in). </p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://webanalyticsland.com/sitecatalyst-implementation/track-hbx-style-links-in-sitecatalyst/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Implement Adobe SiteCatalyst in 5 Minutes (or less!)</title>
		<link>http://webanalyticsland.com/sitecatalyst-implementation/implement-sitecatalyst-in-5-minutes</link>
		<comments>http://webanalyticsland.com/sitecatalyst-implementation/implement-sitecatalyst-in-5-minutes#comments</comments>
		<pubDate>Thu, 19 Aug 2010 15:01:26 +0000</pubDate>
		<dc:creator>VaBeachKevin</dc:creator>
				<category><![CDATA[SiteCatalyst Implementation]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[implementation]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[omniture]]></category>
		<category><![CDATA[sitecatalyst]]></category>
		<category><![CDATA[s_code.js]]></category>
		<category><![CDATA[tracking]]></category>

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

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

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

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

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

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

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

