Filter Out Admin Users from Google Tag Manager Script

Here’s how you can achieve this:

  1. Create a Theme Component
  • Add a custom theme component to push an isAdmin flag to the dataLayer
  1. Configure Google Tag Manager
  • In GTM, create a new Data Layer Variable:
    • Name: isAdmin
    • Data Layer Variable Name: isAdmin
  • In your pageview or analytics tags, add a trigger condition so the tag fires only when isAdmin is not true.
  1. Result:
  • Admin user page views will not show up in GA reports as long as the trigger condition excludes them.

Guides