# Segment to Exclude Staff

**URL:** <https://community.piwik.pro/t/segment-to-exclude-staff/2002>\
**Category:** Reports and working with data\
**Created:** [April 12, 2023, 12:50pm UTC](https://community.piwik.pro/t/segment-to-exclude-staff/2002 "2023-04-12T12:50:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![RiVentiv](https://avatars.discourse-cdn.com/v4/letter/r/3da27b/32.png) [@RiVentiv](https://community.piwik.pro/u/RiVentiv)\
**Post date:** [April 12, 2023, 12:50pm UTC](https://community.piwik.pro/t/segment-to-exclude-staff/2002/1 "2023-04-12T12:50:13Z")

</div>

I’d like to create a segment that excludes our own staff visiting the website. On Google Analytics I’ve done this with a combination of IP addresses and page-based parameters, i.e. anyone who visits a page with, for example, /admin anywhere in the url would be excluded. I found this was better at filtering out staff who accessed the site while working from home. Our CRM is hosted on our website so there’s quite a lot of traffic to filter. Does anyone have examples of how I might do this on Piwik? The parameters look like they’re slightly different so would appreciate any guidance on where to start, or if I need to approach it a different way any advice would be great to have.

---

<div class="post-metadata">

**Author:** ![Admin](https://avatars.discourse-cdn.com/v4/letter/a/3ec8ea/32.png) [@Admin](https://community.piwik.pro/u/Admin)\
**Post date:** [April 12, 2023, 12:56pm UTC](https://community.piwik.pro/t/segment-to-exclude-staff/2002/2 "2023-04-12T12:56:02Z")

</div>

Hi! If you want to stick to the page URL filter, my recommendation would be setting up a session-scope custom dimension. This one would be set to 1 (or true) once a page including “admin” in the URL is visited. Then you could use this dimension to create a segment that filters our internal traffic.

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/piwikpro/original/2X/9/974b0008e0f04cc97a2840838748eb62712cd0af.png)

---

<div class="post-metadata">

**Author:** ![RiVentiv](https://avatars.discourse-cdn.com/v4/letter/r/3da27b/32.png) [@RiVentiv](https://community.piwik.pro/u/RiVentiv)\
**Post date:** [May 4, 2023, 11:38am UTC](https://community.piwik.pro/t/segment-to-exclude-staff/2002/3 "2023-05-04T11:38:37Z")

</div>

Hey Kuba,

Thanks for your advice on this - I tried setting this up and tried it a couple of ways but I’m not sure I’m doing it right. When I applied the page url contains condition with multiple different ‘contains’ it seemed to cut everyone out, not just back end users. Also tried ‘does not match regex’ with the following: “^._(/admin|/crm|/user|/interaction-manager|/companies|/node|/bot-traffic.icu|/event-dashboard|/search/delegate/|/user|/search)._$”

That was based on help from ChatGPT so might be total nonsense. Any advice for how I can set it up? Thanks for your help so far 🙂

Richard.

---

<div class="post-metadata">

**Author:** ![Oliwer\_Kaczmarek](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/oliwer_kaczmarek/32/3888_2.png) [@Oliwer\_Kaczmarek](https://community.piwik.pro/u/Oliwer_Kaczmarek)\
**Post date:** [May 8, 2023, 10:58am UTC](https://community.piwik.pro/t/segment-to-exclude-staff/2002/4 "2023-05-08T10:58:03Z")

</div>

Hi @RiVentiv,

My recommendation would be to create a _custom session dimension_ (not event dimension) and set it’s value to true once someone visits the _/admin_ page. So here are the suggested steps:

1. Create a Custom Session Dimension (with name e.g. “stuff member”).
2. In tag manager create a custom dimension tag.
3. Select the Session dimension you’ve created and set dimension value to “true”.
4. Create a Page View trigger with event condition being “Page URL contains /admin”
5. Select the new trigger as a trigger for the tag from step 2.

Now you can use the custom session dimension in reports to exclude data from stuff members. Here is how:

1. Create a new segment and select the “stuff member” dimension created in step 1 (previous set of steps).
2. Condition for this dimension should be “is not true”

If you set it to “is true” then you’ll have a segment showing data only from stuff members in case you’d need to have this option too.

Best,  
Oliwer
