Omniture SiteCatalyst s.linkInternalFilters Custom Dynamic Solution

At the company I work for, we ran into an issue where we had way too many domains within our s.linkInternalFilters variable which was causing our s_code.js file to become bloated. Here is a solution to get around that issue.

The code below will take the current domain that the user is accessing the page from and put that into s.linkInternalFilters. Now you won’t need to keep adding internal domains to this list:

1. Place this code right after the first call to s.linkInternalFilters:

s.linkInternalFilters = “javascript:, domain.com”;

s.linkInternalFilters = s.linkInternalFilters + “, ” + getLinkInternalDomain(location.href);

2. Place the below function within the doPlugins section:

/* Function to parse the URL and return the domain for linkInternalFilter string*/
function getLinkInternalDomain (urlString) {
var urlPattern = new RegExp(“(http|https)://(.*?)/.*$”);
var parsedUrl = urlString.match(urlPattern);
return parsedUrl[2];
}

* 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: Dorian D. Regester

Omniture, 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.

Comments

One Response to “Omniture SiteCatalyst s.linkInternalFilters Custom Dynamic Solution”

Leave Comment

(required)

(required)