Remove pages from Google Analytics

google-analytics, php

Solution

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.

Problem

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

Original source