From Web Analytics Land: Why do we need to care about this? It lies in an inherent deficiency of Internet Explorer. IE can not accept a URL that is longer than 2083 characters. If your implementation is pretty complex and you are passing in a lot of variables, your image request can easily approach if not exceed that amount. Since Microsoft still commands the lion’s share of the browser marketplace, this is something we need to keep an eye on. If this was a problem with Opera or another third or forth tier browser then we may not worry about it. But this is not the case with Internet Explorer.
I have made no effort to conceal my hatred of IE 6.
My plan was to using ColdFusion, my preferred development language, take the nasty url and convert it into a Structure and then build an XML document to post to Omniture.
First I needed to just copy the url string into a ColdFusion variable to begin the process.
What a mess! Next I needed a Struct to be able to reference later that held the accepted XML tags for the Data Insertion API and the codes from the url.
NOTE: This is not meant to be a complete list of all options!
This provided a nice CFML struct
The next step would be to take the long url and break it up into a list or it’s own structure. I bounced a few ideas off of a fellow CFML coder and ended up with the following code block:
<cfset variables.urlStructSample = structnew() > <!--- Break up the url into sections ---> <cfloop list="#variables.testurl2#" index="listItem" delimiters="&"> <!--- split into smaller sections ---> <cfset variables.varName = listgetat("#listItem#",1,"=")> <cfset variables.varValue = urldecode(listgetat("#listItem#",2,"="))> <!--- build a new struct with values ---> <cfif StructKeyExists(variables.OmnitureXMLConverter, "#variables.varName#")> <cfset variables.tempHolder = variables.OmnitureXMLConverter['#variables.varName#']> <cfset variables.urlStructSample["#variables.tempHolder#"] = "#urldecode(variables.varValue)#"> </cfif> <!--- <cfset variables.urlStructSample["#variables.varName#"] = "#urldecode(variables.varValue)#"> ---> </cfloop>
This code will take the url, and break into a list using & as a delimiter. Then it will compare the list to the struct holding the xml tags and if a match is found it will build a new struct that has the xml tag as the struct keys and the values needed to be passed as the values. Resulting in a struct like this:
Next, we take this struct and build a properly formatted xml object to push to Omniture:
<cfset variables.OmnitureURLList = StructKeyList(variables.urlStructSample)> <cfset variables.xmlString = ""> <cfloop list="#variables.OmnitureURLList#" index="newListItem"> <cfset variables.tempValue = variables.urlStructSample["#newListItem#"] > <cfset variables.xmlString = variables.xmlString & "<" & "#newListItem#" & ">" & "<![CDATA[#variables.tempValue#]]>" & "</" & "#newListItem#" & ">" > </cfloop> <cfxml variable="xml2Omniture" > <?xml version="1.0" encoding="utf-8" ?> <request> <sc_xml_ver>1.0</sc_xml_ver> <reportSuiteID>your-report-suite-id-here</reportSuiteID> <IPaddress><cfoutput>#cgi.REMOTE_ADDR#</cfoutput></IPaddress> <cfoutput>#variables.xmlString#</cfoutput> </request> </cfxml>
This code will result in an xml object like this:
Last step would be to push the xml object to Omniture:
<cfhttp url="http://namesSpace.112.2O7.net/b/ss//6" method="POST" useragent="#CGI.http_user_agent#" result="objGet"> <cfhttpparam type="XML" value="#xml2Omniture#" /> </cfhttp>
I have not done any testing to see what impact this process would have on site performance or how it performs against the normal JS beacon. But if you have a situation where the amount of data that had to be passed to Omniture exceed the magic 2083 characters, this is an approach you could take.
Thanks to Web Analytics Land for his original post, and thanks to Craig for bouncing some ideas back and forth on this.