Home / Web Analytics / SiteCatalyst / 3 SiteCatalyst Plugins You Can’t Live Without
Plugin Image

3 SiteCatalyst Plugins You Can’t Live Without

Whether you are new to Adobe’s SiteCatalyst or have used the tool for years, there is a need to extend the tracking capabilities beyond the “out of the box” functionality. If you want to track values in your links, understand what percent of the page that has been viewed, or understand where people abandon a form, you need to use a plugin to accomplish these tasks.

What is a plugin?

In SiteCatalyst, almost every report in the interface is populated through JavaScript tags present on the pages of your website. If you’ve heard the terms s.props and eVars, that’s what we’re talking about. Populating those variables with values that makes sense to the business. However, there aer limits to what the core product can do, and for that reason there are plugins you can use to extend the core product. A plugin is simply additional JavaScript code placed on your pages that can track additional information. Here are 3 plugins I think are critical to implement in order to bring your analytics understanding to the next level.

1. getQueryParam

In my opinion, this is the most useful plugin created. By default, SiteCatalyst cannot pull a value from a link and populate it into a report. In fact, many companies have settings within the interface will exclude all URL parameters. This plugin allows you to grab a value from the URL and pass it into a corresponding tag.

Syntax:

/*
 * Plugin: getQueryParam 2.3
 */
s.getQueryParam=new Function("p","d","u",""
+"var s=this,v='',i,t;d=d?d:'';u=u?u:(s.pageURL?s.pageURL:s.wd.locati"
+"on);if(u=='f')u=s.gtfs().location;while(p){i=p.indexOf(',');i=i<0?p"
+".length:i;t=s.p_gpv(p.substring(0,i),u+'');if(t){t=t.indexOf('#')>-"
+"1?t.substring(0,t.indexOf('#')):t;}if(t)v+=v?d+t:t;p=p.substring(i="
+"=p.length?i:i+1)}return v");
s.p_gpv=new Function("k","u",""
+"var s=this,v='',i=u.indexOf('?'),q;if(k&&i>-1){q=u.substring(i+1);v"
+"=s.pt(q,'&','p_gvf',k)}return v");
s.p_gvf=new Function("t","k",""
+"if(t){var s=this,i=t.indexOf('='),p=i<0?t:t.substring(0,i),v=i<0?'T"
+"rue':t.substring(i+1);if(p.toLowerCase()==k.toLowerCase())return s."
+"epa(v)}return ''");

Use Case:

Let’s say you are tracking a marketing campaign using a “cid” parameter in your URL. Ex.: analyticsnerd.net/nate/?cid=wired

In this example we are interested in knowing how much traffic is generated from the “Wired” campaign. Once we add the above plugin, you would pass the values into SiteCatalyst using the s.campaign variable as follows:

/* Plugin Example: getQueryParam 2.3
 //single parameter
 s.campaign=s.getQueryParam('cid');

2. getPercentPageViewed

This handy plugin is incredibly useful if you have a lot of content. In the cases of content sites, it’s very common for users to only view one page and leave. In most analytics solution, this is defined as a bounce, and usually is not considered a successful visit. This plugin allows you to dig to the next level and understand what percent of the page was viewed by users. This type of information is extremely useful as it can help dictate how long your articles should be, and also how reading habits differ based on the device people use.

Syntax:

/*
 * Plugin: getPercentPageViewed v1.4
 */
s.handlePPVevents=new Function("",""
+"if(!s.getPPVid)return;var dh=Math.max(Math.max(s.d.body.scrollHeigh"
+"t,s.d.documentElement.scrollHeight),Math.max(s.d.body.offsetHeight,"
+"s.d.documentElement.offsetHeight),Math.max(s.d.body.clientHeight,s."
+"d.documentElement.clientHeight)),vph=s.wd.innerHeight||(s.d.documen"
+"tElement.clientHeight||s.d.body.clientHeight),st=s.wd.pageYOffset||"
+"(s.wd.document.documentElement.scrollTop||s.wd.document.body.scroll"
+"Top),vh=st+vph,pv=Math.min(Math.round(vh/dh*100),100),c=s.c_r('s_pp"
+"v'),a=(c.indexOf(',')>-1)?c.split(',',4):[],id=(a.length>0)?(a[0]):"
+"escape(s.getPPVid),cv=(a.length>1)?parseInt(a[1]):(0),p0=(a.length>"
+"2)?parseInt(a[2]):(pv),cy=(a.length>3)?parseInt(a[3]):(0),cn=(pv>0)"
+"?(id+','+((pv>cv)?pv:cv)+','+p0+','+((vh>cy)?vh:cy)):'';s.c_w('s_pp"
+"v',cn);");
s.getPercentPageViewed=new Function("pid",""
+"pid=pid?pid:'-';var s=this,ist=!s.getPPVid?true:false;if(typeof(s.l"
+"inkType)!='undefined'&&s.linkType!='e')return'';var v=s.c_r('s_ppv'"
+"),a=(v.indexOf(',')>-1)?v.split(',',4):[];if(a.length<4){for(var i="
+"3;i>0;i--){a[i]=(i<a.length)?(a[i-1]):('');}a[0]='';}a[0]=unescape("
+"a[0]);s.getPPVpid=pid;s.c_w('s_ppv',escape(pid));if(ist){s.getPPVid"
+"=(pid)?(pid):(s.pageName?s.pageName:document.location.href);s.c_w('"
+"s_ppv',escape(s.getPPVid));if(s.wd.addEventListener){s.wd.addEventL"
+"istener('load',s.handlePPVevents,false);s.wd.addEventListener('scro"
+"ll',s.handlePPVevents,false);s.wd.addEventListener('resize',s.handl"
+"ePPVevents,false);}else if(s.wd.attachEvent){s.wd.attachEvent('onlo"
+"ad',s.handlePPVevents);s.wd.attachEvent('onscroll',s.handlePPVevent"
+"s);s.wd.attachEvent('onresize',s.handlePPVevents);}}return(pid!='-'"
+")?(a):(a[1]);");

Use Case:

/* Plugin Example: getPercentPageView v1.2
 s.prop2=s.getPercentPageViewed();
 */

 /* To understand which page is getting what value
 */
 s.prop3=s.getPreviousValue(s.pageName,"s_pv");
 if (s.prop3){
 s.prop2=s.getPercentPageViewed();
 }
/* To send the hit on an exit link */
 var url=s.exitLinkHandler()
 if(url){
 s.prop3=s.getPreviousValue(s.pageName,"s_pv");
 if (s.prop3){
 s.linkTrackVars='prop2,prop3';
 s.prop2=s.getPercentPageViewed();
 }
 }

3. screenOrientation

I stumbled upon this plugin on Web Analytics Land when I was taking an Adobe implementation class. The plugin allows you to understand the orientation people are using to view your content on a mobile device (Portrait or Landscape). This is really useful when trying to optimize your site for a specific orientation. I imagine something like this will eventually become part of the core functionality soon enough, but until then here’s the code you would use.

Syntax:

function screenOrientation(){
switch(window.orientation){
case 0:case180:return("Portrait");
break;case 90:case-90:return("Landscape");
}
window.scroll(0,0)
}

Use Case:

s.prop1=screenOrientation();

This is by no means an exhaustive list of plugins. There are certainly others like Form Analysis and Campaign Analysis which are managed by Adobe Customer Care that can be incredibly powerful.

Have others you recommend? Comment below.

About Nathan Matuska

Nathan Matuska is Director of Product Development at the Carlson Rezidor Hotel Group and founder of Analytics Nerd. He has nearly 15 years of experience in Ecommerce Strategies, Data Analysis, and Digital Marketing. He has extensive experience in web analytics, previously working as the Manager of Client services for a web analytics start-up and has worked with other tools such as SiteCatalyst, Google Analytics and Webtrends.

Check Also

Sales - Up and to the right

What Are The Top E-Commerce KPIs?

Whether you are new to the E-Commerce industry or have years of experience, one thing …

Leave a Reply