{"action":"created","comment":{"url":"https://api.github.com/repos/reddit/reddit-mobile/pulls/comments/95930170","pull_request_review_id":16501653,"id":95930170,"diff_hunk":"@@ -16,6 +17,21 @@ class XPromoWrapper extends React.Component {\n     // Indicate that we've displayed a crosspromotional UI, so we don't keep\n     // showing them during this browsing session.\n     this.props.recordXPromoShown();\n+    window.addEventListener('scroll', this.onScroll);\n+  }\n+\n+  componentWillUnmount() {\n+    window.removeEventListener('scroll', this.onScroll);\n+  }\n+\n+  onScroll() {\n+    // For now we will consider scrolling half the viewport\n+    // \"scrolling passed\" the interstitial.\n+    // note the referencing of window\n+    if (window.pageYOffset > window.innerHeight / 2) {\n+      markXPromoScrolledPassed();\n+      window.removeEventListener('scroll', this.onScroll);","path":"src/app/components/XPromoWrapper/index.jsx","position":25,"original_position":25,"commit_id":"ccb944928911be105e05e2728a04cc80be162de9","original_commit_id":"ccb944928911be105e05e2728a04cc80be162de9","user":{"login":"prashtx","id":1307783,"avatar_url":"https://avatars.githubusercontent.com/u/1307783?v=3","gravatar_id":"","url":"https://api.github.com/users/prashtx","html_url":"https://github.com/prashtx","followers_url":"https://api.github.com/users/prashtx/followers","following_url":"https://api.github.com/users/prashtx/following{/other_user}","gists_url":"https://api.github.com/users/prashtx/gists{/gist_id}","starred_url":"https://api.github.com/users/prashtx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prashtx/subscriptions","organizations_url":"https://api.github.com/users/prashtx/orgs","repos_url":"https://api.github.com/users/prashtx/repos","events_url":"https://api.github.com/users/prashtx/events{/privacy}","received_events_url":"https://api.github.com/users/prashtx/received_events","type":"User","site_admin":false},"body":"When `onScroll` is called, it may not be called with a context object, so `this` might actually be undefined. If `onScroll` is bound to the object, then we'll have access to `this` and can reference `this.onScroll` without issue.","created_at":"2017-01-13T02:56:02Z","updated_at":"2017-01-13T02:59:46Z","html_url":"https://github.com/reddit/reddit-mobile/pull/946#discussion_r95930170","pull_request_url":"https://api.github.com/repos/reddit/reddit-mobile/pulls/946","_links":{"self":{"href":"https://api.github.com/repos/reddit/reddit-mobile/pulls/comments/95930170"},"html":{"href":"https://github.com/reddit/reddit-mobile/pull/946#discussion_r95930170"},"pull_request":{"href":"https://api.github.com/repos/reddit/reddit-mobile/pulls/946"}}},"pull_request":{"url":"https://api.github.com/repos/reddit/reddit-mobile/pulls/946","id":99820565,"html_url":"https://github.com/reddit/reddit-mobile/pull/946","diff_url":"https://github.com/reddit/reddit-mobile/pull/946.diff","patch_url":"https://github.com/reddit/reddit-mobile/pull/946.patch","issue_url":"https://api.github.com/repos/reddit/reddit-mobile/issues/946","number":946,"state":"open","locked":false,"title":"Chan 304 instrument interstitials","user":{"login":"telaviv","id":192675,"avatar_url":"https://avatars.githubusercontent.com/u/192675?v=3","gravatar_id":"","url":"https://api.github.com/users/telaviv","html_url":"https://github.com/telaviv","followers_url":"https://api.github.com/users/telaviv/followers","following_url":"https://api.github.com/users/telaviv/following{/other_user}","gists_url":"https://api.github.com/users/telaviv/gists{/gist_id}","starred_url":"https://api.github.com/users/telaviv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/telaviv/subscriptions","organizations_url":"https://api.github.com/users/telaviv/orgs","repos_url":"https://api.github.com/users/telaviv/repos","events_url":"https://api.github.com/users/telaviv/events{/privacy}","received_events_url":"https://api.github.com/users/telaviv/received_events","type":"User","site_admin":false},"body":"The goal of this PR to include two new fields for the screenview payload. One about if an interstitial has been closed and one about if an interstitial was scrolled passed. I chose 50% of the viewport to be considered a 'scroll passed event'. Not sure if this the best idea but it seems like at 50% they really meant to just get out of that interstitial. \r\n\r\nJustin requested simply adding the value of true to these properties. Given that, my implementation of the scroll passed storage is simply idempotently setting true whenever the event happens. On desktop these events happen very very very often. On mobile though, they happen only when a user's finger releases from the screen. ","created_at":"2017-01-01T09:57:23Z","updated_at":"2017-01-13T02:59:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f2600e7d0f62e7f5c8adc567e28c864ebb4ad41a","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/reddit/reddit-mobile/pulls/946/commits","review_comments_url":"https://api.github.com/repos/reddit/reddit-mobile/pulls/946/comments","review_comment_url":"https://api.github.com/repos/reddit/reddit-mobile/pulls/comments{/number}","comments_url":"https://api.github.com/repos/reddit/reddit-mobile/issues/946/comments","statuses_url":"https://api.github.com/repos/reddit/reddit-mobile/statuses/ccb944928911be105e05e2728a04cc80be162de9","head":{"label":"telaviv:chan-304-instrument-interstitials","ref":"chan-304-instrument-interstitials","sha":"ccb944928911be105e05e2728a04cc80be162de9","user":{"login":"telaviv","id":192675,"avatar_url":"https://avatars.githubusercontent.com/u/192675?v=3","gravatar_id":"","url":"https://api.github.com/users/telaviv","html_url":"https://github.com/telaviv","followers_url":"https://api.github.com/users/telaviv/followers","following_url":"https://api.github.com/users/telaviv/following{/other_user}","gists_url":"https://api.github.com/users/telaviv/gists{/gist_id}","starred_url":"https://api.github.com/users/telaviv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/telaviv/subscriptions","organizations_url":"https://api.github.com/users/telaviv/orgs","repos_url":"https://api.github.com/users/telaviv/repos","events_url":"https://api.github.com/users/telaviv/events{/privacy}","received_events_url":"https://api.github.com/users/telaviv/received_events","type":"User","site_admin":false},"repo":{"id":66982913,"name":"reddit-mobile","full_name":"telaviv/reddit-mobile","owner":{"login":"telaviv","id":192675,"avatar_url":"https://avatars.githubusercontent.com/u/192675?v=3","gravatar_id":"","url":"https://api.github.com/users/telaviv","html_url":"https://github.com/telaviv","followers_url":"https://api.github.com/users/telaviv/followers","following_url":"https://api.github.com/users/telaviv/following{/other_user}","gists_url":"https://api.github.com/users/telaviv/gists{/gist_id}","starred_url":"https://api.github.com/users/telaviv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/telaviv/subscriptions","organizations_url":"https://api.github.com/users/telaviv/orgs","repos_url":"https://api.github.com/users/telaviv/repos","events_url":"https://api.github.com/users/telaviv/events{/privacy}","received_events_url":"https://api.github.com/users/telaviv/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/telaviv/reddit-mobile","description":null,"fork":true,"url":"https://api.github.com/repos/telaviv/reddit-mobile","forks_url":"https://api.github.com/repos/telaviv/reddit-mobile/forks","keys_url":"https://api.github.com/repos/telaviv/reddit-mobile/keys{/key_id}","collaborators_url":"https://api.github.com/repos/telaviv/reddit-mobile/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/telaviv/reddit-mobile/teams","hooks_url":"https://api.github.com/repos/telaviv/reddit-mobile/hooks","issue_events_url":"https://api.github.com/repos/telaviv/reddit-mobile/issues/events{/number}","events_url":"https://api.github.com/repos/telaviv/reddit-mobile/events","assignees_url":"https://api.github.com/repos/telaviv/reddit-mobile/assignees{/user}","branches_url":"https://api.github.com/repos/telaviv/reddit-mobile/branches{/branch}","tags_url":"https://api.github.com/repos/telaviv/reddit-mobile/tags","blobs_url":"https://api.github.com/repos/telaviv/reddit-mobile/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/telaviv/reddit-mobile/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/telaviv/reddit-mobile/git/refs{/sha}","trees_url":"https://api.github.com/repos/telaviv/reddit-mobile/git/trees{/sha}","statuses_url":"https://api.github.com/repos/telaviv/reddit-mobile/statuses/{sha}","languages_url":"https://api.github.com/repos/telaviv/reddit-mobile/languages","stargazers_url":"https://api.github.com/repos/telaviv/reddit-mobile/stargazers","contributors_url":"https://api.github.com/repos/telaviv/reddit-mobile/contributors","subscribers_url":"https://api.github.com/repos/telaviv/reddit-mobile/subscribers","subscription_url":"https://api.github.com/repos/telaviv/reddit-mobile/subscription","commits_url":"https://api.github.com/repos/telaviv/reddit-mobile/commits{/sha}","git_commits_url":"https://api.github.com/repos/telaviv/reddit-mobile/git/commits{/sha}","comments_url":"https://api.github.com/repos/telaviv/reddit-mobile/comments{/number}","issue_comment_url":"https://api.github.com/repos/telaviv/reddit-mobile/issues/comments{/number}","contents_url":"https://api.github.com/repos/telaviv/reddit-mobile/contents/{+path}","compare_url":"https://api.github.com/repos/telaviv/reddit-mobile/compare/{base}...{head}","merges_url":"https://api.github.com/repos/telaviv/reddit-mobile/merges","archive_url":"https://api.github.com/repos/telaviv/reddit-mobile/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/telaviv/reddit-mobile/downloads","issues_url":"https://api.github.com/repos/telaviv/reddit-mobile/issues{/number}","pulls_url":"https://api.github.com/repos/telaviv/reddit-mobile/pulls{/number}","milestones_url":"https://api.github.com/repos/telaviv/reddit-mobile/milestones{/number}","notifications_url":"https://api.github.com/repos/telaviv/reddit-mobile/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/telaviv/reddit-mobile/labels{/name}","releases_url":"https://api.github.com/repos/telaviv/reddit-mobile/releases{/id}","deployments_url":"https://api.github.com/repos/telaviv/reddit-mobile/deployments","created_at":"2016-08-30T22:41:34Z","updated_at":"2016-08-30T22:41:37Z","pushed_at":"2017-01-13T00:41:18Z","git_url":"git://github.com/telaviv/reddit-mobile.git","ssh_url":"git@github.com:telaviv/reddit-mobile.git","clone_url":"https://github.com/telaviv/reddit-mobile.git","svn_url":"https://github.com/telaviv/reddit-mobile","homepage":null,"size":10354,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"reddit:2X","ref":"2X","sha":"17c5136d290af1826325ccdc5c74339de2daf3a7","user":{"login":"reddit","id":14248,"avatar_url":"https://avatars.githubusercontent.com/u/14248?v=3","gravatar_id":"","url":"https://api.github.com/users/reddit","html_url":"https://github.com/reddit","followers_url":"https://api.github.com/users/reddit/followers","following_url":"https://api.github.com/users/reddit/following{/other_user}","gists_url":"https://api.github.com/users/reddit/gists{/gist_id}","starred_url":"https://api.github.com/users/reddit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reddit/subscriptions","organizations_url":"https://api.github.com/users/reddit/orgs","repos_url":"https://api.github.com/users/reddit/repos","events_url":"https://api.github.com/users/reddit/events{/privacy}","received_events_url":"https://api.github.com/users/reddit/received_events","type":"Organization","site_admin":false},"repo":{"id":23087554,"name":"reddit-mobile","full_name":"reddit/reddit-mobile","owner":{"login":"reddit","id":14248,"avatar_url":"https://avatars.githubusercontent.com/u/14248?v=3","gravatar_id":"","url":"https://api.github.com/users/reddit","html_url":"https://github.com/reddit","followers_url":"https://api.github.com/users/reddit/followers","following_url":"https://api.github.com/users/reddit/following{/other_user}","gists_url":"https://api.github.com/users/reddit/gists{/gist_id}","starred_url":"https://api.github.com/users/reddit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reddit/subscriptions","organizations_url":"https://api.github.com/users/reddit/orgs","repos_url":"https://api.github.com/users/reddit/repos","events_url":"https://api.github.com/users/reddit/events{/privacy}","received_events_url":"https://api.github.com/users/reddit/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/reddit/reddit-mobile","description":null,"fork":false,"url":"https://api.github.com/repos/reddit/reddit-mobile","forks_url":"https://api.github.com/repos/reddit/reddit-mobile/forks","keys_url":"https://api.github.com/repos/reddit/reddit-mobile/keys{/key_id}","collaborators_url":"https://api.github.com/repos/reddit/reddit-mobile/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/reddit/reddit-mobile/teams","hooks_url":"https://api.github.com/repos/reddit/reddit-mobile/hooks","issue_events_url":"https://api.github.com/repos/reddit/reddit-mobile/issues/events{/number}","events_url":"https://api.github.com/repos/reddit/reddit-mobile/events","assignees_url":"https://api.github.com/repos/reddit/reddit-mobile/assignees{/user}","branches_url":"https://api.github.com/repos/reddit/reddit-mobile/branches{/branch}","tags_url":"https://api.github.com/repos/reddit/reddit-mobile/tags","blobs_url":"https://api.github.com/repos/reddit/reddit-mobile/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/reddit/reddit-mobile/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/reddit/reddit-mobile/git/refs{/sha}","trees_url":"https://api.github.com/repos/reddit/reddit-mobile/git/trees{/sha}","statuses_url":"https://api.github.com/repos/reddit/reddit-mobile/statuses/{sha}","languages_url":"https://api.github.com/repos/reddit/reddit-mobile/languages","stargazers_url":"https://api.github.com/repos/reddit/reddit-mobile/stargazers","contributors_url":"https://api.github.com/repos/reddit/reddit-mobile/contributors","subscribers_url":"https://api.github.com/repos/reddit/reddit-mobile/subscribers","subscription_url":"https://api.github.com/repos/reddit/reddit-mobile/subscription","commits_url":"https://api.github.com/repos/reddit/reddit-mobile/commits{/sha}","git_commits_url":"https://api.github.com/repos/reddit/reddit-mobile/git/commits{/sha}","comments_url":"https://api.github.com/repos/reddit/reddit-mobile/comments{/number}","issue_comment_url":"https://api.github.com/repos/reddit/reddit-mobile/issues/comments{/number}","contents_url":"https://api.github.com/repos/reddit/reddit-mobile/contents/{+path}","compare_url":"https://api.github.com/repos/reddit/reddit-mobile/compare/{base}...{head}","merges_url":"https://api.github.com/repos/reddit/reddit-mobile/merges","archive_url":"https://api.github.com/repos/reddit/reddit-mobile/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/reddit/reddit-mobile/downloads","issues_url":"https://api.github.com/repos/reddit/reddit-mobile/issues{/number}","pulls_url":"https://api.github.com/repos/reddit/reddit-mobile/pulls{/number}","milestones_url":"https://api.github.com/repos/reddit/reddit-mobile/milestones{/number}","notifications_url":"https://api.github.com/repos/reddit/reddit-mobile/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/reddit/reddit-mobile/labels{/name}","releases_url":"https://api.github.com/repos/reddit/reddit-mobile/releases{/id}","deployments_url":"https://api.github.com/repos/reddit/reddit-mobile/deployments","created_at":"2014-08-18T21:42:05Z","updated_at":"2017-01-12T10:09:46Z","pushed_at":"2017-01-13T02:07:59Z","git_url":"git://github.com/reddit/reddit-mobile.git","ssh_url":"git@github.com:reddit/reddit-mobile.git","clone_url":"https://github.com/reddit/reddit-mobile.git","svn_url":"https://github.com/reddit/reddit-mobile","homepage":null,"size":10372,"stargazers_count":907,"watchers_count":907,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":164,"mirror_url":null,"open_issues_count":23,"forks":164,"open_issues":23,"watchers":907,"default_branch":"2X"}},"_links":{"self":{"href":"https://api.github.com/repos/reddit/reddit-mobile/pulls/946"},"html":{"href":"https://github.com/reddit/reddit-mobile/pull/946"},"issue":{"href":"https://api.github.com/repos/reddit/reddit-mobile/issues/946"},"comments":{"href":"https://api.github.com/repos/reddit/reddit-mobile/issues/946/comments"},"review_comments":{"href":"https://api.github.com/repos/reddit/reddit-mobile/pulls/946/comments"},"review_comment":{"href":"https://api.github.com/repos/reddit/reddit-mobile/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/reddit/reddit-mobile/pulls/946/commits"},"statuses":{"href":"https://api.github.com/repos/reddit/reddit-mobile/statuses/ccb944928911be105e05e2728a04cc80be162de9"}}}}
{"actor":{"display_login":"prashtx"}}