{"action":"created","comment":{"url":"https://api.github.com/repos/ampproject/amphtml/pulls/comments/81631402","pull_request_review_id":2597709,"id":81631402,"diff_hunk":"@@ -536,4 +543,39 @@ export class AmpSlideScroll extends BaseSlides {\n       event.stopPropagation();\n     });\n   }\n+\n+  /**\n+   * @param {number} newSlideIndex\n+   * @private\n+   */\n+  triggerAnalyticsEvent_(newSlideIndex) {\n+    let direction = newSlideIndex - this.slideIndex_;\n+    if (direction == 0) {\n+      return;\n+    } else if (Math.abs(direction) !== 1) {\n+      direction = direction < 0 ? 1 : -1;\n+    }\n+    if (direction == 1) {\n+      this.analyticsEvent_('amp-carousel-next');\n+      this.analyticsEvent_('amp-carousel-change');","path":"extensions/amp-carousel/0.1/slidescroll.js","position":null,"original_position":53,"commit_id":"7a0483a34e59c22ff04aff6b11ac4a38cdbf399c","original_commit_id":"1242aaaf5538bf43c22c032cab45de3602da50fa","user":{"login":"sriramkrish85","id":1037311,"avatar_url":"https://avatars.githubusercontent.com/u/1037311?v=3","gravatar_id":"","url":"https://api.github.com/users/sriramkrish85","html_url":"https://github.com/sriramkrish85","followers_url":"https://api.github.com/users/sriramkrish85/followers","following_url":"https://api.github.com/users/sriramkrish85/following{/other_user}","gists_url":"https://api.github.com/users/sriramkrish85/gists{/gist_id}","starred_url":"https://api.github.com/users/sriramkrish85/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sriramkrish85/subscriptions","organizations_url":"https://api.github.com/users/sriramkrish85/orgs","repos_url":"https://api.github.com/users/sriramkrish85/repos","events_url":"https://api.github.com/users/sriramkrish85/events{/privacy}","received_events_url":"https://api.github.com/users/sriramkrish85/received_events","type":"User","site_admin":false},"body":"Done","created_at":"2016-10-03T20:21:33Z","updated_at":"2016-10-03T20:21:33Z","html_url":"https://github.com/ampproject/amphtml/pull/5360#discussion_r81631402","pull_request_url":"https://api.github.com/repos/ampproject/amphtml/pulls/5360","_links":{"self":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/comments/81631402"},"html":{"href":"https://github.com/ampproject/amphtml/pull/5360#discussion_r81631402"},"pull_request":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/5360"}}},"pull_request":{"url":"https://api.github.com/repos/ampproject/amphtml/pulls/5360","id":87580504,"html_url":"https://github.com/ampproject/amphtml/pull/5360","diff_url":"https://github.com/ampproject/amphtml/pull/5360.diff","patch_url":"https://github.com/ampproject/amphtml/pull/5360.patch","issue_url":"https://api.github.com/repos/ampproject/amphtml/issues/5360","number":5360,"state":"open","locked":false,"title":"Trigger analytics events when carousel switches slides.","user":{"login":"sriramkrish85","id":1037311,"avatar_url":"https://avatars.githubusercontent.com/u/1037311?v=3","gravatar_id":"","url":"https://api.github.com/users/sriramkrish85","html_url":"https://github.com/sriramkrish85","followers_url":"https://api.github.com/users/sriramkrish85/followers","following_url":"https://api.github.com/users/sriramkrish85/following{/other_user}","gists_url":"https://api.github.com/users/sriramkrish85/gists{/gist_id}","starred_url":"https://api.github.com/users/sriramkrish85/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sriramkrish85/subscriptions","organizations_url":"https://api.github.com/users/sriramkrish85/orgs","repos_url":"https://api.github.com/users/sriramkrish85/repos","events_url":"https://api.github.com/users/sriramkrish85/events{/privacy}","received_events_url":"https://api.github.com/users/sriramkrish85/received_events","type":"User","site_admin":false},"body":"Part 1 for #4292\r\n\r\n- [x] This PR only triggers events `amp-carousel-next` and `amp-carousel-prev` and does not provide any more information to amp-analytics\r\n\r\n\r\nYet to come\r\n\r\n- [ ] Enable Instrumentation.triggerEvent to accept object params (and observable to send params)\r\n- [ ] Have carousel send `carousel-id` and `data-slide-id` to analytics\r\n","created_at":"2016-09-30T23:20:45Z","updated_at":"2016-10-03T20:21:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f0b3f71b7d9b2ff605e62b1af96e9a2f80c581b8","assignee":{"login":"avimehta","id":179359,"avatar_url":"https://avatars.githubusercontent.com/u/179359?v=3","gravatar_id":"","url":"https://api.github.com/users/avimehta","html_url":"https://github.com/avimehta","followers_url":"https://api.github.com/users/avimehta/followers","following_url":"https://api.github.com/users/avimehta/following{/other_user}","gists_url":"https://api.github.com/users/avimehta/gists{/gist_id}","starred_url":"https://api.github.com/users/avimehta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avimehta/subscriptions","organizations_url":"https://api.github.com/users/avimehta/orgs","repos_url":"https://api.github.com/users/avimehta/repos","events_url":"https://api.github.com/users/avimehta/events{/privacy}","received_events_url":"https://api.github.com/users/avimehta/received_events","type":"User","site_admin":false},"assignees":[{"login":"avimehta","id":179359,"avatar_url":"https://avatars.githubusercontent.com/u/179359?v=3","gravatar_id":"","url":"https://api.github.com/users/avimehta","html_url":"https://github.com/avimehta","followers_url":"https://api.github.com/users/avimehta/followers","following_url":"https://api.github.com/users/avimehta/following{/other_user}","gists_url":"https://api.github.com/users/avimehta/gists{/gist_id}","starred_url":"https://api.github.com/users/avimehta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avimehta/subscriptions","organizations_url":"https://api.github.com/users/avimehta/orgs","repos_url":"https://api.github.com/users/avimehta/repos","events_url":"https://api.github.com/users/avimehta/events{/privacy}","received_events_url":"https://api.github.com/users/avimehta/received_events","type":"User","site_admin":false},{"login":"dvoytenko","id":726049,"avatar_url":"https://avatars.githubusercontent.com/u/726049?v=3","gravatar_id":"","url":"https://api.github.com/users/dvoytenko","html_url":"https://github.com/dvoytenko","followers_url":"https://api.github.com/users/dvoytenko/followers","following_url":"https://api.github.com/users/dvoytenko/following{/other_user}","gists_url":"https://api.github.com/users/dvoytenko/gists{/gist_id}","starred_url":"https://api.github.com/users/dvoytenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dvoytenko/subscriptions","organizations_url":"https://api.github.com/users/dvoytenko/orgs","repos_url":"https://api.github.com/users/dvoytenko/repos","events_url":"https://api.github.com/users/dvoytenko/events{/privacy}","received_events_url":"https://api.github.com/users/dvoytenko/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ampproject/amphtml/pulls/5360/commits","review_comments_url":"https://api.github.com/repos/ampproject/amphtml/pulls/5360/comments","review_comment_url":"https://api.github.com/repos/ampproject/amphtml/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ampproject/amphtml/issues/5360/comments","statuses_url":"https://api.github.com/repos/ampproject/amphtml/statuses/7a0483a34e59c22ff04aff6b11ac4a38cdbf399c","head":{"label":"sriramkrish85:carousel_analytics","ref":"carousel_analytics","sha":"7a0483a34e59c22ff04aff6b11ac4a38cdbf399c","user":{"login":"sriramkrish85","id":1037311,"avatar_url":"https://avatars.githubusercontent.com/u/1037311?v=3","gravatar_id":"","url":"https://api.github.com/users/sriramkrish85","html_url":"https://github.com/sriramkrish85","followers_url":"https://api.github.com/users/sriramkrish85/followers","following_url":"https://api.github.com/users/sriramkrish85/following{/other_user}","gists_url":"https://api.github.com/users/sriramkrish85/gists{/gist_id}","starred_url":"https://api.github.com/users/sriramkrish85/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sriramkrish85/subscriptions","organizations_url":"https://api.github.com/users/sriramkrish85/orgs","repos_url":"https://api.github.com/users/sriramkrish85/repos","events_url":"https://api.github.com/users/sriramkrish85/events{/privacy}","received_events_url":"https://api.github.com/users/sriramkrish85/received_events","type":"User","site_admin":false},"repo":{"id":44337813,"name":"amphtml","full_name":"sriramkrish85/amphtml","owner":{"login":"sriramkrish85","id":1037311,"avatar_url":"https://avatars.githubusercontent.com/u/1037311?v=3","gravatar_id":"","url":"https://api.github.com/users/sriramkrish85","html_url":"https://github.com/sriramkrish85","followers_url":"https://api.github.com/users/sriramkrish85/followers","following_url":"https://api.github.com/users/sriramkrish85/following{/other_user}","gists_url":"https://api.github.com/users/sriramkrish85/gists{/gist_id}","starred_url":"https://api.github.com/users/sriramkrish85/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sriramkrish85/subscriptions","organizations_url":"https://api.github.com/users/sriramkrish85/orgs","repos_url":"https://api.github.com/users/sriramkrish85/repos","events_url":"https://api.github.com/users/sriramkrish85/events{/privacy}","received_events_url":"https://api.github.com/users/sriramkrish85/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sriramkrish85/amphtml","description":"AMP HTML source code, samples, and documentation.  See below for more info.","fork":true,"url":"https://api.github.com/repos/sriramkrish85/amphtml","forks_url":"https://api.github.com/repos/sriramkrish85/amphtml/forks","keys_url":"https://api.github.com/repos/sriramkrish85/amphtml/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sriramkrish85/amphtml/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sriramkrish85/amphtml/teams","hooks_url":"https://api.github.com/repos/sriramkrish85/amphtml/hooks","issue_events_url":"https://api.github.com/repos/sriramkrish85/amphtml/issues/events{/number}","events_url":"https://api.github.com/repos/sriramkrish85/amphtml/events","assignees_url":"https://api.github.com/repos/sriramkrish85/amphtml/assignees{/user}","branches_url":"https://api.github.com/repos/sriramkrish85/amphtml/branches{/branch}","tags_url":"https://api.github.com/repos/sriramkrish85/amphtml/tags","blobs_url":"https://api.github.com/repos/sriramkrish85/amphtml/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sriramkrish85/amphtml/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sriramkrish85/amphtml/git/refs{/sha}","trees_url":"https://api.github.com/repos/sriramkrish85/amphtml/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sriramkrish85/amphtml/statuses/{sha}","languages_url":"https://api.github.com/repos/sriramkrish85/amphtml/languages","stargazers_url":"https://api.github.com/repos/sriramkrish85/amphtml/stargazers","contributors_url":"https://api.github.com/repos/sriramkrish85/amphtml/contributors","subscribers_url":"https://api.github.com/repos/sriramkrish85/amphtml/subscribers","subscription_url":"https://api.github.com/repos/sriramkrish85/amphtml/subscription","commits_url":"https://api.github.com/repos/sriramkrish85/amphtml/commits{/sha}","git_commits_url":"https://api.github.com/repos/sriramkrish85/amphtml/git/commits{/sha}","comments_url":"https://api.github.com/repos/sriramkrish85/amphtml/comments{/number}","issue_comment_url":"https://api.github.com/repos/sriramkrish85/amphtml/issues/comments{/number}","contents_url":"https://api.github.com/repos/sriramkrish85/amphtml/contents/{+path}","compare_url":"https://api.github.com/repos/sriramkrish85/amphtml/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sriramkrish85/amphtml/merges","archive_url":"https://api.github.com/repos/sriramkrish85/amphtml/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sriramkrish85/amphtml/downloads","issues_url":"https://api.github.com/repos/sriramkrish85/amphtml/issues{/number}","pulls_url":"https://api.github.com/repos/sriramkrish85/amphtml/pulls{/number}","milestones_url":"https://api.github.com/repos/sriramkrish85/amphtml/milestones{/number}","notifications_url":"https://api.github.com/repos/sriramkrish85/amphtml/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sriramkrish85/amphtml/labels{/name}","releases_url":"https://api.github.com/repos/sriramkrish85/amphtml/releases{/id}","deployments_url":"https://api.github.com/repos/sriramkrish85/amphtml/deployments","created_at":"2015-10-15T18:39:52Z","updated_at":"2016-01-13T02:54:37Z","pushed_at":"2016-10-03T20:15:49Z","git_url":"git://github.com/sriramkrish85/amphtml.git","ssh_url":"git@github.com:sriramkrish85/amphtml.git","clone_url":"https://github.com/sriramkrish85/amphtml.git","svn_url":"https://github.com/sriramkrish85/amphtml","homepage":"https://ampproject.org","size":165250,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":false,"has_wiki":false,"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":"ampproject:master","ref":"master","sha":"05027f162d793204fe05ee09c3a9307bfd7fa69a","user":{"login":"ampproject","id":14114390,"avatar_url":"https://avatars.githubusercontent.com/u/14114390?v=3","gravatar_id":"","url":"https://api.github.com/users/ampproject","html_url":"https://github.com/ampproject","followers_url":"https://api.github.com/users/ampproject/followers","following_url":"https://api.github.com/users/ampproject/following{/other_user}","gists_url":"https://api.github.com/users/ampproject/gists{/gist_id}","starred_url":"https://api.github.com/users/ampproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ampproject/subscriptions","organizations_url":"https://api.github.com/users/ampproject/orgs","repos_url":"https://api.github.com/users/ampproject/repos","events_url":"https://api.github.com/users/ampproject/events{/privacy}","received_events_url":"https://api.github.com/users/ampproject/received_events","type":"Organization","site_admin":false},"repo":{"id":41766002,"name":"amphtml","full_name":"ampproject/amphtml","owner":{"login":"ampproject","id":14114390,"avatar_url":"https://avatars.githubusercontent.com/u/14114390?v=3","gravatar_id":"","url":"https://api.github.com/users/ampproject","html_url":"https://github.com/ampproject","followers_url":"https://api.github.com/users/ampproject/followers","following_url":"https://api.github.com/users/ampproject/following{/other_user}","gists_url":"https://api.github.com/users/ampproject/gists{/gist_id}","starred_url":"https://api.github.com/users/ampproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ampproject/subscriptions","organizations_url":"https://api.github.com/users/ampproject/orgs","repos_url":"https://api.github.com/users/ampproject/repos","events_url":"https://api.github.com/users/ampproject/events{/privacy}","received_events_url":"https://api.github.com/users/ampproject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ampproject/amphtml","description":"AMP HTML source code, samples, and documentation.  See below for more info.","fork":false,"url":"https://api.github.com/repos/ampproject/amphtml","forks_url":"https://api.github.com/repos/ampproject/amphtml/forks","keys_url":"https://api.github.com/repos/ampproject/amphtml/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ampproject/amphtml/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ampproject/amphtml/teams","hooks_url":"https://api.github.com/repos/ampproject/amphtml/hooks","issue_events_url":"https://api.github.com/repos/ampproject/amphtml/issues/events{/number}","events_url":"https://api.github.com/repos/ampproject/amphtml/events","assignees_url":"https://api.github.com/repos/ampproject/amphtml/assignees{/user}","branches_url":"https://api.github.com/repos/ampproject/amphtml/branches{/branch}","tags_url":"https://api.github.com/repos/ampproject/amphtml/tags","blobs_url":"https://api.github.com/repos/ampproject/amphtml/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ampproject/amphtml/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ampproject/amphtml/git/refs{/sha}","trees_url":"https://api.github.com/repos/ampproject/amphtml/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ampproject/amphtml/statuses/{sha}","languages_url":"https://api.github.com/repos/ampproject/amphtml/languages","stargazers_url":"https://api.github.com/repos/ampproject/amphtml/stargazers","contributors_url":"https://api.github.com/repos/ampproject/amphtml/contributors","subscribers_url":"https://api.github.com/repos/ampproject/amphtml/subscribers","subscription_url":"https://api.github.com/repos/ampproject/amphtml/subscription","commits_url":"https://api.github.com/repos/ampproject/amphtml/commits{/sha}","git_commits_url":"https://api.github.com/repos/ampproject/amphtml/git/commits{/sha}","comments_url":"https://api.github.com/repos/ampproject/amphtml/comments{/number}","issue_comment_url":"https://api.github.com/repos/ampproject/amphtml/issues/comments{/number}","contents_url":"https://api.github.com/repos/ampproject/amphtml/contents/{+path}","compare_url":"https://api.github.com/repos/ampproject/amphtml/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ampproject/amphtml/merges","archive_url":"https://api.github.com/repos/ampproject/amphtml/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ampproject/amphtml/downloads","issues_url":"https://api.github.com/repos/ampproject/amphtml/issues{/number}","pulls_url":"https://api.github.com/repos/ampproject/amphtml/pulls{/number}","milestones_url":"https://api.github.com/repos/ampproject/amphtml/milestones{/number}","notifications_url":"https://api.github.com/repos/ampproject/amphtml/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ampproject/amphtml/labels{/name}","releases_url":"https://api.github.com/repos/ampproject/amphtml/releases{/id}","deployments_url":"https://api.github.com/repos/ampproject/amphtml/deployments","created_at":"2015-09-01T22:10:53Z","updated_at":"2016-10-03T20:11:08Z","pushed_at":"2016-10-03T20:15:49Z","git_url":"git://github.com/ampproject/amphtml.git","ssh_url":"git@github.com:ampproject/amphtml.git","clone_url":"https://github.com/ampproject/amphtml.git","svn_url":"https://github.com/ampproject/amphtml","homepage":"https://ampproject.org","size":205459,"stargazers_count":8709,"watchers_count":8709,"language":"JavaScript","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":1289,"mirror_url":null,"open_issues_count":826,"forks":1289,"open_issues":826,"watchers":8709,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/5360"},"html":{"href":"https://github.com/ampproject/amphtml/pull/5360"},"issue":{"href":"https://api.github.com/repos/ampproject/amphtml/issues/5360"},"comments":{"href":"https://api.github.com/repos/ampproject/amphtml/issues/5360/comments"},"review_comments":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/5360/comments"},"review_comment":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/5360/commits"},"statuses":{"href":"https://api.github.com/repos/ampproject/amphtml/statuses/7a0483a34e59c22ff04aff6b11ac4a38cdbf399c"}}}}
{"actor":{"display_login":"sriramkrish85"}}