Omniture SiteCatalyst doFilterURLs custom plugin

Recently, at the company I work for, we ran into the IE 2083 character limitation issue.  Here is a custom plugin to filter the URL that is being passed to OMTR to ensure that the 2083 limitation threshold isn’t reached.To do this you would put an if statement that is something like this.Name of Plug-in: doFilterURLsVersion of Plug-in: 0.1Purpose of Plug-in: This plug-in removes additional characters that push the image request above the 2083 limitation that Internet Explorer carries.What do I need to implement this plug-in:

  1. customization of filterURL plugin section
  2. utility function split

Explanation of s.detectRIA function:/*filterURL plugin config*/

/*Blank out props */s.doFilterURLs();How to implement plug-in:

  1. Add the following line to the doPlugins section of the s_code.js file.  Below is just an example:

if((s.prop12.length+s.prop16.length+s.prop20.length+s.prop24.length+s.prop27.length)>1024)s.doFilterURLs();*Please remember to check to use an available unallocated sProp’s to implement this plug-in

  1. At the end of the plug-in section, just before the “DO NOT ALTER” line, place the following code:

/********************************************************************/** Utility Function: split v1.5 – split a string (JS 1.0 compatible)*/s.split=new Function(“l”,”d”,”"+”var i,x=0,a=new Array;while(l){i=l.indexOf(d);i=i>-1?i:l.length;a[x"+"++]=l.substring(0,i);l=l.substring(i+d.length);}return a”);/** FilterURL plugin v0.1 — Does various things to shorten the image request on certain pages.*/s.doFilterURLs=function(obj){//initialize the Variablesvar s = this, r = (obj)?obj:s, pageURL = (r.pageURLOverride)?r.pageURLOverride:”-”, ref = (r.referrerOverride)?r.referrerOverride:”-”, ar = new Array(), li = new Array(), filter = false, isIE = false;//do IE detectionif(window.navigator && window.navigator.userAgent && window.navigator.userAgent.indexOf(“MSIE”)>-1)isIE = trueli = s.split(r.urlFilterCriteria,”,”);for (var l in li){if(r.filterURL.indexOf(li[l]) > -1){filter = true;}}if(filter && (isIE||!s.filterIEOnly)) //if the URL triggers the filter or the browser is IE or the filterIEOnly is false{if(r.shortenPageURL)s.pageURL = pageURL // shorten the p parameterif(r.shortenReferrer) // Check config options.referrer = ref //shorten the r parameterif(r.killClickMap) //check config option{//Kill the ClickMap Cookies.c_w(‘s_sq’,’[[B]]’,0);}var ar = s.split(r.filterVariables, “,”) // split the arrayfor(var v in ar) // Loop through the variables{s[ar[v]]=”" // Set the SiteCatayst Variable to Blank}}return filter; // return value if URL was filtered}* This plugin isn’t provided by Omniture so please make sure that you properly test this prior to releasing this code.  I will not be held responsible for any errors in coding this might cause to your customized settings.  Please test!



Written by:

Omniture, SiteCatalyst, Web Analytics

If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.

Leave Comment

(required)

(required)