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
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.
Try:
header('Location: http://www.example.com/?id=154077');
header('X-Robots-Tag: noindex, nofollow', true);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With