Is it possible to use user defined segments in the reporting API?

Hi, new Piwik user here and I have a quick question.

Is it possible to use user defined segments in the reporting API?

I am defining a segment in the dashboard to track unique visitors who have visited a certain subset of pages (pageName=“aaa”,pageName=“bbb”, etc.). Other than using the dashboard itself I am also using the API to retrieve the data for further processing.

Since I am doing pre-processing, I would like to avoid having to redefine the entire segment again when I call the API and would rather use the pre-processed data. But I did not see using custom defined segment in the reporting API. Is this possible?

thx.

Hi there,

if you use the exact same segment string segment=XYZ then the preprocessed data will be reused, so it should “just work” for you.

Otherwise, here is a related feature request: segment with idSegment · Issue #8209 · matomo-org/piwik · GitHub