Using Google Search and Omniture Tracking

We are looking to implement Google search so customers can search our website. We are aware of SiteSearch but this product is much too expensive for us to afford. Has anyone been able to use Omniture code to populate the Onsite Search reports using the Google Search tool? I would be extremely grateful to any insight on this topic. Thanks. Dave Nelson Marketing Project Manager Xactware
Not sure if this will be helpful but you can create a custom Insight Traffic variable or s.prop. Call it "Internal Search" and grab the query param: I believe google uses "q". Add the plug in code on the page. Would look something like this: s.prop1=s.getQueryParam("q"); It's just a simple counter so I'm not sure what additional metrics you would want to tie that to. In v14 you would go to Custom Traffic and you new variable would appear. Select and the report will generate. Hope that helps. Bill bill.moschella@evariant.com
Reply
We are using some PHP code to help populate the search via our Google Custom search XML feed. Here is an example of how we do it: s.prop11 = "document.referrer;" s.events = "event5"; s.eVar5 = s.prop5 = "search term populated by PHP here"; There is a plugin provided by Omniture that gets placed in the s_code that handles the data flow. -Brian Thopsey
Reply
Good ideas. This reminded me I needed to integrate this with our Google Mini Search Appliance. http://www.rudishumpert.com/2009/08/26/capture-search-terms-from-your-go...
Reply

Capture Search Terms From Your Google Mini into 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 Applicance.


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.

[code]
<!-- **********************************************************************
  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 code version: H.16.
   </xsl:comment>
</xsl:template>
[/code]

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.
4. I used an eVar so I could add sub relations

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

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

and place the following code  opening <body> tag:

[code]
 <!-- *** 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>
[/code]


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

Reply

Must be logged in to comment. now to comment!