Reputation: 171
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
Reputation: 21
Try:
header('Location: http://www.example.com/?id=154077');
header('X-Robots-Tag: noindex, nofollow', true);
Upvotes: 2
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