After recording an event, it also has idaction_url field (log_link_visit_action) filled with ID of URL it took place on. This URL is saved with idaction.type=10
Unfortunately, when later segmenting using "Action URL", events report won't be segmented, despite proper data residing in the database.
Confirmed on 2.16.2 and 3.0. Also confirmed proper behaviour on 2.15. I will be grateful for information if this should be treated as a bug, or maybe this behaviour can be explained.
Results of investigation done on my side:
If such an entry will have idaction.type changed to 1 (page url) then segmentation by Page URL will properly segment Events report.
This change was made on Nov 30, 2015: https://github.com/piwik/piwik/commit/ea9ac058ff5da7ffe8354529e13e927ddcaf3f27#diff-49022a94ed8c0e968b315e2d98fd1ef7L64
Earlier, the the returned value type was hardcoded in function 'getUrlAndType' as "self::TYPE_PAGE_URL" = 1
After the change, there is used a function 'getActionType' which returns hardcoded "Action::TYPE_EVENT" = 10
To sum up: Maybe it is intended behaviour, but just wasn't implemented fully properly? Maybe this association is proper, but for some reason, segmentation cannot pick up Action URL by "Action::TYPE_EVENT" = 10 ?
ping @mattab as I think this may be pretty important (is for me as well 😄 )
Thanks for the information! I think this could be categorised as a bug. @tsteur do you have any thought?
type 10 is correct. I would say the problem is the same as https://github.com/piwik/piwik/issues/8854 which eventually needs to be solved generally but like easily 4-5 days of work
without digging deep or looking in the code, I'm thinking as @mgonera suggests that Action URL segment could filter both (Page URLs OR Event URLs). Is this correct? if so, I would leave this issue opened and welcome a pull request from PP for this :+1:
Yes exactly, I see this as expected behavior, Event is an Action, so if it has an URL, should be segmented by Action URL. 👍
This issue has been mentioned on Matomo forums. There might be relevant details there: