You can use current_user_can() to determine if an admin user is logged and load your Google tracking code using wp_enqueue_script with an if statement in functions.php
if ( ! current_user_can( 'edit_posts' ) ) {
wp_enqueue_script( 'google-tracking');
}
Related Posts:
- How to Change the Default Home Page for the WordPress Dashboard?
- Sort pages in loop by admin’s page attributes order field?
- Cannot access admin panel
- Daily notices of failed login attempts for non-existent admin user
- Setting Login with User Name and Password default option for Jetpack Admin Login
- I keep getting logged out in Firefox
- Error thrown. Cannot create references to/from string offsets
- Unable to login, old site with previous developer gone
- Using shared SSL for login/admin
- wp-login behind nginx reverse-proxy inaccessible — bad redirect?
- Can’t access dashboard as administrator, login as any other level works though
- WordPress Admin Login Redirect Problem
- Unable to Access WP Admin or Login buttons after Migration
- using rewrites to secure login page
- Client system for media review?
- WordPress administration Over SSL – To Force SSL Logins and SSL Admin Access
- Keep Logged in Users out of Admin Panel
- Unable to get to the admin panel
- I can’t access the login panel on my offline website
- Admin login not working
- Can’t login to my admin area
- Does deleting the table users prevent all logins?
- Locked out of WordPress website from wrong amount of login attempts
- current_user_can(‘administrator’) not working in custom login
- Send admin to a different login than users?
- Want to know who is login Admin/User
- Remove iPhone detection on login page
- Any known plugins for master admin login to edit all on front end?
- Login to admin by frontend form?
- Error “Sorry, you are not allowed to access this page”
- I can’t access login page
- Admins loggin in to our wordpress site default to the admin page
- WordPress login not working
- Login to Admin Dashboard Problem
- WordPress login process is hanging
- WordPress “Hide WP” Gives Me Error After Admin Login [closed]
- Scripts are not called until I login from wordpress backend
- Disable wp-admin log on lightbox overlay
- How to cancel redirection to admin side
- Can’t access my wp admin: captcha images invisible, gives me error message
- 2FA for admin login only, is it doable?
- What are the standard admin CSS id/class tags?
- how to know if admin is in edit page or post [duplicate]
- How to remove entire admin menu?
- How can I target WordPress 3.8 new interface MP6 with CSS?
- Settings API – easiest way of validating checkboxes?
- Read only capability for custom post in admin area
- How can ‘admin_email’ be set?
- How to change WordPress default strings?
- How to customize wordpress login/register pages?
- Remove ability to access certain admin menus
- Gutenberg “Add Block” button is not active (greyed out), cannot add new blocks
- How To View Site from Non-Logged-In User’s Perspective
- Wrong url in sortable column headers & pagination in the admin, when behind a proxy
- “Automatically add new top-level pages” Default
- Is it possible to hook AJAX to UPDATE-button?
- Check if user is logged in else login page
- Which hook for processing plugin page form data?
- Add tabbed menu to admin page
- WYSIWYG – Getting the “link” button from HTML mode in Visual mode
- Include admins in author drop-down on edit post screen
- How can I restore admin capabilities?
- Adding another “Add Post” button to admin
- Admin page redirect to another admin page
- How to solve 500 Error on WordPress Admin Dashboard due to time-out on getdirsize
- Enabling users to replace site title (text) with a image logo (but keeping the text if there isn’t any image)?
- WordPress How to begin editing from admin page (please see picture)
- WordPress as a web app – always auto-save post and meta data
- Custom Thickbox Broken on Dashboard Page?
- Categorizing Page Templates
- Save author posts as in pending review – block users updating their posts
- Edit Auto Update Admin Notification
- Add custom button next to native “Apply” button in the edit-tag screen
- Enqueue and Dequeue from admin bar nodes
- How to enqueue admin content outside admincp
- How do I correctly transfer my site from one domain to another?
- Where can I store common cross-site text (e.g. headings, titles etc.)
- get_current_screen and the WP_Screen class
- How to find a spam link?
- How to change all “Post” texts in dahboard into “Article”?
- How to modify admin headers
- Directly editing content on webpage, is it possible?
- How to disable Media Library uploads for non-Admin users?
- Admin user lacks admin permissions after hack and can’t reinstate
- Redirect public site to another one but allow administrators to access the old site
- “sufficient permissions” error for admin after duplicating WP database to new install
- Passing state from child component to parent component in a Gutenberg Sidebar
- I can’t enter the control panel of my wordpress site after channing the URL to https://
- Error 404 Display on otherlinks apart from homepage
- Sortable admin columns by 0.00 number
- WordPress Admin Thickbox: Remove Margins/Padding
- How to change the title attribute for the WP logo image on wp-login.php
- WordPress Admin Email
- Editing post in admin panel
- site admin for subscribers
- Customise the add media pop-up to include rel attribute option
- Custom Div with links on Admin Bar
- WordPress admin loads erratically “connection reset by peer”
- How to fix broken admin Thickbox?
- Pull Random Images From Options Page [closed]