ajguk
ajguk

Reputation: 171

Remove pages from Google Analytics

I have my Google Analytics tracking code held in my header.php include file. How can I remove this from certain pages? There are a couple of pages I don't wish to track for various reasons.

I've tried a regex filter in GA but to no avail.

Thanks

Upvotes: 3

Views: 227

Answers (2)

gilly
gilly

Reputation: 21

Try:

header('Location: http://www.example.com/?id=154077');
header('X-Robots-Tag: noindex, nofollow', true); 

Upvotes: 2

Mario
Mario

Reputation: 36497

If it's inserted in your own server side code, why don't you just add some if() around it to only embed it if some regex doesn't match (check current request) or some flag isn't set? Filtering on GA sounds a bit like a not so optimal solution as the dataset will be created already.

Upvotes: 5

Related Questions