Common Web Site Configurations

This section of the ShortCut addresses common web site architectures that can cause problems with the Google Analytics tracking. Remember, the technology that Google Analytics uses to track visitors, called page tagging, is based on JavaScript and cookies. So any web site architectures, like multiple domain names, that affect cookies or JavaScript can interfere with tracking. Most of the changes required to deal with these web site configurations are usually made to your web site and not Google Analytics directly.

If your web site contains five static HTML pages, then it is very likely that this section will not apply to you. However, if you have a dynamic web site that crosses multiple domains and subdomains, then this section will offer you valuable information about how, and why, you should configure Google Analytics.

Dynamic Web Sites

A dynamic web site is one that uses query-string parameters, or variables, to determine which content the visitor is consuming. As discussed in the section on urchinTracker(), Google Analytics includes query-string parameters when it creates a pageview. Table 3 illustrates how a URL in the browser's location bar would appear in a Google Analytics report.

Table 3. How Google Analytics creates page "names"

URL in Browser

Resulting URL in Google Analytics

http://www.mysite.com/dir/index.php?sess=1234&cat=3&prod=foo&var2=bar

/dir/index.php?sess=1234&cat=3&prod=

foo&var2=bar

http://www.mysite.com/dir/index.php?sess=4567&cat=6&prod=bar&var2=foo ...

Get Google Analytics now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.