Enable Google Analytics Page Tracking in a Single-Name Intranet Site

Recently I’ve been asked how to get Google Analytics working in an intranet site with a single name in the URL, for example: http://intranet. The first time I added Google Analytics to a site it was a development site accessed by server-name:port-number. For days after correctly adding the tracking code there was still no data showing up in the Google Analytics dashboard reports.

Turns out the fix required adding one simple JavaScript call to a Google JavaScript API function. When adding Google Analytics tracking code to a site with a single name in the URL you need to call _setDomainName(“none”) prior to making the call to _trackPageView:

image

Continue reading

Exclude traffic from directory – Analytics Integrations | Google Groups

I have two profiles on my site that I want to separately monitor in Google Analytics.

Profile A: The entire site: http://www.mysite.nl
Profile B: One certain directory on my site: http://www.mysite.nl/mydir/

Profile A should not include traffic from the subdirectory /mydir/ and
Profile B should not gather any information but in the directory mydir.

There are two solutions:

For Profile A:
create a ‘custom filter’:
‘exclude’
Filter Field: Request URI
Filter Pattern: ^/mydir/

For Profile B:
create a ‘custom filter’:
‘include’
Filter Field: Request URI
Filter Pattern: ^/mydir/

or

(For Profile B:)
create filter:  ‘include only traffic from a subdirectory’
Subdirectory: ^/mydir/

Source : Groups Google