{"action":"created","issue":{"url":"https://api.github.com/repos/piwik/piwik-java-tracker/issues/7","labels_url":"https://api.github.com/repos/piwik/piwik-java-tracker/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/piwik/piwik-java-tracker/issues/7/comments","events_url":"https://api.github.com/repos/piwik/piwik-java-tracker/issues/7/events","html_url":"https://github.com/piwik/piwik-java-tracker/issues/7","id":120059157,"number":7,"title":"Let users track Custom Dimensions ","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-java-tracker/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-02T23:26:03Z","updated_at":"2015-12-03T08:30:47Z","closed_at":null,"body":"In https://github.com/piwik/piwik/issues/9129 we created a new plugin to track Custom Dimensions.\r\n\r\nTo the JavaScript Tracker we added a new method `setCustomDimension(int dimensionId, string dimensionValue)`. This sets a tracking API parameter `dimension$dimensionId=$dimensionValue`. Eg `dimension1=foo` or `dimension2=bar`. So the tracking API parameter starts with `dimension` followed by the set `dimensionId`. \r\n\r\nI reckon we should be consistent here with the PHP Tracker and clear all set custom dimensions after the next tracking request was sent. \r\neg\r\n```\r\nsetCustomDimension(1, 'myvalue1')\r\nsetCustomDimension(2, 'myvalue2)\r\ntrackPageview()\r\n// now dimension 1 and 2 would be cleared and one has to set values again\r\n```\r\n\r\nFYI: Custom Dimensions are similar to Custom Variables. Currently a plugin is needed to use them but in Piwik 3.0 it will be installed by default and at some point we will deprecate Custom Variables (not soon though)"},"comment":{"url":"https://api.github.com/repos/piwik/piwik-java-tracker/issues/comments/161549851","html_url":"https://github.com/piwik/piwik-java-tracker/issues/7#issuecomment-161549851","issue_url":"https://api.github.com/repos/piwik/piwik-java-tracker/issues/7","id":161549851,"user":{"login":"bcsorba","id":1778765,"avatar_url":"https://avatars.githubusercontent.com/u/1778765?v=3","gravatar_id":"","url":"https://api.github.com/users/bcsorba","html_url":"https://github.com/bcsorba","followers_url":"https://api.github.com/users/bcsorba/followers","following_url":"https://api.github.com/users/bcsorba/following{/other_user}","gists_url":"https://api.github.com/users/bcsorba/gists{/gist_id}","starred_url":"https://api.github.com/users/bcsorba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcsorba/subscriptions","organizations_url":"https://api.github.com/users/bcsorba/orgs","repos_url":"https://api.github.com/users/bcsorba/repos","events_url":"https://api.github.com/users/bcsorba/events{/privacy}","received_events_url":"https://api.github.com/users/bcsorba/received_events","type":"User","site_admin":false},"created_at":"2015-12-03T08:30:47Z","updated_at":"2015-12-03T08:30:47Z","body":"My biggest concern with adding this functionality to the core API is the same one that you expressed [here](https://github.com/piwik/piwik/issues/9129#issuecomment-153552586), namely that it goes against pattern to have functionality in the core API that is currently only available via a plugin.\r\n\r\nIt may be better currently to add the functionality for users to add custom tracking parameters to their requests, which appears to be the functionality in the js and php clients.  This would allow users with the plugin to manually set the parameters, effectively allowing the functionality.\r\n\r\nI think it may be a good idea however to explore the idea of a plugin framework for this tracker - this would allow all plugin creators to be able to extend the core tracker to their own needs.\r\n\r\nI vote to add this functionality when dimensions are integrated into Piwik Core.  Thoughts @tsteur, @mattab ?"}}