Google Analytics - only track traffic to a folder of the site

Francisc picture Francisc · Apr 12, 2011 · Viewed 12.3k times · Source

I want to track traffic for mysite.com/current-campaign/ and careless about traffic on mysite.com in general.

Is it ok to place the GA tracking code in the files inside the /current-campaign/ folder or does it HAVE TO be in the root of the server for tracking to work?

Answer

Crayon Violent picture Crayon Violent · Apr 12, 2011

GA will only track on the pages you actually put the tracking code on, regardless of where the page is located (unless you start messing with things like domain settings or filters etc..).

So IOW yes, it is okay to do that. If you don't have tracking code on mysite.com/somePage.html then it's not gonna track that page (though it might show up as the URL in some reports like referring URL or exit link or whatever, same as any other page you don't track)