dcsimg

How can I tag a header and an IFrame and avoid double hits on the initial page load?

Products

Webtrends Analytics 9.x
Webtrends Analytics 8.x

Cause

A page using a navigational header or side bar and calls pages within an IFrame. Due to tagging both pages, you are receiving double hits for the initial page load. If you remove the tag from the main page, then you cannot track link events.

Resolution

There is a setting in the tag which will tell the javascript not to fire a hit during normal page loading. In this way, double-firing of the tag can be avoided on page load but even traffic from the header can still be tracked.

1. Create two identical webtrends tags with the Link Tracking enabled using tagbuilder.webtrends.com

2. Rename one of the webtrends.js files to webtrendsheader.js

3. Edit the file and near the bottom of the webtrends.js file you will find the following:

WebTrends.prototype.dcsCollect=function(){
if (this.enabled){
this.dcsVar();
this.dcsMeta();
this.dcsAdv();
this.dcsTag();

4. Comment out the dcsTag function using two forward slashes like so:

WebTrends.prototype.dcsCollect=function(){
if (this.enabled){
this.dcsVar();
this.dcsMeta();
this.dcsAdv();
//this.dcsTag();

5. Ensure that the html include file for the header references this edited webtrendsheader.js file and the remaining pages reference the unmodified webtrends.js javascript file.

For theA10 tag,thissimply remove the .track() from the load.js file to accomplishthis.

Your site should now fire a hit for only the IFrames on page load, but when clicking links within the header the click events should successfully be logged.