• Resolved lencw

    (@lencw)


    I have put the GA script in the non-necessary block, and it works with permissions on and off as expected. However, I have previously used a plugin for GA code that has a switch to prevent GA code if the session is a logged-in admin user, so we are not logging their activity.
    The non-necessary block is JS only, is there a way to add the script if consent and if not an admin rights WordPress user?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author WebToffee

    (@webtoffee)

    Hi @lencw,

    Sorry to let you down, but there is no option to execute the scripts based on PHP condition check.

    Thread Starter lencw

    (@lencw)

    Thanks for confirming, would you consider this in future?
    For now I have added a filter in the GA view admin to filter out URLs for wp-admin and wp-login.php, but that does not remove tracking for a logged-in admin user looking at the front end of the website.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Block google analytics code for admin user’ is closed to new replies.