{"action":"created","issue":{"url":"https://api.github.com/repos/piwik/piwik/issues/9314","labels_url":"https://api.github.com/repos/piwik/piwik/issues/9314/labels{/name}","comments_url":"https://api.github.com/repos/piwik/piwik/issues/9314/comments","events_url":"https://api.github.com/repos/piwik/piwik/issues/9314/events","html_url":"https://github.com/piwik/piwik/pull/9314","id":119634027,"number":9314,"title":"New segment: ActionType","user":{"login":"tsteur","id":273120,"avatar_url":"https://avatars.githubusercontent.com/u/273120?v=3","gravatar_id":"","url":"https://api.github.com/users/tsteur","html_url":"https://github.com/tsteur","followers_url":"https://api.github.com/users/tsteur/followers","following_url":"https://api.github.com/users/tsteur/following{/other_user}","gists_url":"https://api.github.com/users/tsteur/gists{/gist_id}","starred_url":"https://api.github.com/users/tsteur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tsteur/subscriptions","organizations_url":"https://api.github.com/users/tsteur/orgs","repos_url":"https://api.github.com/users/tsteur/repos","events_url":"https://api.github.com/users/tsteur/events{/privacy}","received_events_url":"https://api.github.com/users/tsteur/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/piwik/piwik/labels/Enhancement","name":"Enhancement","color":"bfd4f2"},{"url":"https://api.github.com/repos/piwik/piwik/labels/Needs%20Review","name":"Needs Review","color":"fad8c7"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/piwik/piwik/milestones/89","html_url":"https://github.com/piwik/piwik/milestones/2.15.1","labels_url":"https://api.github.com/repos/piwik/piwik/milestones/89/labels","id":1257878,"number":89,"title":"2.15.1","description":"","creator":{"login":"mattab","id":466765,"avatar_url":"https://avatars.githubusercontent.com/u/466765?v=3","gravatar_id":"","url":"https://api.github.com/users/mattab","html_url":"https://github.com/mattab","followers_url":"https://api.github.com/users/mattab/followers","following_url":"https://api.github.com/users/mattab/following{/other_user}","gists_url":"https://api.github.com/users/mattab/gists{/gist_id}","starred_url":"https://api.github.com/users/mattab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattab/subscriptions","organizations_url":"https://api.github.com/users/mattab/orgs","repos_url":"https://api.github.com/users/mattab/repos","events_url":"https://api.github.com/users/mattab/events{/privacy}","received_events_url":"https://api.github.com/users/mattab/received_events","type":"User","site_admin":false},"open_issues":47,"closed_issues":107,"state":"open","created_at":"2015-08-17T09:20:14Z","updated_at":"2015-12-03T22:55:11Z","due_on":"2015-12-15T11:00:00Z","closed_at":null},"comments":2,"created_at":"2015-12-01T03:28:31Z","updated_at":"2015-12-03T23:52:03Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/piwik/piwik/pulls/9314","html_url":"https://github.com/piwik/piwik/pull/9314","diff_url":"https://github.com/piwik/piwik/pull/9314.diff","patch_url":"https://github.com/piwik/piwik/pull/9314.patch"},"body":"This PR defines a new segment ActionType. This is especially useful when for example viewing a CustomDimensions report in scope Action. By default custom dimensions are tracked across all actions. By using eg a segment `actionType=pageviews` one can see all custom dimensions tracked for pageviews. Or maybe someone wants to see all Custom Dimension values for downloads and outlinks etc. \r\n\r\nIn order to make this work we had to change how event urls are tracked as the segment works on the SQL segment `log_action.type`. So far, when an event was tracked, we looked for a URL having the type `1` (Pageview) in `log_action`. To be actually able to segment for events we are now using type `10` in `log_action` when request was an event. Downside is we create many more entries in `log_action` for each URL used in an event tracking call.  On the good side we now have more accurate statistics in Transition reports where exit rate and referrer are calculated more correctly since they did not differentiate between events and a pageview.\r\n\r\nWe also identified at some point it might be useful to completely remove the `type` column from `log_action` table and instead store the type of the action in `log_link_visit_action`. This would help to avoid creating many duplicated entries in `log_action`.\r\n\r\nRe failing tests:\r\n* There is a failing test in CustomDimensions plugin. We need to fix that test once we actually merged it. Otherwise we'd have to fix this test in a branch in CustomDimension and later change the submodule back to master in CustomDimensions once this PR is merged \r\n* Some UI tests fail because the order of Segments failed. This is expected for now and not a problem"},"comment":{"url":"https://api.github.com/repos/piwik/piwik/issues/comments/161827463","html_url":"https://github.com/piwik/piwik/pull/9314#issuecomment-161827463","issue_url":"https://api.github.com/repos/piwik/piwik/issues/9314","id":161827463,"user":{"login":"mattab","id":466765,"avatar_url":"https://avatars.githubusercontent.com/u/466765?v=3","gravatar_id":"","url":"https://api.github.com/users/mattab","html_url":"https://github.com/mattab","followers_url":"https://api.github.com/users/mattab/followers","following_url":"https://api.github.com/users/mattab/following{/other_user}","gists_url":"https://api.github.com/users/mattab/gists{/gist_id}","starred_url":"https://api.github.com/users/mattab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattab/subscriptions","organizations_url":"https://api.github.com/users/mattab/orgs","repos_url":"https://api.github.com/users/mattab/repos","events_url":"https://api.github.com/users/mattab/events{/privacy}","received_events_url":"https://api.github.com/users/mattab/received_events","type":"User","site_admin":false},"created_at":"2015-12-03T23:52:03Z","updated_at":"2015-12-03T23:52:03Z","body":"> We also identified at some point it might be useful to completely remove the type column from log_action table and instead store the type of the action in log_link_visit_action. This would help to avoid creating many duplicated entries in log_action.\r\n\r\nCreated #9326: Delete log_action.type column and move it to: log_link_visit_action.type "}}