Created
June 18, 2011 16:58
-
-
Save epicdaze/1033276 to your computer and use it in GitHub Desktop.
#wordpress - add google analytics exclusion cookie to page when logged in as admin #analytics #exclude #cookie #admin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- /* add a google analytics exclusion cookie to the blog when logged in as admin (or other role) */ --> | |
<!-- /* edit the <body> tag in header.php */ --> | |
<body <?php body_class(); ?>> | |
<!-- /* replace with this line: */ --> | |
<body <?php if (current_user_can('manage_options')) {echo 'onLoad="javascript:pageTracker._setVar(\'test_value\');" ';} body_class(); ?>> | |
<!-- /* | |
to change the role to which this cookie is served, change the capability in (current_user_can('capability')) to one of these: | |
super administrator: manage_network | |
administrator and up: manage_options | |
editor and up: edit_others_posts | |
author and up: publish_posts | |
contributor: edit_posts | |
subscriber: read | |
reference: http://codex.wordpress.org/Roles_and_Capabilities#Capability_vs._Role_Table | |
*/ --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment