google / site-kit-wp Public
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Need an option to disable tracking logged in users #88
Comments
|
@Paras16699 Thanks for the suggestion. We will log this feature request for discussion. |
|
This is a necessity for websites with few readers. Without this option it's difficult to see if the increased traffic is because I've worked a lot recently, or because what I'm doing is attracting visitors. |
|
This would be a very useful feature. We already have the option in the settings to remove the snippet, so adding a toggle to do that for logged in users or admins would be helpful. Even adding a filter where we could return false to remove the output. That way developers could create more complex filtering to remove it for anyone logged in except subscribers for example. If such a filter already exists, please let me know. My site is running AMP for all pages in Standard. |
|
@felixarntz This is the issue we spoke about at WCUS. :) |
|
I don't know if whats development has been happening with this but i think i have worked a temporary fix until a toggle switch can be made. if you add the following script to a plugin or the theme's function.php file function wpdocs_dequeue_script() {
if ( is_user_logged_in() ) {
wp_dequeue_script( 'google_gtagjs' );
}
}
add_action( 'wp_print_scripts', 'wpdocs_dequeue_script', 100 );for what i know and tested, it does work but don't know 100% what affect it will have on the site. It can be adjusted for just admins. Currently, it disables tracking for all logged-in users. |
|
IB |
|
QA For both AMP and non-AMP sites the script is excluded when signed in and the "disable for logged-in users" is disabled. It still shows for anonymous users when that option is enabled. It always appears when the option is disabled. |
|
verified, lgtm |
|
Is this issue closed? |
|
@Aviad-Herman This specific issue is in relation to Analytics. You'll find this configuration at "Site Kit > Settings > Connected Services > Analytics > Edit", all from within your WordPress dashboard. There is a separate issue you'll find below in relation to a similar configuration for AdSense, this should be available soon. |


Feature Description
Currently, it's logging the data for logged-in users to Analytics and Search Console which is skewing the data. I wouldn't want my own site visits to be logged in to Analytics and Console.
Proposed solution
An option in the Settings page to exclude logged-in users.
A further granular control for specifying which roles to exclude would be more appreciated for people who only want to exclude Administrators / Editors, etc.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
trackingDisabledwhich is an array (for future compatibility, see related #536) with or without the valueloggedinUsers(i.e. the checkbox should probably have that as itsvalueattribute)loggedinUsers(in other words, the checkbox would be checked at first)Implementation Brief
loggedinUsersin thesettings.trackingDisabledarrayhandleSubmitto include the newtrackingDisabledkey to be savedsettingsdatapoint to ensure the key is includedVRT: Editing Settings Modulestory will need to be approved as it displays the Analytics setup in settings contextChangelog entry
The text was updated successfully, but these errors were encountered: