Omniture Image Request Counter

A little while ago I wrote about how A Robust SiteCatalyst Implementation Could Fail In Internet Explorer. In the article I point out that IE does not like any URL’s that are over 2083 characters. Recently I have had some issues with a few sites where I think they may have been running into this problem again. I would always use Firebug or Tamper Data to look at the actual image request, copy that and drop it into one of the various free ‘character counting’ tools that are pretty abundant all over the web to make sure that the Omniture image request URL is not over 2083 characters. This can get pretty time consuming. I figured there has to be an easier way to do it. Behold the Omniture Image Request Counter.

Omniture Image Request Counter is just a simple JavaScript bookmark, very similar to the Omniture Debugger tool. What this does is takes a look at the image request and counts how many characters are there. Very quick, very simple.
Omniture Image Request Counter

Download a copy of the code here
or
View a copy of the code here

Here is how to use it:
1. Take any web page and create a bookmark (or favorite depending on what you call it).
2. Right-click the favorite you just created.
3. Click Properties.
4. Delete all text from the URL field of the Properties window.
5. Paste the following code into the URL field of the Properties window.

javascript:var%20j=document.styleSheets,i=document.images,r='';for(var%20x=0;x<j.length;x++)if(j[x].imports)for(var%20y=0;y<j[x].imports.length;y++)if(j[x].imports[y].href.toLowerCase().indexOf('/b/ss/')>=0)r+=j[x].imports[y].href+"\n\n";for(var%20x=0;x<i.length;x++)if(i[x].src.toLowerCase().indexOf('/b/ss/')>=0)r+=i[x].src+"\n\n";for(w_m%20in%20window)if(w_m.substring(0,4)=='s_i_'&&window[w_m].src)if(window[w_m].src.indexOf('/b/ss/')>=0)r+=window[w_m].src;void(alert('The%20Omniture%20image%20request%20contains%20'+r.length+'%20characters.'))

6. Click OK

Now navigate to any page that has Omniture SiteCatalyst code and click this new bookmark that you just created. You will get a pop up that tells you how many characters are in the Omniture image request. If you are using Internet Explorer and the image request is over 2083 characters then you need to review your web analytics code and make some changes to your SiteCatalyst implementation.

Leave a Reply