Web Images Videos Maps News Shopping Gmail more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Group info
Recent pages and files
how-to-add-omnitures-sitecatalyst-code    

?

Overview

In order to add Omniture's SiteCatalyst code to a Google SearchAppliance you need to modify the raw XSLT stylesheet. The followingcustomizations will insert the tracking code after the opening <body> tag on the search results page. As per the implementation requirements by Omniture, the code will also dynamically set s.prop1 to the search terms and s.prop2 to the number of results returned. If zero results are returned we populate s.prop2 with "zero" and not 0.


Before you implement these changes be sure to make a backup of your existing stylesheet.

Implementation

Step 1:

?Add the following code in green to the end of the section whereGoogle recommends you make customizations. Replace the"INSERT-DOMAIN-AND-PATH-TO-CODE" with the location where you uploadedthe s_code.js file:

?

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

?<xsl:template name="sitecatalyst">
? <xsl:param name="query"/>
? <xsl:param name="matches"/>
? <xsl:comment>
??? SiteCatalyst code version: H.16.
??? Copyright 1997-2008 Omniture, Inc. More info available at
??? http://www.omniture.com
? </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.prop1="<xsl:value-of select='$query'/>"
????? s.prop2="<xsl:value-of select='$matches'/>"
????? 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 code version: H.16.
? </xsl:comment>
</xsl:template>


?

?

<!-- ######################################################################
?We do not recommend changes to the following code.? Google Technical
?Support Personnel currently do not support customization of XSLT under
?these Technical Support Services Guidelines.? Such services may be
?provided on a consulting basis, at Google's then-current consulting
?services rates under a separate agreement, if Google personnel are
?available.? Please ask your Google Account Manager for more details if
?you are interested in purchasing consulting services.
???? ###################################################################### -->

Step 2:

Next, locate the XSL template named, search_template and place the following code in green after the opening <body> tag:


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

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

?

Conclusion

Save your changes and you should be in business. The Google Search Protocol Referencestates the XSL stylesheet cache is updated approximately every 15minutes. I have found it can take a lot longer. In order to force it torefresh the stylesheet currently being requested simply add &proxyreload=1 to the end of your search URL.

Regards,

Wayne Dyck

?

Version: 
Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google