{"action":"created","comment":{"url":"https://api.github.com/repos/wmde/FundraisingFrontend/pulls/comments/72738083","id":72738083,"diff_hunk":"@@ -0,0 +1,33 @@\n+<?php\n+\n+namespace WMDE\\Fundraising\\Frontend\\Infrastructure;\n+\n+/**\n+ * Simple wrapper for tracking methods in Piwik's API\n+ *\n+ * @licence GNU GPL v2+\n+ * @author Kai Nissen < kai.nissen@wikimedia.de >\n+ */\n+class PiwikCustomTracking {\n+\n+\tconst SCOPE_VISIT = 'visit';\n+\tconst SCOPE_PAGE = 'page';\n+\n+\tconst EVENT_SET_CUSTOM_VARIABLE = 'setCustomVariable';\n+\tconst EVENT_TRACK_GOAL = 'trackGoal';\n+\n+\tprivate $events = [];\n+\n+\tpublic function setCustomVariable( int $variableId, string $name, string $value, string $scope ) {\n+\t\t$this->events[] = [ self::EVENT_SET_CUSTOM_VARIABLE, $variableId, $name, $value, $scope ];\n+\t}\n+\n+\tpublic function trackGoal( int $goalId ) {\n+\t\t$this->events[] = [ self::EVENT_TRACK_GOAL, $goalId ];\n+\t}\n+\n+\tpublic function getEvents(): array {\n+\t\treturn $this->events;\n+\t}","path":"src/Infrastructure/PiwikCustomTracking.php","position":31,"original_position":31,"commit_id":"f36032bf9dd6760c60f74a5b7e7d329ec4653fc0","original_commit_id":"f36032bf9dd6760c60f74a5b7e7d329ec4653fc0","user":{"login":"JeroenDeDauw","id":146040,"avatar_url":"https://avatars.githubusercontent.com/u/146040?v=3","gravatar_id":"","url":"https://api.github.com/users/JeroenDeDauw","html_url":"https://github.com/JeroenDeDauw","followers_url":"https://api.github.com/users/JeroenDeDauw/followers","following_url":"https://api.github.com/users/JeroenDeDauw/following{/other_user}","gists_url":"https://api.github.com/users/JeroenDeDauw/gists{/gist_id}","starred_url":"https://api.github.com/users/JeroenDeDauw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JeroenDeDauw/subscriptions","organizations_url":"https://api.github.com/users/JeroenDeDauw/orgs","repos_url":"https://api.github.com/users/JeroenDeDauw/repos","events_url":"https://api.github.com/users/JeroenDeDauw/events{/privacy}","received_events_url":"https://api.github.com/users/JeroenDeDauw/received_events","type":"User","site_admin":false},"body":"There is some not entirely obvious binding here. `getEvents` only user is a thing where the result gets shoved into a template. When first looking at this class, that was not clear to me at all. Callers of the two event recording methods are thus using the same format as the template. That's very suspicious.","created_at":"2016-07-29T03:38:01Z","updated_at":"2016-07-29T03:38:01Z","html_url":"https://github.com/wmde/FundraisingFrontend/pull/589#discussion_r72738083","pull_request_url":"https://api.github.com/repos/wmde/FundraisingFrontend/pulls/589","_links":{"self":{"href":"https://api.github.com/repos/wmde/FundraisingFrontend/pulls/comments/72738083"},"html":{"href":"https://github.com/wmde/FundraisingFrontend/pull/589#discussion_r72738083"},"pull_request":{"href":"https://api.github.com/repos/wmde/FundraisingFrontend/pulls/589"}}},"pull_request":{"url":"https://api.github.com/repos/wmde/FundraisingFrontend/pulls/589","id":79204570,"html_url":"https://github.com/wmde/FundraisingFrontend/pull/589","diff_url":"https://github.com/wmde/FundraisingFrontend/pull/589.diff","patch_url":"https://github.com/wmde/FundraisingFrontend/pull/589.patch","issue_url":"https://api.github.com/repos/wmde/FundraisingFrontend/issues/589","number":589,"state":"open","locked":false,"title":"Piwik Tracking","user":{"login":"KaiNissen","id":5435996,"avatar_url":"https://avatars.githubusercontent.com/u/5435996?v=3","gravatar_id":"","url":"https://api.github.com/users/KaiNissen","html_url":"https://github.com/KaiNissen","followers_url":"https://api.github.com/users/KaiNissen/followers","following_url":"https://api.github.com/users/KaiNissen/following{/other_user}","gists_url":"https://api.github.com/users/KaiNissen/gists{/gist_id}","starred_url":"https://api.github.com/users/KaiNissen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KaiNissen/subscriptions","organizations_url":"https://api.github.com/users/KaiNissen/orgs","repos_url":"https://api.github.com/users/KaiNissen/repos","events_url":"https://api.github.com/users/KaiNissen/events{/privacy}","received_events_url":"https://api.github.com/users/KaiNissen/received_events","type":"User","site_admin":false},"body":"This PR adds the following behaviour to the application:\r\n\r\n- The Piwik script snippet is included into all pages\r\n- Predefined \"goals\" are tracked both on the donation form and the confirmation page\r\n- Custom variables that represent the initially intended and actual payment type, amount and interval are sent to Piwik after creating a donation","created_at":"2016-07-28T14:21:58Z","updated_at":"2016-07-29T03:38:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"11e22204b68c5bf1a1b6a53e6ad8c5903408812c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/wmde/FundraisingFrontend/pulls/589/commits","review_comments_url":"https://api.github.com/repos/wmde/FundraisingFrontend/pulls/589/comments","review_comment_url":"https://api.github.com/repos/wmde/FundraisingFrontend/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wmde/FundraisingFrontend/issues/589/comments","statuses_url":"https://api.github.com/repos/wmde/FundraisingFrontend/statuses/f36032bf9dd6760c60f74a5b7e7d329ec4653fc0","head":{"label":"wmde:piwik","ref":"piwik","sha":"f36032bf9dd6760c60f74a5b7e7d329ec4653fc0","user":{"login":"wmde","id":664724,"avatar_url":"https://avatars.githubusercontent.com/u/664724?v=3","gravatar_id":"","url":"https://api.github.com/users/wmde","html_url":"https://github.com/wmde","followers_url":"https://api.github.com/users/wmde/followers","following_url":"https://api.github.com/users/wmde/following{/other_user}","gists_url":"https://api.github.com/users/wmde/gists{/gist_id}","starred_url":"https://api.github.com/users/wmde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wmde/subscriptions","organizations_url":"https://api.github.com/users/wmde/orgs","repos_url":"https://api.github.com/users/wmde/repos","events_url":"https://api.github.com/users/wmde/events{/privacy}","received_events_url":"https://api.github.com/users/wmde/received_events","type":"Organization","site_admin":false},"repo":{"id":42872217,"name":"FundraisingFrontend","full_name":"wmde/FundraisingFrontend","owner":{"login":"wmde","id":664724,"avatar_url":"https://avatars.githubusercontent.com/u/664724?v=3","gravatar_id":"","url":"https://api.github.com/users/wmde","html_url":"https://github.com/wmde","followers_url":"https://api.github.com/users/wmde/followers","following_url":"https://api.github.com/users/wmde/following{/other_user}","gists_url":"https://api.github.com/users/wmde/gists{/gist_id}","starred_url":"https://api.github.com/users/wmde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wmde/subscriptions","organizations_url":"https://api.github.com/users/wmde/orgs","repos_url":"https://api.github.com/users/wmde/repos","events_url":"https://api.github.com/users/wmde/events{/privacy}","received_events_url":"https://api.github.com/users/wmde/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wmde/FundraisingFrontend","description":"User facing application for the WMDE fundraising","fork":false,"url":"https://api.github.com/repos/wmde/FundraisingFrontend","forks_url":"https://api.github.com/repos/wmde/FundraisingFrontend/forks","keys_url":"https://api.github.com/repos/wmde/FundraisingFrontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wmde/FundraisingFrontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wmde/FundraisingFrontend/teams","hooks_url":"https://api.github.com/repos/wmde/FundraisingFrontend/hooks","issue_events_url":"https://api.github.com/repos/wmde/FundraisingFrontend/issues/events{/number}","events_url":"https://api.github.com/repos/wmde/FundraisingFrontend/events","assignees_url":"https://api.github.com/repos/wmde/FundraisingFrontend/assignees{/user}","branches_url":"https://api.github.com/repos/wmde/FundraisingFrontend/branches{/branch}","tags_url":"https://api.github.com/repos/wmde/FundraisingFrontend/tags","blobs_url":"https://api.github.com/repos/wmde/FundraisingFrontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wmde/FundraisingFrontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wmde/FundraisingFrontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/wmde/FundraisingFrontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wmde/FundraisingFrontend/statuses/{sha}","languages_url":"https://api.github.com/repos/wmde/FundraisingFrontend/languages","stargazers_url":"https://api.github.com/repos/wmde/FundraisingFrontend/stargazers","contributors_url":"https://api.github.com/repos/wmde/FundraisingFrontend/contributors","subscribers_url":"https://api.github.com/repos/wmde/FundraisingFrontend/subscribers","subscription_url":"https://api.github.com/repos/wmde/FundraisingFrontend/subscription","commits_url":"https://api.github.com/repos/wmde/FundraisingFrontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/wmde/FundraisingFrontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/wmde/FundraisingFrontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/wmde/FundraisingFrontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/wmde/FundraisingFrontend/contents/{+path}","compare_url":"https://api.github.com/repos/wmde/FundraisingFrontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wmde/FundraisingFrontend/merges","archive_url":"https://api.github.com/repos/wmde/FundraisingFrontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wmde/FundraisingFrontend/downloads","issues_url":"https://api.github.com/repos/wmde/FundraisingFrontend/issues{/number}","pulls_url":"https://api.github.com/repos/wmde/FundraisingFrontend/pulls{/number}","milestones_url":"https://api.github.com/repos/wmde/FundraisingFrontend/milestones{/number}","notifications_url":"https://api.github.com/repos/wmde/FundraisingFrontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wmde/FundraisingFrontend/labels{/name}","releases_url":"https://api.github.com/repos/wmde/FundraisingFrontend/releases{/id}","deployments_url":"https://api.github.com/repos/wmde/FundraisingFrontend/deployments","created_at":"2015-09-21T14:42:43Z","updated_at":"2016-07-13T12:56:08Z","pushed_at":"2016-07-29T02:43:10Z","git_url":"git://github.com/wmde/FundraisingFrontend.git","ssh_url":"git@github.com:wmde/FundraisingFrontend.git","clone_url":"https://github.com/wmde/FundraisingFrontend.git","svn_url":"https://github.com/wmde/FundraisingFrontend","homepage":"","size":2415,"stargazers_count":12,"watchers_count":12,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":6,"forks":1,"open_issues":6,"watchers":12,"default_branch":"master"}},"base":{"label":"wmde:master","ref":"master","sha":"54e0c4f6c142f7cefc3fb3b4838dee2c32d8d0a9","user":{"login":"wmde","id":664724,"avatar_url":"https://avatars.githubusercontent.com/u/664724?v=3","gravatar_id":"","url":"https://api.github.com/users/wmde","html_url":"https://github.com/wmde","followers_url":"https://api.github.com/users/wmde/followers","following_url":"https://api.github.com/users/wmde/following{/other_user}","gists_url":"https://api.github.com/users/wmde/gists{/gist_id}","starred_url":"https://api.github.com/users/wmde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wmde/subscriptions","organizations_url":"https://api.github.com/users/wmde/orgs","repos_url":"https://api.github.com/users/wmde/repos","events_url":"https://api.github.com/users/wmde/events{/privacy}","received_events_url":"https://api.github.com/users/wmde/received_events","type":"Organization","site_admin":false},"repo":{"id":42872217,"name":"FundraisingFrontend","full_name":"wmde/FundraisingFrontend","owner":{"login":"wmde","id":664724,"avatar_url":"https://avatars.githubusercontent.com/u/664724?v=3","gravatar_id":"","url":"https://api.github.com/users/wmde","html_url":"https://github.com/wmde","followers_url":"https://api.github.com/users/wmde/followers","following_url":"https://api.github.com/users/wmde/following{/other_user}","gists_url":"https://api.github.com/users/wmde/gists{/gist_id}","starred_url":"https://api.github.com/users/wmde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wmde/subscriptions","organizations_url":"https://api.github.com/users/wmde/orgs","repos_url":"https://api.github.com/users/wmde/repos","events_url":"https://api.github.com/users/wmde/events{/privacy}","received_events_url":"https://api.github.com/users/wmde/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wmde/FundraisingFrontend","description":"User facing application for the WMDE fundraising","fork":false,"url":"https://api.github.com/repos/wmde/FundraisingFrontend","forks_url":"https://api.github.com/repos/wmde/FundraisingFrontend/forks","keys_url":"https://api.github.com/repos/wmde/FundraisingFrontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wmde/FundraisingFrontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wmde/FundraisingFrontend/teams","hooks_url":"https://api.github.com/repos/wmde/FundraisingFrontend/hooks","issue_events_url":"https://api.github.com/repos/wmde/FundraisingFrontend/issues/events{/number}","events_url":"https://api.github.com/repos/wmde/FundraisingFrontend/events","assignees_url":"https://api.github.com/repos/wmde/FundraisingFrontend/assignees{/user}","branches_url":"https://api.github.com/repos/wmde/FundraisingFrontend/branches{/branch}","tags_url":"https://api.github.com/repos/wmde/FundraisingFrontend/tags","blobs_url":"https://api.github.com/repos/wmde/FundraisingFrontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wmde/FundraisingFrontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wmde/FundraisingFrontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/wmde/FundraisingFrontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wmde/FundraisingFrontend/statuses/{sha}","languages_url":"https://api.github.com/repos/wmde/FundraisingFrontend/languages","stargazers_url":"https://api.github.com/repos/wmde/FundraisingFrontend/stargazers","contributors_url":"https://api.github.com/repos/wmde/FundraisingFrontend/contributors","subscribers_url":"https://api.github.com/repos/wmde/FundraisingFrontend/subscribers","subscription_url":"https://api.github.com/repos/wmde/FundraisingFrontend/subscription","commits_url":"https://api.github.com/repos/wmde/FundraisingFrontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/wmde/FundraisingFrontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/wmde/FundraisingFrontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/wmde/FundraisingFrontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/wmde/FundraisingFrontend/contents/{+path}","compare_url":"https://api.github.com/repos/wmde/FundraisingFrontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wmde/FundraisingFrontend/merges","archive_url":"https://api.github.com/repos/wmde/FundraisingFrontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wmde/FundraisingFrontend/downloads","issues_url":"https://api.github.com/repos/wmde/FundraisingFrontend/issues{/number}","pulls_url":"https://api.github.com/repos/wmde/FundraisingFrontend/pulls{/number}","milestones_url":"https://api.github.com/repos/wmde/FundraisingFrontend/milestones{/number}","notifications_url":"https://api.github.com/repos/wmde/FundraisingFrontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wmde/FundraisingFrontend/labels{/name}","releases_url":"https://api.github.com/repos/wmde/FundraisingFrontend/releases{/id}","deployments_url":"https://api.github.com/repos/wmde/FundraisingFrontend/deployments","created_at":"2015-09-21T14:42:43Z","updated_at":"2016-07-13T12:56:08Z","pushed_at":"2016-07-29T02:43:10Z","git_url":"git://github.com/wmde/FundraisingFrontend.git","ssh_url":"git@github.com:wmde/FundraisingFrontend.git","clone_url":"https://github.com/wmde/FundraisingFrontend.git","svn_url":"https://github.com/wmde/FundraisingFrontend","homepage":"","size":2415,"stargazers_count":12,"watchers_count":12,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":6,"forks":1,"open_issues":6,"watchers":12,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wmde/FundraisingFrontend/pulls/589"},"html":{"href":"https://github.com/wmde/FundraisingFrontend/pull/589"},"issue":{"href":"https://api.github.com/repos/wmde/FundraisingFrontend/issues/589"},"comments":{"href":"https://api.github.com/repos/wmde/FundraisingFrontend/issues/589/comments"},"review_comments":{"href":"https://api.github.com/repos/wmde/FundraisingFrontend/pulls/589/comments"},"review_comment":{"href":"https://api.github.com/repos/wmde/FundraisingFrontend/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wmde/FundraisingFrontend/pulls/589/commits"},"statuses":{"href":"https://api.github.com/repos/wmde/FundraisingFrontend/statuses/f36032bf9dd6760c60f74a5b7e7d329ec4653fc0"}}}}
{"actor":{"display_login":"JeroenDeDauw"}}