How to Disable Google Analytics for Logged in Users

| Last Updated: | In: Freebies, Google


If you are running a membership based website and don’t want to track your website’s authors and writers and only want to track real visitors of your website, then this tutorial is only designed for you.

In this tutorial, I will share the WordPress function which will allow disabling google analytics for logged in users. replace the “XXXXXXXX” value with your own google analytics property ID. I have used wp_head() function in below example so that google analytics code will be display in the header part of front-end website.

How to Disable Google Analytics for Logged in Users

How to Disable Google Analytics for Logged in Users

After using this function you can track your visitors except for your Authors and Writers. Open your functions.php file from current active themes folder and copy paste below code at the end of the file. If your functions.php file is not available in your theme folder, then create new functions.php file and add the below in it.

If you still need any help to disable Google Analytics for logged in user, then feel free to put your comments in below comment section. I will be happy to help to disable Google Analytics for logged in user on your website. Do you like & share this article with your friends, and don’t forget to follow us on Facebook and Twitter to learn cool WordPress tutorials.


About: Prem Tiwari

Prem Tiwari is the founder of freewebmentor.com and is a professional developer who has vast experience in PHP and open source technologies. Apart from this, he is a blogger by hobby.


You may also like:


, , , , , , , , ,