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