Last Thursday's Google outage had a dramatic impact on more than just Google users. It was widely reported that the outage killed 5% of Internet traffic and prevented users from accessing popular services such as Gmail and YouTube. The less-reported aspect of the story is that the outage also impacted some websites using Google Analytics. During the outage, the visitors to those sites noticed distinctly slower-than-normal loading times.
The slow-loading websites problem was caused by the way that the Google Analytics tracking code was added to the site pages. The Google Analytics page tags are hosted on Google's servers, so if the tracking code was placed at the top of the HTML page, visitors experienced delays while the content below that code loaded.
There are risks and benefits with placing web analytics page tags near the top of the HTML code or near the bottom. Last week's outage highlighted the risk of placing the tag at the top. Because of this potential issue, Stratigent has generally recommended that the Google tracking code be placed at the bottom of the page, immediately before the tag. This ensures that visitors see your site content before the Google page tag is requested.
Although there are some exceptions, this best practice also applies to other page tag-based tools. There are rare cases when the data-collection servers for any web analytics tool are either down or slow. Putting the page tag code near the bottom of the page will prevent this from adversely affecting the visitor experience.
Nestor Archival Jr.
Senior Analyst, Consulting Services
Stratigent, LLC
Thursday, May 21, 2009
Friday, May 15, 2009
Tracking 301 Redirects in WebTrends
One way to track referrals from a 301 redirect is to append a URL parameter. However, if you use a question mark (?) to do so, you will create duplicate content issues that impact your search engine rankings. To solve this issue, use a hash (#) tag instead.
In WebTrends, tracking hash tags as part of the query string requires custom changes to the page tag.
CAUTION: Don't change your WebTrends page tags unless you are familiar with JavaScript and the WebTrends tracking code. Always perform testing of code changes before moving changes to production.
Old Tag Versions
For older tag versions (1.x.x), the following changes need to be performed on the wtinit.js and wtbase.js files.
(1) In the wtbase.js file, add and run a dcsHash() function that will parse “hash” parameter-value pairs. For each page tag call, dcsHash() is called if and only if the custom trackhashes variable is set to true (set in step 2).

(2) Add a line of code to the wtinit.js file that enables a flag needed in the tracking of “hash” parameters.

To turn off the tracking of hash parameters, you can set this.trackhashes to false.
New Tag Versions
Due to code structure changes in the most recent tag versions (8.x.x) created from WebTrends Tag Builder, there are slight differences to the way you should modify the new tags compared to the old ones. The following changes need to be performed on the inline code and webtrends.js file.
(1) In the WebTrends() function of the webtrends.js file, assign a default value of false to a custom trackhashes variable.

Note: Always set the trackhashes variable to false since this acts as a default value. If you want to enable the tracking of “hash” parameters and set this variable to true, do so in step 3 below.
(2) In the webtrends.js file, add and run a dcsHash() function that will parse the “hash” parameter-value pairs. For each page tag call, dcsHash() is called if and only if the custom trackhashes variable is set to true (set in step 3).

(3) In the inline code right before the _tag.dcsCollect(); line, set the trackhashes value to true to enable the “hash” tracking functionality.

To turn off tracking of “hash” parameters, you can set _tag.trackhashes to false.
When this has been completed, the WebTrends tag will treat the “hash” parameters as if they are regular query string parameters. You will then be able to use and report on the “hash” parameters as dimensions in custom reports.
Nestor Archival Jr.
Senior Analyst, Consulting Services
Stratigent, LLC
In WebTrends, tracking hash tags as part of the query string requires custom changes to the page tag.
CAUTION: Don't change your WebTrends page tags unless you are familiar with JavaScript and the WebTrends tracking code. Always perform testing of code changes before moving changes to production.
Old Tag Versions
For older tag versions (1.x.x), the following changes need to be performed on the wtinit.js and wtbase.js files.
(1) In the wtbase.js file, add and run a dcsHash() function that will parse “hash” parameter-value pairs. For each page tag call, dcsHash() is called if and only if the custom trackhashes variable is set to true (set in step 2).

(2) Add a line of code to the wtinit.js file that enables a flag needed in the tracking of “hash” parameters.

To turn off the tracking of hash parameters, you can set this.trackhashes to false.
New Tag Versions
Due to code structure changes in the most recent tag versions (8.x.x) created from WebTrends Tag Builder, there are slight differences to the way you should modify the new tags compared to the old ones. The following changes need to be performed on the inline code and webtrends.js file.
(1) In the WebTrends() function of the webtrends.js file, assign a default value of false to a custom trackhashes variable.

Note: Always set the trackhashes variable to false since this acts as a default value. If you want to enable the tracking of “hash” parameters and set this variable to true, do so in step 3 below.
(2) In the webtrends.js file, add and run a dcsHash() function that will parse the “hash” parameter-value pairs. For each page tag call, dcsHash() is called if and only if the custom trackhashes variable is set to true (set in step 3).

(3) In the inline code right before the _tag.dcsCollect(); line, set the trackhashes value to true to enable the “hash” tracking functionality.

To turn off tracking of “hash” parameters, you can set _tag.trackhashes to false.
When this has been completed, the WebTrends tag will treat the “hash” parameters as if they are regular query string parameters. You will then be able to use and report on the “hash” parameters as dimensions in custom reports.
Nestor Archival Jr.
Senior Analyst, Consulting Services
Stratigent, LLC
Subscribe to:
Posts (Atom)
