The Incredible Editable SDC Tag
Applies to Software, On Demand
If you’ve had the opportunity to take a look under the hood of your SDC page tag (and you understand javascript) then you should be pleasantly surprised at how readable the SDC tag is. Take a look at almost any other tool and you’ll find an obfuscated mess. There is not a chance that you could modify how those work. But the SDC tag? Go ahead and hack it up to your heart’s content! (Sidenote: This points to a fundamental difference between WebTrends and most other tools: WebTrends wants you to customize, to make it work just how you want it to work. The price is that you can screw things up monumentally, but if you don’t have a cookie cutter site then why would you want a cookie cutter analytics tool?)
There are probably some WebTrends’ Insiders who are breaking out in a cold sweat after reading that. In the past I have been discouraged by WT from messing with the code. Talk of upgrades and difficulty of support were bandied around, and ignored by me. Just try to segregate your additions and comment your modifications and you’ll be fine. The code is pretty mature and it doesn’t tend to change much from version to version so additions and modifications are usually fairly easy to port to a new version of the tag.
That said, it must be noted that WT just rolled out http://tagbuilder.webtrends.com. This is a nifty new tool that will create customized code that contains only what you need it to contain. The code it puts out has also been completely re-written from the previous standard WT code. It is still readable, but now it’s all object oriented. Very fancy, and it requires slightly more sophisticated javascript knowledge if you want to customize it without making a mess of the whole thing.
So anyway, what are some common customizations? Here are a few simple ones:
- Translate some sort of information on your page into a standard WT variable. There are a bunch of ways to do this that don’t involve modifying the Javascript, but sometimes it’s easiest to just say WT.xyz = myVariable in the code. That way you can add all sorts of If..Then’s and such to get it just right.
- Modify the page title. Many sites have very useless or repetitive title tags. Writing a bit of Javascript to pull actual useful information into the WT.ti tag can make your reports much more readable. Examples include stripping out your company name if it appears in every single title tag, replacing the title with a main header from the page body, or parsing the URL and extracting a useful page title from that.
- Pull in information from 3rd party iframes on your page. These are starting to become pretty common as sites contract with other companies to provide services or content. Examples of these 3rd party services include product reviews, FAQs, maps and news. Typically information in these iframes isn’t available to the WT tag because they often load after the tag fires. What to do? Write some javascript that delays the tag firing until the iframes are loaded and you’ve got the information you need from them. (This can be tricky because you don’t want to miss short page views that are over before the delay is up, but a smart javascripter can make sure the tag fires almost all the time.)
How have you modified the WT tag?






9 comments
It’s not clear to me from the limited WebTrends documentation, but your line above about translating data into standard WebTrends variables implies that WebTrends no longer needs meta tags. If that’s true, then this is a catch up with competing packages, and something you’d thing WebTrends would promote more actively.
WebTrends has never really _needed_ meta tags. They’re just usually the most convienent way of setting variables, and it is a nice feature that WT has that most other packages lack.
With SDC you’ve always been able to directly set the variables in javascript. The only thing to watch out for is that you need to do it after they have been created and before they’re sent to the server. This capability is identical to every other analytics package I’m familiar with.
That’s good to know! I must have missed that in the documentation.
Hey Webtrends Outsider. We love all your info on webtrends. Our metrics team here has some more detailed questions and requests for blogs. Would you be able to contact me offline? I was looking for some contact info on your page and I wasn’t able to find a direct email link.
Hi Sarah – I (rocky) sent you an email, and meanwhile we have added an email address to the footer. Thanks for the kind words.
Hi rocky and Boris,
You guys rock, and this blog is just plain awesome.
I got a little question/comment: shouldn’t we be careful with modifying the tag code itself in terms of suport from WebTrends? Although a good javascript coder (which I am not to my despair) can do marvels with the WT tag, it is my understanding that doing so would render that instance of the tag not supported by WT tech support; they will refer you to their professional services if you need any assistance. Am I right?
Love this blog! One thing I have added to our SDC logs is the Authenticated User name (I manage analytics for intranet sites). I use a custom variable: WT.user. While we could use other WebTrends tags, this enables a bit more flexibility in the long run. We use this to sessionize our traffic, giving us a (shall I say) UBER-accurate Visitor Count. Through PERL, we also use this to create a .csv Unique Users Per Page report. Something WT can not do!
That is superb, Bos.
How is the csv Unique Users Per Page report different from a 2D report with primary dimension URL and secondary dimension the value of WT.user?
Can anyone tell me, if this will be useful for tracking the tabs in a webpage? If yes, how to do it?
Leave a Comment