Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 631
Francisc Avatar asked Dec 27 '22 22:12

Francisc


1 Answers

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)

like image 73
Crayon Violent Avatar answered Mar 23 '23 17:03

Crayon Violent