Google SEO integration

From ClickTale Wiki
Jump to: navigation, search
ClickTale Wiki
The instructions on this page are intended for self service accounts.
Enterprise customers should contact their account managers for integration support.

Ever wonder which words lead visitors to your site? Using this method you can find out how many pageviews you got for each keyword, as well as how the visitors searching for those keywords behaved.

Important note

This process might not yield results for all keywords used for searching on Google. This is due to a change in Google search policies, mandating secure (SSL) searches for a growing percentage of the user population.
Find out more in this Wiki article.


Place the following code on your website, instead of the bottom part of your tracking code:

<!-- ClickTale Bottom part -->
<div id="ClickTaleDiv" style="display: none;"></div>
<script type="text/javascript">
function queryString(parameter, encoded) {
  var loc_search =,;
  loc_search = loc_search.replace(/\+/g, ' ');
  var param_value = false;
  var params = loc_search.split("&");
  if(!encoded) {
    parameter = encodeURIComponent(parameter);
  for (i=0; i<params.length;i++) {
 param_name = params[i].substring(0,params[i].indexOf('='));
 if (param_name == parameter) {
 param_value = params[i].substring(params[i].indexOf('=')+1)
  if (param_value) {
 return param_value;
  			else {
return false; // case parameter wasn't found
<script src="" type="text/javascript"></script>
<script type="text/javascript">
if (document.referrer. match(“ != null) {
var search_string = queryString("q"); 
var search_words = search_string.split("+");
 for (i=0; i< search_words.length;i++) {
ClickTaleTag("googlesearch:"+search_words[i]);  }
if(typeof ClickTale=='function') ClickTale([!YOUR PROJECT ID!],recordingratio,[!PARTITION!]);
<!-- ClickTale end of Bottom part -->

This tags the pageviews with a tag entitled “googlesearch:”+the term that was searched.

  1. Use the Search page's Events filter to see which search words got the highest popularity rating (=pageviews). Select the Events with the search terms if you want to view the behavior of visitors who used these terms to reach your site.