Here is a quick and easy way to track page names in WebCEO’s HitLens analytics application by changing a couple variables in the tracking script. This works perfectly in Community Server 2008!

First let’s take the original code generated by HitLense:

<!–WEBSITECEO:BEGIN:{764EEF2E-BC11-45CF-8627-300CE1BA2219}–>

<!–
Do NOT modify this script to avoid traffic misrepresentation!
Web CEO 4 0300/1
Code initially inserted into: “index.aspx”.
–>

<script type=”text/javascript”><!–
// hitlens v1.2.7
function hitlens_embedded() {
var id = 123456;
var pc = 0;
var PAGENAME = escape(”);
var CONTENTGROUP = escape(”);
var TRANSACTION = escape(”);
var TRANSACTION_ID = 0;
var ORDER = escape(”);
return “id=”+id+”&pc=”+pc+”&p=”+PAGENAME+”&gr=”+CONTENTGROUP+”&tr=”
+TRANSACTION+”&trid=”+TRANSACTION_ID+”&ord=”+ORDER;
}
//–></script>
<script type=”text/javascript” src=”/webceo.js”></script>
<!–WEBSITECEO:END:{764EEF2E-BC11-45CF-8627-300CE1BA2219}–>

Now lets add a quick line of code to the var PAGENAME = variable:

var PAGENAME = document.title;

What this will do is pull the page’s title and post it in HitLense.

The default tracking code HitLense generates also throws in the following comment that needs to be removed completely:

<!–
Do NOT modify this script to avoid traffic misrepresentation!
Web CEO 4 0300/1
Code initially inserted into: “index.aspx”.
–>

Also make sure to leave the var pc = 0; at 0. The var pc is a unique page identifier, if you use specialized tracking (like above) instead of the wizard-driven setup then you’ll definitely need to keep it at 0 or your going to run into some problems.

Your final tracking code should look like this:

<!–WEBSITECEO:BEGIN:{764EEF2E-BC11-45CF-8627-300CE1BA2219}–>
<script type=”text/javascript”><!–
// hitlens v1.2.7
function hitlens_embedded() {
var id = 123456;
var pc = 0;
var PAGENAME = document.title;
var CONTENTGROUP = escape(”);
var TRANSACTION = escape(”);
var TRANSACTION_ID = 0;
var ORDER = escape(”);
return “id=”+id+”&pc=”+pc+”&p=”+PAGENAME+”&gr=”+CONTENTGROUP+”&tr=”
+TRANSACTION+”&trid=”+TRANSACTION_ID+”&ord=”+ORDER;
}
//–></script>
<script type=”text/javascript” src=”/webceo.js”></script>
<!–WEBSITECEO:END:{764EEF2E-BC11-45CF-8627-300CE1BA2219}–>

Good luck!

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • StumbleUpon
  • del.icio.us
  • Google
  • Facebook
  • Technorati
  • Furl
  • Reddit
  • YahooMyWeb
  • Live
  • Fark
  • NewsVine
  • Ma.gnolia
  • co.mments
  • BlogMemes
  • SphereIt
  • Spurl
  • E-mail this story to a friend!
  • Print this article!
  • TwitThis

Tags: , , , , , , , ,