Filter Page URLs by Segments

Why does it render Matomo useless, can you explain more what you’re trying to achieve? there is probably a different way to do it (for example, create a goal: Track Goals and Measure Conversions User Guide - Analytics Platform - Matomo )

Hallo,

the problem is that we use Matomo to track various parts of a big website and split the results into smaller pieces for our customers. Lets say we have ‘https://www.example.com’ and within this url, there are subspaces like ‘https://www.example.com/forum’ or ‘https://www.example.com/news’ or ‘https://www.example.com/whatever’.

We have about 150+ Segments who all look something like “url starts with https://www.example.com/forum” so the specific group who administers this area of the page get statistics about everything with ‘https://www.example.com/forum’ and below.

Now those results contain various other urls, and that is not what is defined within the filter. The filter says very explicit, only to accumulate things which start with https://www.example.com/forum and nothing else. So from our point of view, the filter is now broken, all results are useless. Its not a new feature, those other urls simply do not belong in this results.

1 Like

Just to chime in: we faced the same in believing it was a bug.

Multiple clients using the updated matomo are explicitly not happy with the change, a few even insist we downgrade to previous version until this new behavior becomes optional (which we hope it will?)

1 Like

Same issue here, we thought it was a bug and clients where really confused since existing dashboards and reports where affected. Nothing was mentioned in the release notes either from what I can understand.

However I do think it is a great feature, but I would actually suggest we add both variants.
We need both action and session based segments, that would be a great improvement to Matomo!

1 Like

Hello!

We have the same issue.
That’s a huge problem for us. We have the same problem as Khabaal. Our customer can not understand it.
We have over 200 segments that do not work anymore! Our customers expect these reports every week and now … ??

@matthieu Defining goals is no solution for us. Can you think about undoing this?

Regards
Pete

2 Likes

Thanks all for the feedback. We understand it’s not expected to change this behavior. From our perspective it was a bug we long wanted to fix, as most people expected the current/new behavior. The reason we did it before Matomo 4.0.0 release is because it can greatly improve archiving performance in some cases. It was mentioned in the changelog quickly, here is the original issue: https://github.com/matomo-org/matomo/issues/11900

Thats not really a good solution, at least for us.

It would mean to change Dimensions on the site again, whenever something would change in the wanted URL filtering; they wont be able to be created on the fly, like segments did. Plus, needing to put something on the website‘s tracking code instead of filtering gathered daza and not be able to use historic data is not a good alternative.

Wait: If I read that right [never worked with dimensions], could we add a dimension called „url“, then put the pages canonical url in there, and then create segments not based on the url but the Dimension „url“, and then get custom segmentation in the reports back, without needing to set distinct specific dimension in the website? We‘d still lose historical data, but at least it would be a way forward. Still, we got an installation with 300gb data, correcting that for proper historical data will be a major effort, also modifying all existing 400 segments…

(We use matomo for a large german city, and the installation covers multiple satellite sites, many backend users with custom segments for their resorts)

Hello Matthieu,

the issue you are referring describes a mistake when using the parameter “page URL”. We used the parameter “action URL” and that does not work anymore. Was that the intention too?

Where is the difference between page and action URL now?

Regards
Pete

I’m representing one of those that see this new segment behavior as a defect. We are using segments for purposes that can be anything between exclude “internal users”, include “Only mobile devices”, include “Server Time 00:00-07:00” and so on. And of course, we have many segments that just include a pattern of URL’s that will narrow the scope of reports to only include a part of the website.

In the way we were using URL based segmentations pre 3.12.0 we created subset of data for our entire site. (Similar to Views in Google Analytics). All those segments are now useless after update to 3.12.0
However, I can see a need for segmentation to be session based but also a great value in being able to do versions that are event based, especially page URL’s.

In fact some variables that can’t change during a visit will always be session based. Like Device Type, Traffic Source, Geo data, Entry Page etc.
Would it be possible to have a configuration for each segment that could be set to either:
Events - Returns all events that match the criteria (With event I mean any page view, downloads, event, actions etc)
Sessions - Identify the sessions that match the criteria, and return all the events in those sessions.

I’m really looking forward to a solution or worksaround to be able to do URL event-based segmentation again.

3 Likes

sorry about the confusion, but actually my previously written solution using custom dimension does not work :expressionless: Currently it’s not possible to segment only a set of actions and exclude other non matching actions from the reporting. Segments now filter out visits. We’d have to build a new feature or option in the future.

In the way we were using URL based segmentations pre 3.12.0 we created subset of data for our entire site. (Similar to Views in Google Analytics). All those segments are now useless after update to 3.12.0
However, I can see a need for segmentation to be session based but also a great value in being able to do versions that are event based, especially page URL’s.

In fact some variables that can’t change during a visit will always be session based. Like Device Type, Traffic Source, Geo data, Entry Page etc.
Would it be possible to have a configuration for each segment that could be set to either:
Events - Returns all events that match the criteria (With event I mean any page view, downloads, event, actions etc)
Sessions - Identify the sessions that match the criteria, and return all the events in those sessions.

I’m really looking forward to a solution or worksaround to be able to do URL event-based segmentation again.

Could you create this feature request on Github? We could add it in the future.

Thanks,

Thanks for acknowledging.

Wanted to make that request and already found it:

Also: Feature: Allow Segments to be applied not to session, but directly as the query states · Issue #15133 · matomo-org/matomo · GitHub

What you probably want to use is maybe the label filter in the API see https://developer.matomo.org/api-reference/reporting-api or you can search within the data table in the UI.

If you have Custom Reports then you can use this plugin to create such a report as it allows to define “segment filters”. Then the custom report will only show these pages that match the filter.

Not recommended: You could for now probably also disable this new behaviour using a config setting in config/config.ini.php:

[General]
enable_segments_cache = 0

But we don’t recommend this and it will be removed in Matomo 4 where you would have the same problem again. There may be also other issues with disabling this setting but it should work.

Source: https://github.com/matomo-org/matomo/issues/15130#issuecomment-551252343

Some documentation has been added to the FAQ in How do I measure and get reports for my page sections / categories / mini-sites / languages? FAQ - Analytics Platform - Matomo

FYI a new feature request was created which would help with this use case: Full support for Filters in Matomo 4 · Issue #15438 · matomo-org/matomo · GitHub

Hello Matthieu, hello everybody,

I have the same issue. I also thought it’s a bug or I make something wrong in segment filter: site list includes much more url’s also not matched with filter in segment definition.
But thank you very much for this feature request in Matomo 4.

Hermann

1 Like

Same issue here - I want to be able to segment pageviews by language (e.g. URL contains /en/ vs. URL contains /fr/) but the current segment functionality does not support this.

Is there a workaround to get this desired behavior in the Matomo UI? @PeaceSfiSh you mentioned “the search function”? Mind explaining how to achieve this?

Thanks all.

Now this is totaly usless.

I am one of the the user suffering the same issue…we just simply want to collect the figures about some groups of URLs through creating a segment but now it will return something we don’t need. Even the suggested way which using the Goal to do the similar thing, i do believe it is just a work around and be honest i think it is not make sense. So what can we do now? is it possible to have a patch so that it can be back to the original “normal” behaviour? Many thanks.