Rudi Shumpert : Code By Numbers
11Sep/095

Use Omniture’s Data Insertion API to avoid insanely long URL query strings

If you have not already found the Web Analytics Land blog, you need to check it out! I was re-reading another post out there A Robust SiteCatalyst Implementation Could Fail In Internet Explorer, where he talks about the issue you could face with a SiteCatalyst Implementation in IE is the URL string to the Javascript Beacon exceed 2083 characters.

From Web Analytics Land: Why do we need to care about this? It lies in an inherent deficiency of Internet Explorer. IE can not accept a URL that is longer than 2083 characters. If your implementation is pretty complex and you are passing in a lot of variables, your image request can easily approach if not exceed that amount. Since Microsoft still commands the lion’s share of the browser marketplace, this is something we need to keep an eye on. If this was a problem with Opera or another third or forth tier browser then we may not worry about it. But this is not the case with Internet Explorer.

I have made no effort to conceal my hatred of IE 6. timesup

However,  like many others out there, it is the reality that we have to deal with.  So I looked at the example url that was provided over at Web Analytics Land and wondered if I could take that url string and convert it into an xml object that I would then be able to use Omniture's Data Insertion API instead of the Javascript Beacon to send as long of a data push as needed. Read the rest of this entry »

4Sep/090

Hierarchy Data In Omniture

NOTE:  If your looking for the article on Omniture & 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 get that to work using a combination of ColdFusion & JS instead of just making edits to the s_code file.

Some things to consider before implementing Hierarchies: (swiped from Omniture's Manual)

  • There are five hierarchy variables available, which must be enabled by Omniture ClientCare.
  • 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.
  • Before implementing hierarchies, refer to the Channels and Hierarchies white paper.
  • The delimiter may not be changed once the hierarchy is setup. If the delimiter for your hierarchy must be changed, contact Omniture ClientCare.
  • The number of levels may not be changed once the hierarchy is set up.

Once the hierarchy is activated, you should see it in SiteCatalyst under the Site Content Menu item (In version 14.6)

That concludes the configuration portion of the adventure. Now to the coding!

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.

Goals for this adventure were to:

  • Dynamically set the s.hierN variable on every page
  • Prevent levels greater than 5 from being passed
  • Prevent filenames being passed as levels (index.cfm)
  • And of course..get it all working to provide a hierarchical view of our web traffic. :)
<cfset variables.omniHierList = cgi.path_info >
<cfset variables.omniHierListLen = ListLen(variables.omniHierList,"/")>
<cfset variables.newOmniHierList = ListChangeDelims(variables.omniHierList,"|","/")>
<!--- Check the list len to make sure we do no exceed the level depth --->
<cfset variables.lastItem = ListGetAt(variables.newOmniHierList,variables.omniHierListLen,"|")>
<cfif FindNoCase(".","#variables.lastItem#") GT 0>
 <cfset variables.newOmniHierList = ListDeleteAt(variables.newOmniHierList,variables.omniHierListLen,"|")>
</cfif>

This will result in: Assuming of course that your current path is "/root/evil/browsers/IE6/demonspawn/use/firefox.ftw"

Struct

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.

<cfif variables.omniHierListLen GT 5>
 <cfset variables.newOmniListTrim = "">
 <cfloop from="1" to="5" index="i">
 <cfset variables.newOmniListTrim = ListAppend(variables.newOmniListTrim,ListGetAt(variables.newOmniHierList,#i#,"|"),"|")>
 </cfloop>
 <cfset variables.newOmniHierList = variables.newOmniListTrim>
 </cfif>

Now you have a list of a max of 5 items to set the s.hierN variable to.

hier

This was one of the easier Omniture adventures so far!

-Rudi

26Aug/090

Capture Search Terms From Your Google Mini into Omniture

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.

Google Mini

Here are the steps I took to integrate/capture the search terms into Site Catalyst.

Step 1.  Locate and backup your searchtemplate.xslt file.

Step 2.  In the section of the code that has the sections labeled "(can be customized)" add this code block.

<!-- **********************************************************************
 Omniture SiteCatalyst code (can be customized)
 ********************************************************************** -->

<xsl:template name="sitecatalyst">
 <xsl:param name="query"/>
 <xsl:param name="matches"/>
 <xsl:comment>
 SiteCatalyst : Google Mini Search Integration
 </xsl:comment>
 <script language="JavaScript" type="text/javascript" src="INSERT-DOMAIN-AND-PATH-TO-CODE/s_code.js"></script>
 <script language="JavaScript" type="text/javascript">
 <xsl:comment>
 s.eVar1="<xsl:value-of select='$query'/>"
 var s_code=s.t();if(s_code)document.write(s_code)
 </xsl:comment>
 </script>
 <script language="JavaScript" type="text/javascript">
 <xsl:comment>
 if(navigator.appVersion.indexOf('MSIE')>=0)
 document.write("unescape('%3C')+'!-'+'-'")
 </xsl:comment>
 </script>
 <xsl:comment>
 End SiteCatalyst : Google Mini Search Integration
 </xsl:comment>
</xsl:template>

NOTES:
1. Replace the"INSERT-DOMAIN-AND-PATH-TO-CODE" with the location where you uploadedthe s_code.js file:
2. Be sure to use an absolute path.  http://www.rudishumpert.com/subfolder/s_code.js
3. Code above assumes you are using s.prop1.  Change value as needed.

Step 3.  Next, locate the XSL template named, search_results.

<!-- **********************************************************************
Search results (do not customize)
 ********************************************************************** -->
<xsl:template name="search_results">
...
...
<body onLoad="resetForms()" dir="ltr">

and place the following code  opening <body> tag:

 <!-- *** Add Omniture SiteCatalyst code *** -->
 <xsl:choose>
 <xsl:when test="RES">
 <xsl:call-template name="sitecatalyst">
 <xsl:with-param name="query" select="Q"/>
 </xsl:call-template>
 </xsl:when>
 <xsl:otherwise>
 <xsl:call-template name="sitecatalyst">
 <xsl:with-param name="query" select="Q"/>
 </xsl:call-template>
 </xsl:otherwise>
 </xsl:choose>

Step 4.  Deploy code to test/production making sure to backup a copy of your existing XSLT template (just in case).

You should now be able to see the search terms being passed to Omniture using your debugging tool of choice.

-Rudi

EDIT:  changed the Omniture variable used from prop1 to evar1 so we could add sub relations to the element.

19Aug/096

One Player to Rule Them All…

Last week I read a great post by Vaugn Denny about the JW Video Player. And being of the curious sort I had to investigate further. So I visited the JW Player web site. And I was greeted with a page that claimed that they had a video player that would not only play flv files, but wmv files as well. And with further reading the player claims to have an open API with access to the player events. Could it be true?

One Player to rule them all, One Player to track them,
One Player to bring them all and in the darkness correlate them
In the Land of Analytics where the Shadows lie.

theringvx6
Read the rest of this entry »

17Aug/094

Track Your FLV Video Files With Omniture & FlowPlayer

EDIT:  After I wrote this I found a new video player that will play flv, wnv, and youtube videos.

I've been working on our Omniture integration for a while now and recently I started working on the task of tracking our videos. I know that Omniture has some very nice features you can use with Action Source code, but what if all you have access to is the end result of the flv file? With no tools to edit a player, or the ability to embed the code in the files/players? It's a bit of a challenge to say the least.

I needed a way to track flv files with the same amount of details that the Action Source would provide in a reliable, easy to duplicate fashion. My search for this led me to an FLV player called FlowPlayer. It is a nice easy to implement player with easy access to the API and the events.
Read the rest of this entry »

Get Adobe Flash playerPlugin by wpburn.com wordpress themes