I am looking for a way to segment orders within the same user visit via an attribute X. I tried using page scope custom variables, but that only seems to work for page views and not ecommerce orders in the Ecommerce Overview widget.
Is there a way that I can achive this?
What and How exactly would you like to segment ? Maybe this is a legitimate feature request, that we could add to our issue tracker http://dev.piwik.org/
I would like to segment ecommerce orders via an “order” scope custom variable similar to the effect of page scope custom variables and user visits. So the Ecommerce widgets could be segmented to only display data for orders based on the existence and/or value of the custom variable.
What segment “String” would you like to write ? see doc at: Segmentation: API Reference - Matomo Analytics (formerly Piwik Analytics) - Developer Docs - v3
If that does not work with Piwik yet, please consider creating ticket on our issue tracker: http://dev.piwik.org/
When tracking an ecommerce order via the function trackEcommerceOrder I also set a page scope custom variable “customerType”. A single visit may have mutiple orders with different values.
I then created a segment like the following “customVariablePageName1==customerType”. When using the segment the ecommerce widgets return 0 results.
Ok that’s clear. Could you please try to set a scope of “visit”, and then try to segment on visit scope? I think it may work because scope ‘visit’ custom variables are copied in the Conversion. Let me know!
I can correctly see the VISIT scope custom variable, values and orders when I click “View goals by Visit -> Custom Variables”. However when I try to segment on the custom variable I see 0 results.
It does not work becasue the custom var of scope “page” do not work for conversions, only the scope “visit” can be segmented for conversions. This is I think an un-documented limitation (maybe we could mention this in some documentation ?)
I made a typo in my last post…It should say Visit Scope and not Page Scope.
I tried your suggestion with the visit scope custom variable and those were my results. I edited my last post to correct it.
However when I try to segment on the custom variable I see 0 results.
What is the API request that you issue?