{"action":"created","comment":{"url":"https://api.github.com/repos/lbryio/lbry-app/pulls/comments/168855082","pull_request_review_id":97297945,"id":168855082,"diff_hunk":"@@ -0,0 +1,42 @@\n+// @flow\n+import mixpanel from 'mixpanel-browser';\n+\n+mixpanel.init('691723e855cabb9d27a7a79002216967');\n+\n+type Analytics = {\n+  track: (string, ?Object) => void,\n+  setUser: (Object) => void,\n+  toggle: (boolean, ?boolean) => void\n+}\n+\n+let analyticsEnabled: boolean = false;\n+\n+const analytics: Analytics = {\n+  track: (name: string, payload: ?Object): void => {\n+    if(analyticsEnabled) {\n+      if(payload) {\n+        mixpanel.track(name, payload);\n+      } else {\n+        mixpanel.track(name);\n+      }\n+    }\n+  },\n+  setUser: (user: Object): void => {\n+    if(user.id) {\n+      mixpanel.identify(user.id);\n+    }\n+    if(user.primary_email) {","path":"src/renderer/analytics.js","position":28,"original_position":28,"commit_id":"c765ebd28f54268a5a2133992f8ed95caa6cacca","original_commit_id":"c765ebd28f54268a5a2133992f8ed95caa6cacca","user":{"login":"liamcardenas","id":5027235,"avatar_url":"https://avatars1.githubusercontent.com/u/5027235?v=4","gravatar_id":"","url":"https://api.github.com/users/liamcardenas","html_url":"https://github.com/liamcardenas","followers_url":"https://api.github.com/users/liamcardenas/followers","following_url":"https://api.github.com/users/liamcardenas/following{/other_user}","gists_url":"https://api.github.com/users/liamcardenas/gists{/gist_id}","starred_url":"https://api.github.com/users/liamcardenas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liamcardenas/subscriptions","organizations_url":"https://api.github.com/users/liamcardenas/orgs","repos_url":"https://api.github.com/users/liamcardenas/repos","events_url":"https://api.github.com/users/liamcardenas/events{/privacy}","received_events_url":"https://api.github.com/users/liamcardenas/received_events","type":"User","site_admin":false},"body":"this is so it only tracks people who have an account, which is reasonable","created_at":"2018-02-16T19:53:24Z","updated_at":"2018-02-16T19:53:24Z","html_url":"https://github.com/lbryio/lbry-app/pull/1024#discussion_r168855082","pull_request_url":"https://api.github.com/repos/lbryio/lbry-app/pulls/1024","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/lbryio/lbry-app/pulls/comments/168855082"},"html":{"href":"https://github.com/lbryio/lbry-app/pull/1024#discussion_r168855082"},"pull_request":{"href":"https://api.github.com/repos/lbryio/lbry-app/pulls/1024"}},"in_reply_to_id":168804731},"pull_request":{"url":"https://api.github.com/repos/lbryio/lbry-app/pulls/1024","id":169576918,"html_url":"https://github.com/lbryio/lbry-app/pull/1024","diff_url":"https://github.com/lbryio/lbry-app/pull/1024.diff","patch_url":"https://github.com/lbryio/lbry-app/pull/1024.patch","issue_url":"https://api.github.com/repos/lbryio/lbry-app/issues/1024","number":1024,"state":"open","locked":false,"title":"Analytics overhaul","user":{"login":"liamcardenas","id":5027235,"avatar_url":"https://avatars1.githubusercontent.com/u/5027235?v=4","gravatar_id":"","url":"https://api.github.com/users/liamcardenas","html_url":"https://github.com/liamcardenas","followers_url":"https://api.github.com/users/liamcardenas/followers","following_url":"https://api.github.com/users/liamcardenas/following{/other_user}","gists_url":"https://api.github.com/users/liamcardenas/gists{/gist_id}","starred_url":"https://api.github.com/users/liamcardenas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liamcardenas/subscriptions","organizations_url":"https://api.github.com/users/liamcardenas/orgs","repos_url":"https://api.github.com/users/liamcardenas/repos","events_url":"https://api.github.com/users/liamcardenas/events{/privacy}","received_events_url":"https://api.github.com/users/liamcardenas/received_events","type":"User","site_admin":false},"body":"Unfortunately, due to changes in how we route URLs as well as increasing the power, scope, and privacy of analytics, I had to introduce analytics calls outside of renderer/index.js. That said, all the code is contained to one separate file, so its not bad at all.","created_at":"2018-02-16T09:20:09Z","updated_at":"2018-02-16T19:53:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d2410e6486b7668920ed6e6ee27d6436f6cbf249","assignee":{"login":"liamcardenas","id":5027235,"avatar_url":"https://avatars1.githubusercontent.com/u/5027235?v=4","gravatar_id":"","url":"https://api.github.com/users/liamcardenas","html_url":"https://github.com/liamcardenas","followers_url":"https://api.github.com/users/liamcardenas/followers","following_url":"https://api.github.com/users/liamcardenas/following{/other_user}","gists_url":"https://api.github.com/users/liamcardenas/gists{/gist_id}","starred_url":"https://api.github.com/users/liamcardenas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liamcardenas/subscriptions","organizations_url":"https://api.github.com/users/liamcardenas/orgs","repos_url":"https://api.github.com/users/liamcardenas/repos","events_url":"https://api.github.com/users/liamcardenas/events{/privacy}","received_events_url":"https://api.github.com/users/liamcardenas/received_events","type":"User","site_admin":false},"assignees":[{"login":"liamcardenas","id":5027235,"avatar_url":"https://avatars1.githubusercontent.com/u/5027235?v=4","gravatar_id":"","url":"https://api.github.com/users/liamcardenas","html_url":"https://github.com/liamcardenas","followers_url":"https://api.github.com/users/liamcardenas/followers","following_url":"https://api.github.com/users/liamcardenas/following{/other_user}","gists_url":"https://api.github.com/users/liamcardenas/gists{/gist_id}","starred_url":"https://api.github.com/users/liamcardenas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liamcardenas/subscriptions","organizations_url":"https://api.github.com/users/liamcardenas/orgs","repos_url":"https://api.github.com/users/liamcardenas/repos","events_url":"https://api.github.com/users/liamcardenas/events{/privacy}","received_events_url":"https://api.github.com/users/liamcardenas/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/lbryio/lbry-app/pulls/1024/commits","review_comments_url":"https://api.github.com/repos/lbryio/lbry-app/pulls/1024/comments","review_comment_url":"https://api.github.com/repos/lbryio/lbry-app/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lbryio/lbry-app/issues/1024/comments","statuses_url":"https://api.github.com/repos/lbryio/lbry-app/statuses/c765ebd28f54268a5a2133992f8ed95caa6cacca","head":{"label":"lbryio:mixpanel","ref":"mixpanel","sha":"c765ebd28f54268a5a2133992f8ed95caa6cacca","user":{"login":"lbryio","id":13889222,"avatar_url":"https://avatars3.githubusercontent.com/u/13889222?v=4","gravatar_id":"","url":"https://api.github.com/users/lbryio","html_url":"https://github.com/lbryio","followers_url":"https://api.github.com/users/lbryio/followers","following_url":"https://api.github.com/users/lbryio/following{/other_user}","gists_url":"https://api.github.com/users/lbryio/gists{/gist_id}","starred_url":"https://api.github.com/users/lbryio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lbryio/subscriptions","organizations_url":"https://api.github.com/users/lbryio/orgs","repos_url":"https://api.github.com/users/lbryio/repos","events_url":"https://api.github.com/users/lbryio/events{/privacy}","received_events_url":"https://api.github.com/users/lbryio/received_events","type":"Organization","site_admin":false},"repo":{"id":79149882,"name":"lbry-app","full_name":"lbryio/lbry-app","owner":{"login":"lbryio","id":13889222,"avatar_url":"https://avatars3.githubusercontent.com/u/13889222?v=4","gravatar_id":"","url":"https://api.github.com/users/lbryio","html_url":"https://github.com/lbryio","followers_url":"https://api.github.com/users/lbryio/followers","following_url":"https://api.github.com/users/lbryio/following{/other_user}","gists_url":"https://api.github.com/users/lbryio/gists{/gist_id}","starred_url":"https://api.github.com/users/lbryio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lbryio/subscriptions","organizations_url":"https://api.github.com/users/lbryio/orgs","repos_url":"https://api.github.com/users/lbryio/repos","events_url":"https://api.github.com/users/lbryio/events{/privacy}","received_events_url":"https://api.github.com/users/lbryio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/lbryio/lbry-app","description":"A browser and wallet for LBRY, the decentralized, user-controlled content marketplace.","fork":false,"url":"https://api.github.com/repos/lbryio/lbry-app","forks_url":"https://api.github.com/repos/lbryio/lbry-app/forks","keys_url":"https://api.github.com/repos/lbryio/lbry-app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lbryio/lbry-app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lbryio/lbry-app/teams","hooks_url":"https://api.github.com/repos/lbryio/lbry-app/hooks","issue_events_url":"https://api.github.com/repos/lbryio/lbry-app/issues/events{/number}","events_url":"https://api.github.com/repos/lbryio/lbry-app/events","assignees_url":"https://api.github.com/repos/lbryio/lbry-app/assignees{/user}","branches_url":"https://api.github.com/repos/lbryio/lbry-app/branches{/branch}","tags_url":"https://api.github.com/repos/lbryio/lbry-app/tags","blobs_url":"https://api.github.com/repos/lbryio/lbry-app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lbryio/lbry-app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lbryio/lbry-app/git/refs{/sha}","trees_url":"https://api.github.com/repos/lbryio/lbry-app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lbryio/lbry-app/statuses/{sha}","languages_url":"https://api.github.com/repos/lbryio/lbry-app/languages","stargazers_url":"https://api.github.com/repos/lbryio/lbry-app/stargazers","contributors_url":"https://api.github.com/repos/lbryio/lbry-app/contributors","subscribers_url":"https://api.github.com/repos/lbryio/lbry-app/subscribers","subscription_url":"https://api.github.com/repos/lbryio/lbry-app/subscription","commits_url":"https://api.github.com/repos/lbryio/lbry-app/commits{/sha}","git_commits_url":"https://api.github.com/repos/lbryio/lbry-app/git/commits{/sha}","comments_url":"https://api.github.com/repos/lbryio/lbry-app/comments{/number}","issue_comment_url":"https://api.github.com/repos/lbryio/lbry-app/issues/comments{/number}","contents_url":"https://api.github.com/repos/lbryio/lbry-app/contents/{+path}","compare_url":"https://api.github.com/repos/lbryio/lbry-app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lbryio/lbry-app/merges","archive_url":"https://api.github.com/repos/lbryio/lbry-app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lbryio/lbry-app/downloads","issues_url":"https://api.github.com/repos/lbryio/lbry-app/issues{/number}","pulls_url":"https://api.github.com/repos/lbryio/lbry-app/pulls{/number}","milestones_url":"https://api.github.com/repos/lbryio/lbry-app/milestones{/number}","notifications_url":"https://api.github.com/repos/lbryio/lbry-app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lbryio/lbry-app/labels{/name}","releases_url":"https://api.github.com/repos/lbryio/lbry-app/releases{/id}","deployments_url":"https://api.github.com/repos/lbryio/lbry-app/deployments","created_at":"2017-01-16T19:05:32Z","updated_at":"2018-02-12T21:03:20Z","pushed_at":"2018-02-16T09:53:46Z","git_url":"git://github.com/lbryio/lbry-app.git","ssh_url":"git@github.com:lbryio/lbry-app.git","clone_url":"https://github.com/lbryio/lbry-app.git","svn_url":"https://github.com/lbryio/lbry-app","homepage":"https://lbry.io","size":18584,"stargazers_count":324,"watchers_count":324,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":98,"mirror_url":null,"archived":false,"open_issues_count":203,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":98,"open_issues":203,"watchers":324,"default_branch":"master"}},"base":{"label":"lbryio:master","ref":"master","sha":"fcc26a1930302dbdec20034ab8a0c510118b88a9","user":{"login":"lbryio","id":13889222,"avatar_url":"https://avatars3.githubusercontent.com/u/13889222?v=4","gravatar_id":"","url":"https://api.github.com/users/lbryio","html_url":"https://github.com/lbryio","followers_url":"https://api.github.com/users/lbryio/followers","following_url":"https://api.github.com/users/lbryio/following{/other_user}","gists_url":"https://api.github.com/users/lbryio/gists{/gist_id}","starred_url":"https://api.github.com/users/lbryio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lbryio/subscriptions","organizations_url":"https://api.github.com/users/lbryio/orgs","repos_url":"https://api.github.com/users/lbryio/repos","events_url":"https://api.github.com/users/lbryio/events{/privacy}","received_events_url":"https://api.github.com/users/lbryio/received_events","type":"Organization","site_admin":false},"repo":{"id":79149882,"name":"lbry-app","full_name":"lbryio/lbry-app","owner":{"login":"lbryio","id":13889222,"avatar_url":"https://avatars3.githubusercontent.com/u/13889222?v=4","gravatar_id":"","url":"https://api.github.com/users/lbryio","html_url":"https://github.com/lbryio","followers_url":"https://api.github.com/users/lbryio/followers","following_url":"https://api.github.com/users/lbryio/following{/other_user}","gists_url":"https://api.github.com/users/lbryio/gists{/gist_id}","starred_url":"https://api.github.com/users/lbryio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lbryio/subscriptions","organizations_url":"https://api.github.com/users/lbryio/orgs","repos_url":"https://api.github.com/users/lbryio/repos","events_url":"https://api.github.com/users/lbryio/events{/privacy}","received_events_url":"https://api.github.com/users/lbryio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/lbryio/lbry-app","description":"A browser and wallet for LBRY, the decentralized, user-controlled content marketplace.","fork":false,"url":"https://api.github.com/repos/lbryio/lbry-app","forks_url":"https://api.github.com/repos/lbryio/lbry-app/forks","keys_url":"https://api.github.com/repos/lbryio/lbry-app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lbryio/lbry-app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lbryio/lbry-app/teams","hooks_url":"https://api.github.com/repos/lbryio/lbry-app/hooks","issue_events_url":"https://api.github.com/repos/lbryio/lbry-app/issues/events{/number}","events_url":"https://api.github.com/repos/lbryio/lbry-app/events","assignees_url":"https://api.github.com/repos/lbryio/lbry-app/assignees{/user}","branches_url":"https://api.github.com/repos/lbryio/lbry-app/branches{/branch}","tags_url":"https://api.github.com/repos/lbryio/lbry-app/tags","blobs_url":"https://api.github.com/repos/lbryio/lbry-app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lbryio/lbry-app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lbryio/lbry-app/git/refs{/sha}","trees_url":"https://api.github.com/repos/lbryio/lbry-app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lbryio/lbry-app/statuses/{sha}","languages_url":"https://api.github.com/repos/lbryio/lbry-app/languages","stargazers_url":"https://api.github.com/repos/lbryio/lbry-app/stargazers","contributors_url":"https://api.github.com/repos/lbryio/lbry-app/contributors","subscribers_url":"https://api.github.com/repos/lbryio/lbry-app/subscribers","subscription_url":"https://api.github.com/repos/lbryio/lbry-app/subscription","commits_url":"https://api.github.com/repos/lbryio/lbry-app/commits{/sha}","git_commits_url":"https://api.github.com/repos/lbryio/lbry-app/git/commits{/sha}","comments_url":"https://api.github.com/repos/lbryio/lbry-app/comments{/number}","issue_comment_url":"https://api.github.com/repos/lbryio/lbry-app/issues/comments{/number}","contents_url":"https://api.github.com/repos/lbryio/lbry-app/contents/{+path}","compare_url":"https://api.github.com/repos/lbryio/lbry-app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lbryio/lbry-app/merges","archive_url":"https://api.github.com/repos/lbryio/lbry-app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lbryio/lbry-app/downloads","issues_url":"https://api.github.com/repos/lbryio/lbry-app/issues{/number}","pulls_url":"https://api.github.com/repos/lbryio/lbry-app/pulls{/number}","milestones_url":"https://api.github.com/repos/lbryio/lbry-app/milestones{/number}","notifications_url":"https://api.github.com/repos/lbryio/lbry-app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lbryio/lbry-app/labels{/name}","releases_url":"https://api.github.com/repos/lbryio/lbry-app/releases{/id}","deployments_url":"https://api.github.com/repos/lbryio/lbry-app/deployments","created_at":"2017-01-16T19:05:32Z","updated_at":"2018-02-12T21:03:20Z","pushed_at":"2018-02-16T09:53:46Z","git_url":"git://github.com/lbryio/lbry-app.git","ssh_url":"git@github.com:lbryio/lbry-app.git","clone_url":"https://github.com/lbryio/lbry-app.git","svn_url":"https://github.com/lbryio/lbry-app","homepage":"https://lbry.io","size":18584,"stargazers_count":324,"watchers_count":324,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":98,"mirror_url":null,"archived":false,"open_issues_count":203,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":98,"open_issues":203,"watchers":324,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lbryio/lbry-app/pulls/1024"},"html":{"href":"https://github.com/lbryio/lbry-app/pull/1024"},"issue":{"href":"https://api.github.com/repos/lbryio/lbry-app/issues/1024"},"comments":{"href":"https://api.github.com/repos/lbryio/lbry-app/issues/1024/comments"},"review_comments":{"href":"https://api.github.com/repos/lbryio/lbry-app/pulls/1024/comments"},"review_comment":{"href":"https://api.github.com/repos/lbryio/lbry-app/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lbryio/lbry-app/pulls/1024/commits"},"statuses":{"href":"https://api.github.com/repos/lbryio/lbry-app/statuses/c765ebd28f54268a5a2133992f8ed95caa6cacca"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"liamcardenas"}}