Prevent Google Analytics From Tracking WordPress Admin

Add Tool

Prevent Google Analytics From Tracking WordPress Admin


Prevent Google Analytics From Tracking WordPress Admin

Want to prevent google analytics from tracking WordPress admin page views! This handy snippet will prevent Google Analytics from tracking your Admin pages or anything else that you wish. Simply add this WordPress snippets after <body> starting tag

<?php if (!current_user_can('level_10')) { ?>
	/* Google Analytics Code */
<?php } ?>


Here,
level_10 is WordPress admin label
Now replace /* Google Analytics Code */ with your own Google Analytic codes.
This code will then include your Google Analytics code only on non-Admin pages. This in turn will prevent Google Analytics from gathering statistics about WordPress admin pages.

Note that the basic functionality of this method is great for restricting just about anything — scripts, markup, content — to logged-in administrators.


Tags: google analytics wordpress, wordpress google analytics, add google analytics to wordpress, how to add google analytics to wordpress, google analytics for wordpress
Payza

About Masum Billah

Prevent Google Analytics From Tracking WordPress Admin 1stWebSuite website seo tool is a free website ranking tool site provides a lot of on page and off page seo useful tools for you. On this site, we have a large number of website ranking tools


SIGN UP TO GET UPDATE TO YOUR INBOX




Discuss about: Prevent Google Analytics From Tracking WordPress Admin


adf.ly