umami icon indicating copy to clipboard operation
umami copied to clipboard

Feature request: filter urls that match a pattern.

Open artfulrobot opened this issue 1 year ago • 12 comments

Describe the feature or enhancement

A common URL pattern might be /blog/{title}

A common need might be to know how many visitors to blog pages you've had.

Currently you can't do this because you can only filter by discrete URLs. e.g. you could filter separately on /blog/why-are-red-shoes-so-good and /blog/happiness-comes-to-those-with-nice-shoes but you'd need to add them up and that would include overlaps and anyway if you had dozens of blog entries then that would take ages.

Being able to search for urls that start with blog would pick up all these. Being able to search for blog*shoes might bring up all the blog posts about shoes.

Not sure if it's relevant, but you can do this in Plausible and of course you can do it in GA (at least pre GA4, not sure about 4). Plausible's filter says:

Hint: You can use double asterisks to match any character e.g. /blog** to group all of your blog posts. Or use double asterisks in front and back (e.g. **keyword**) to group all URLs containing a specific keyword.

artfulrobot avatar Jun 05 '23 16:06 artfulrobot

This would be a great feature to add.

BlaineMoore avatar Jun 19 '23 18:06 BlaineMoore

This issue is stale because it has been open for 60 days with no activity.

github-actions[bot] avatar Aug 20 '23 01:08 github-actions[bot]

Hey @mikecao @artfulrobot @BlaineMoore , I think for this we should introduce content group tags using umami.track();

For example: If we have different url's like:

  1. /blog/first-blog
  2. /blog/second-blog
  3. /blog/third-blog
  4. /blog

Then the front-end team of the project should add a custom event on these pages that should look like this: umami.track('set', 'content_group', '/blog');

a. set - we want to set a custom event (content-group in this case). b. content_group - this is our event name c. /blog - this is the group name

Using this the users will have more authority over what they want to include in which content-group and content-grouping can be done at any levels.

I'm open to discussion for this feature.

iamyashkhandelwal avatar Aug 23 '23 14:08 iamyashkhandelwal

@iamyashkhandelwal I think that's a different request. URLs are the mainstay of stats reporting and are common to every page request; My request is about making those more searchable when they already represent structured data, as they often do. I feel your request is an additional/secondary way to group certain data, which is fine but is not the same as filtering the core URL property.

(~~Incidentally, my PR works to do this, although it needs updating now~~).

artfulrobot avatar Aug 23 '23 15:08 artfulrobot

Having recently upgraded, I note that we have some architecture for filters:

image

but it's lacking a LIKE, or "starts with" etc.

artfulrobot avatar Aug 23 '23 15:08 artfulrobot

Yes, It might be considered as a new feature, but I think its useful too. Waiting for your inputs @mikecao @BlaineMoore

iamyashkhandelwal avatar Aug 25 '23 04:08 iamyashkhandelwal

Also @artfulrobot , is the snapshot you have shared released/merged in master?

iamyashkhandelwal avatar Aug 25 '23 04:08 iamyashkhandelwal

@iamyashkhandelwal

Yes, It might be considered as a new feature, but I think its useful too.

I don't doubt the usefulness, it's just it's not about filtering existing URL data, it's about suggesting a new events based feature and deserves its own issue so it can be discussed properly.

snapshot..

the screenshot is from v 2.5 I think, from the docker image.

artfulrobot avatar Aug 25 '23 07:08 artfulrobot

We are also very interested in this feature. For devs regex match would be perfect. Then for non devs: equals does not equal contains does not contain starts with does not start with ends with does not end with

ScottEAdams avatar Oct 02 '23 12:10 ScottEAdams

Also very interested in this feature. Can also contribute if needed.

Could we start by adding the commit form @artfulrobot that adds * to the dev syntax to turn it into a LIKE query? https://github.com/artfulrobot/umami/commit/2257ad7b709d39d2dba1478f5c1c0f1ccd0a44d3

MariusVB avatar Oct 18 '23 13:10 MariusVB

Newer implementation ideas drafted at https://github.com/umami-software/umami/pull/2367

artfulrobot avatar Oct 26 '23 09:10 artfulrobot

Also very interested in this, and would love to contribute if needed. Is there any progress being made on this somewhere other than https://github.com/umami-software/umami/pull/2367?

anton-g avatar Jan 30 '24 08:01 anton-g

Would love to see this implemented as well. Being able to filter by path-based regular expressions is critical for us.

markwoon avatar Mar 02 '24 00:03 markwoon

Added additional filters in v2.11.0. Its currently a full wildcard search Contains / Does not contain, but we have something to iterate on if we want to add more patterns.

franciscao633 avatar Apr 04 '24 22:04 franciscao633