Ecommerce Items Widget


I am trying to fetch a data table with the following columns:
“item name”, “number of orders containing item”

The items I am tracking are categorised in two different categories and I want only the items with category A.

Currently I am using an APIRequest with the “Goals.getItemsName” method, but that only gets me the number of visitors on the items page and not even the additional categories.

I hope somebody can point me in the right direction!

(Matthieu Aubry) #2

For this please use Segmentation, and request segment the report data for the categories you need: Segmentation - Compare segments of visitors - Analytics Platform - Matomo

Hope it helps


Thanks for your reply,

but I am not exactly sure how segmentation would work in this case.

I tracked the Ecommerce Item like this:
addEcommerceItem(‘123’, ‘ProductA’, ‘CategoryA’);
addEcommerceItem(‘124’, ‘ProductB’, ‘CategoryB’);

How would I define the segment to access those categories like for example:
$requestArray = array( “segment” => “customEcommerceVariable==CategoryA” );

I looked in the API reference for segmentation and tried “eventCategory” or the customVariables (“customVariableName1” etc.) but those didn’t seem to work… or maybe I’m just doing it wrong :frowning:

Could you please show me an example?

(Matthieu Aubry) #4

good point! Piwik does not yet support segmenting on Ecommerce categories. Maybe you can request this new feature to segment, in the issue tracker? The Core Team Workflow: DevelopInDepth - Matomo Analytics (formerly Piwik Analytics) - Developer Docs - v3