{"action":"created","comment":{"url":"https://api.github.com/repos/lbryio/lbry.io/pulls/comments/244218036","pull_request_review_id":188167180,"id":244218036,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0NDIxODAzNg==","diff_hunk":"@@ -31,6 +33,9 @@ public static function init()\n             static::setNamespace(static::NAMESPACE_DEFAULT, $oldSession);\n         }\n \n+        $response = LBRY::logWebVisitor('lbry.io', $_SESSION[static::USER_ID], $_SERVER['REMOTE_ADDR']);\n+        $_SESSION[static::USER_ID] = $response['data']['visitor_id'];","path":"controller/Session.class.php","position":24,"original_position":24,"commit_id":"258762da47ac42046e21943a2385cd1d8b700fb6","original_commit_id":"258762da47ac42046e21943a2385cd1d8b700fb6","user":{"login":"tiger5226","id":3402064,"node_id":"MDQ6VXNlcjM0MDIwNjQ=","avatar_url":"https://avatars0.githubusercontent.com/u/3402064?v=4","gravatar_id":"","url":"https://api.github.com/users/tiger5226","html_url":"https://github.com/tiger5226","followers_url":"https://api.github.com/users/tiger5226/followers","following_url":"https://api.github.com/users/tiger5226/following{/other_user}","gists_url":"https://api.github.com/users/tiger5226/gists{/gist_id}","starred_url":"https://api.github.com/users/tiger5226/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiger5226/subscriptions","organizations_url":"https://api.github.com/users/tiger5226/orgs","repos_url":"https://api.github.com/users/tiger5226/repos","events_url":"https://api.github.com/users/tiger5226/events{/privacy}","received_events_url":"https://api.github.com/users/tiger5226/received_events","type":"User","site_admin":false},"body":"So I tested this out, by replacing `visitor_id` with `viitor_id` and it actually causes the site to error for all users. So I added `key_exists` checks ( thanks @lyoshenka ) for these. Also you are right that it will endlessly create visitors on internal-apis. \r\n\r\nSo I just made a change to link site visitors by ip address as well. If an ip address calls the api twice in 24 hours they will be regarded as the same site visitor. So at most, if this happens it will not create site visitors in internal-apis.\r\n\r\nAre you ok with this approach? ","created_at":"2018-12-27T20:05:19Z","updated_at":"2018-12-27T20:05:19Z","html_url":"https://github.com/lbryio/lbry.io/pull/886#discussion_r244218036","pull_request_url":"https://api.github.com/repos/lbryio/lbry.io/pulls/886","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/lbryio/lbry.io/pulls/comments/244218036"},"html":{"href":"https://github.com/lbryio/lbry.io/pull/886#discussion_r244218036"},"pull_request":{"href":"https://api.github.com/repos/lbryio/lbry.io/pulls/886"}},"in_reply_to_id":242313213},"pull_request":{"url":"https://api.github.com/repos/lbryio/lbry.io/pulls/886","id":231793691,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMxNzkzNjkx","html_url":"https://github.com/lbryio/lbry.io/pull/886","diff_url":"https://github.com/lbryio/lbry.io/pull/886.diff","patch_url":"https://github.com/lbryio/lbry.io/pull/886.patch","issue_url":"https://api.github.com/repos/lbryio/lbry.io/issues/886","number":886,"state":"open","locked":false,"title":"Set unique user id for google analytics and facebook pixel.","user":{"login":"tiger5226","id":3402064,"node_id":"MDQ6VXNlcjM0MDIwNjQ=","avatar_url":"https://avatars0.githubusercontent.com/u/3402064?v=4","gravatar_id":"","url":"https://api.github.com/users/tiger5226","html_url":"https://github.com/tiger5226","followers_url":"https://api.github.com/users/tiger5226/followers","following_url":"https://api.github.com/users/tiger5226/following{/other_user}","gists_url":"https://api.github.com/users/tiger5226/gists{/gist_id}","starred_url":"https://api.github.com/users/tiger5226/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiger5226/subscriptions","organizations_url":"https://api.github.com/users/tiger5226/orgs","repos_url":"https://api.github.com/users/tiger5226/repos","events_url":"https://api.github.com/users/tiger5226/events{/privacy}","received_events_url":"https://api.github.com/users/tiger5226/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-11-18T15:05:23Z","updated_at":"2018-12-27T20:05:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4e5a218a69ca23b69e1b824a473fea9a0e360d83","assignee":{"login":"tiger5226","id":3402064,"node_id":"MDQ6VXNlcjM0MDIwNjQ=","avatar_url":"https://avatars0.githubusercontent.com/u/3402064?v=4","gravatar_id":"","url":"https://api.github.com/users/tiger5226","html_url":"https://github.com/tiger5226","followers_url":"https://api.github.com/users/tiger5226/followers","following_url":"https://api.github.com/users/tiger5226/following{/other_user}","gists_url":"https://api.github.com/users/tiger5226/gists{/gist_id}","starred_url":"https://api.github.com/users/tiger5226/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiger5226/subscriptions","organizations_url":"https://api.github.com/users/tiger5226/orgs","repos_url":"https://api.github.com/users/tiger5226/repos","events_url":"https://api.github.com/users/tiger5226/events{/privacy}","received_events_url":"https://api.github.com/users/tiger5226/received_events","type":"User","site_admin":false},"assignees":[{"login":"tiger5226","id":3402064,"node_id":"MDQ6VXNlcjM0MDIwNjQ=","avatar_url":"https://avatars0.githubusercontent.com/u/3402064?v=4","gravatar_id":"","url":"https://api.github.com/users/tiger5226","html_url":"https://github.com/tiger5226","followers_url":"https://api.github.com/users/tiger5226/followers","following_url":"https://api.github.com/users/tiger5226/following{/other_user}","gists_url":"https://api.github.com/users/tiger5226/gists{/gist_id}","starred_url":"https://api.github.com/users/tiger5226/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiger5226/subscriptions","organizations_url":"https://api.github.com/users/tiger5226/orgs","repos_url":"https://api.github.com/users/tiger5226/repos","events_url":"https://api.github.com/users/tiger5226/events{/privacy}","received_events_url":"https://api.github.com/users/tiger5226/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/lbryio/lbry.io/pulls/886/commits","review_comments_url":"https://api.github.com/repos/lbryio/lbry.io/pulls/886/comments","review_comment_url":"https://api.github.com/repos/lbryio/lbry.io/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lbryio/lbry.io/issues/886/comments","statuses_url":"https://api.github.com/repos/lbryio/lbry.io/statuses/258762da47ac42046e21943a2385cd1d8b700fb6","head":{"label":"lbryio:web_visitor_logging","ref":"web_visitor_logging","sha":"258762da47ac42046e21943a2385cd1d8b700fb6","user":{"login":"lbryio","id":13889222,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzODg5MjIy","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":43893530,"node_id":"MDEwOlJlcG9zaXRvcnk0Mzg5MzUzMA==","name":"lbry.io","full_name":"lbryio/lbry.io","private":false,"owner":{"login":"lbryio","id":13889222,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzODg5MjIy","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},"html_url":"https://github.com/lbryio/lbry.io","description":"lbry.io, the website for the LBRY protocol","fork":false,"url":"https://api.github.com/repos/lbryio/lbry.io","forks_url":"https://api.github.com/repos/lbryio/lbry.io/forks","keys_url":"https://api.github.com/repos/lbryio/lbry.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lbryio/lbry.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lbryio/lbry.io/teams","hooks_url":"https://api.github.com/repos/lbryio/lbry.io/hooks","issue_events_url":"https://api.github.com/repos/lbryio/lbry.io/issues/events{/number}","events_url":"https://api.github.com/repos/lbryio/lbry.io/events","assignees_url":"https://api.github.com/repos/lbryio/lbry.io/assignees{/user}","branches_url":"https://api.github.com/repos/lbryio/lbry.io/branches{/branch}","tags_url":"https://api.github.com/repos/lbryio/lbry.io/tags","blobs_url":"https://api.github.com/repos/lbryio/lbry.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lbryio/lbry.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lbryio/lbry.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/lbryio/lbry.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lbryio/lbry.io/statuses/{sha}","languages_url":"https://api.github.com/repos/lbryio/lbry.io/languages","stargazers_url":"https://api.github.com/repos/lbryio/lbry.io/stargazers","contributors_url":"https://api.github.com/repos/lbryio/lbry.io/contributors","subscribers_url":"https://api.github.com/repos/lbryio/lbry.io/subscribers","subscription_url":"https://api.github.com/repos/lbryio/lbry.io/subscription","commits_url":"https://api.github.com/repos/lbryio/lbry.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/lbryio/lbry.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/lbryio/lbry.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/lbryio/lbry.io/issues/comments{/number}","contents_url":"https://api.github.com/repos/lbryio/lbry.io/contents/{+path}","compare_url":"https://api.github.com/repos/lbryio/lbry.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lbryio/lbry.io/merges","archive_url":"https://api.github.com/repos/lbryio/lbry.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lbryio/lbry.io/downloads","issues_url":"https://api.github.com/repos/lbryio/lbry.io/issues{/number}","pulls_url":"https://api.github.com/repos/lbryio/lbry.io/pulls{/number}","milestones_url":"https://api.github.com/repos/lbryio/lbry.io/milestones{/number}","notifications_url":"https://api.github.com/repos/lbryio/lbry.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lbryio/lbry.io/labels{/name}","releases_url":"https://api.github.com/repos/lbryio/lbry.io/releases{/id}","deployments_url":"https://api.github.com/repos/lbryio/lbry.io/deployments","created_at":"2015-10-08T14:20:20Z","updated_at":"2018-12-19T00:02:27Z","pushed_at":"2018-12-19T23:01:29Z","git_url":"git://github.com/lbryio/lbry.io.git","ssh_url":"git@github.com:lbryio/lbry.io.git","clone_url":"https://github.com/lbryio/lbry.io.git","svn_url":"https://github.com/lbryio/lbry.io","homepage":"https://lbry.io","size":277621,"stargazers_count":59,"watchers_count":59,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":102,"mirror_url":null,"archived":false,"open_issues_count":38,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":102,"open_issues":38,"watchers":59,"default_branch":"master"}},"base":{"label":"lbryio:master","ref":"master","sha":"e68fa704d2c57d16f28d4a6993df485fd0165d3d","user":{"login":"lbryio","id":13889222,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzODg5MjIy","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":43893530,"node_id":"MDEwOlJlcG9zaXRvcnk0Mzg5MzUzMA==","name":"lbry.io","full_name":"lbryio/lbry.io","private":false,"owner":{"login":"lbryio","id":13889222,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzODg5MjIy","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},"html_url":"https://github.com/lbryio/lbry.io","description":"lbry.io, the website for the LBRY protocol","fork":false,"url":"https://api.github.com/repos/lbryio/lbry.io","forks_url":"https://api.github.com/repos/lbryio/lbry.io/forks","keys_url":"https://api.github.com/repos/lbryio/lbry.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lbryio/lbry.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lbryio/lbry.io/teams","hooks_url":"https://api.github.com/repos/lbryio/lbry.io/hooks","issue_events_url":"https://api.github.com/repos/lbryio/lbry.io/issues/events{/number}","events_url":"https://api.github.com/repos/lbryio/lbry.io/events","assignees_url":"https://api.github.com/repos/lbryio/lbry.io/assignees{/user}","branches_url":"https://api.github.com/repos/lbryio/lbry.io/branches{/branch}","tags_url":"https://api.github.com/repos/lbryio/lbry.io/tags","blobs_url":"https://api.github.com/repos/lbryio/lbry.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lbryio/lbry.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lbryio/lbry.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/lbryio/lbry.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lbryio/lbry.io/statuses/{sha}","languages_url":"https://api.github.com/repos/lbryio/lbry.io/languages","stargazers_url":"https://api.github.com/repos/lbryio/lbry.io/stargazers","contributors_url":"https://api.github.com/repos/lbryio/lbry.io/contributors","subscribers_url":"https://api.github.com/repos/lbryio/lbry.io/subscribers","subscription_url":"https://api.github.com/repos/lbryio/lbry.io/subscription","commits_url":"https://api.github.com/repos/lbryio/lbry.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/lbryio/lbry.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/lbryio/lbry.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/lbryio/lbry.io/issues/comments{/number}","contents_url":"https://api.github.com/repos/lbryio/lbry.io/contents/{+path}","compare_url":"https://api.github.com/repos/lbryio/lbry.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lbryio/lbry.io/merges","archive_url":"https://api.github.com/repos/lbryio/lbry.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lbryio/lbry.io/downloads","issues_url":"https://api.github.com/repos/lbryio/lbry.io/issues{/number}","pulls_url":"https://api.github.com/repos/lbryio/lbry.io/pulls{/number}","milestones_url":"https://api.github.com/repos/lbryio/lbry.io/milestones{/number}","notifications_url":"https://api.github.com/repos/lbryio/lbry.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lbryio/lbry.io/labels{/name}","releases_url":"https://api.github.com/repos/lbryio/lbry.io/releases{/id}","deployments_url":"https://api.github.com/repos/lbryio/lbry.io/deployments","created_at":"2015-10-08T14:20:20Z","updated_at":"2018-12-19T00:02:27Z","pushed_at":"2018-12-19T23:01:29Z","git_url":"git://github.com/lbryio/lbry.io.git","ssh_url":"git@github.com:lbryio/lbry.io.git","clone_url":"https://github.com/lbryio/lbry.io.git","svn_url":"https://github.com/lbryio/lbry.io","homepage":"https://lbry.io","size":277621,"stargazers_count":59,"watchers_count":59,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":102,"mirror_url":null,"archived":false,"open_issues_count":38,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":102,"open_issues":38,"watchers":59,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lbryio/lbry.io/pulls/886"},"html":{"href":"https://github.com/lbryio/lbry.io/pull/886"},"issue":{"href":"https://api.github.com/repos/lbryio/lbry.io/issues/886"},"comments":{"href":"https://api.github.com/repos/lbryio/lbry.io/issues/886/comments"},"review_comments":{"href":"https://api.github.com/repos/lbryio/lbry.io/pulls/886/comments"},"review_comment":{"href":"https://api.github.com/repos/lbryio/lbry.io/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lbryio/lbry.io/pulls/886/commits"},"statuses":{"href":"https://api.github.com/repos/lbryio/lbry.io/statuses/258762da47ac42046e21943a2385cd1d8b700fb6"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"tiger5226"}}