{"action":"created","comment":{"url":"https://api.github.com/repos/guardian/subscriptions-frontend/pulls/comments/42238665","id":42238665,"diff_hunk":"@@ -23,9 +23,8 @@ define([\n     }\n \n     function recordRedirect() {\n-        var link = elements.$CHECKOUT_LINK[0];\n-        if (link) {\n-            bean.on(link, 'click', function () {\n+        if (elements.$CHECKOUT_LINK && elements.$CHECKOUT_LINK.length==1) {","path":"assets/javascripts/modules/country.js","position":7,"original_position":7,"commit_id":"068d6eeaec4485731b8211667710f212b4b5f7b4","original_commit_id":"068d6eeaec4485731b8211667710f212b4b5f7b4","user":{"login":"davidrapson","id":123386,"avatar_url":"https://avatars.githubusercontent.com/u/123386?v=3","gravatar_id":"","url":"https://api.github.com/users/davidrapson","html_url":"https://github.com/davidrapson","followers_url":"https://api.github.com/users/davidrapson/followers","following_url":"https://api.github.com/users/davidrapson/following{/other_user}","gists_url":"https://api.github.com/users/davidrapson/gists{/gist_id}","starred_url":"https://api.github.com/users/davidrapson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidrapson/subscriptions","organizations_url":"https://api.github.com/users/davidrapson/orgs","repos_url":"https://api.github.com/users/davidrapson/repos","events_url":"https://api.github.com/users/davidrapson/events{/privacy}","received_events_url":"https://api.github.com/users/davidrapson/received_events","type":"User","site_admin":false},"body":"Not sure you need the `==1` but if, so maybe use strict equality `===`?","created_at":"2015-10-16T12:55:17Z","updated_at":"2015-10-16T12:55:17Z","html_url":"https://github.com/guardian/subscriptions-frontend/pull/258#discussion_r42238665","pull_request_url":"https://api.github.com/repos/guardian/subscriptions-frontend/pulls/258","_links":{"self":{"href":"https://api.github.com/repos/guardian/subscriptions-frontend/pulls/comments/42238665"},"html":{"href":"https://github.com/guardian/subscriptions-frontend/pull/258#discussion_r42238665"},"pull_request":{"href":"https://api.github.com/repos/guardian/subscriptions-frontend/pulls/258"}}},"pull_request":{"url":"https://api.github.com/repos/guardian/subscriptions-frontend/pulls/258","id":47902791,"html_url":"https://github.com/guardian/subscriptions-frontend/pull/258","diff_url":"https://github.com/guardian/subscriptions-frontend/pull/258.diff","patch_url":"https://github.com/guardian/subscriptions-frontend/pull/258.patch","issue_url":"https://api.github.com/repos/guardian/subscriptions-frontend/issues/258","number":258,"state":"open","locked":false,"title":"Analytics should not fire if using test users ","user":{"login":"chrisjowen","id":80583,"avatar_url":"https://avatars.githubusercontent.com/u/80583?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisjowen","html_url":"https://github.com/chrisjowen","followers_url":"https://api.github.com/users/chrisjowen/followers","following_url":"https://api.github.com/users/chrisjowen/following{/other_user}","gists_url":"https://api.github.com/users/chrisjowen/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisjowen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisjowen/subscriptions","organizations_url":"https://api.github.com/users/chrisjowen/orgs","repos_url":"https://api.github.com/users/chrisjowen/repos","events_url":"https://api.github.com/users/chrisjowen/events{/privacy}","received_events_url":"https://api.github.com/users/chrisjowen/received_events","type":"User","site_admin":false},"body":"Currently the analytics setup component was guarding on initialisation of the various analytics components we used. However, there were other entry points exposed to call analytics which made the data we were getting a little off. This PR adds the additional guards around those exposed calls. \r\n\r\nSee https://trello.com/c/lshDPxMa/213-ensure-analytics-always-respect-analytics-off-key-cookie for more informaiton","created_at":"2015-10-16T12:13:54Z","updated_at":"2015-10-16T12:55:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c86db3837a2bccece90fe1d8616acdd6861be8fd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/guardian/subscriptions-frontend/pulls/258/commits","review_comments_url":"https://api.github.com/repos/guardian/subscriptions-frontend/pulls/258/comments","review_comment_url":"https://api.github.com/repos/guardian/subscriptions-frontend/pulls/comments{/number}","comments_url":"https://api.github.com/repos/guardian/subscriptions-frontend/issues/258/comments","statuses_url":"https://api.github.com/repos/guardian/subscriptions-frontend/statuses/068d6eeaec4485731b8211667710f212b4b5f7b4","head":{"label":"guardian:analytics-guard","ref":"analytics-guard","sha":"068d6eeaec4485731b8211667710f212b4b5f7b4","user":{"login":"guardian","id":164318,"avatar_url":"https://avatars.githubusercontent.com/u/164318?v=3","gravatar_id":"","url":"https://api.github.com/users/guardian","html_url":"https://github.com/guardian","followers_url":"https://api.github.com/users/guardian/followers","following_url":"https://api.github.com/users/guardian/following{/other_user}","gists_url":"https://api.github.com/users/guardian/gists{/gist_id}","starred_url":"https://api.github.com/users/guardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardian/subscriptions","organizations_url":"https://api.github.com/users/guardian/orgs","repos_url":"https://api.github.com/users/guardian/repos","events_url":"https://api.github.com/users/guardian/events{/privacy}","received_events_url":"https://api.github.com/users/guardian/received_events","type":"Organization","site_admin":false},"repo":{"id":34392023,"name":"subscriptions-frontend","full_name":"guardian/subscriptions-frontend","owner":{"login":"guardian","id":164318,"avatar_url":"https://avatars.githubusercontent.com/u/164318?v=3","gravatar_id":"","url":"https://api.github.com/users/guardian","html_url":"https://github.com/guardian","followers_url":"https://api.github.com/users/guardian/followers","following_url":"https://api.github.com/users/guardian/following{/other_user}","gists_url":"https://api.github.com/users/guardian/gists{/gist_id}","starred_url":"https://api.github.com/users/guardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardian/subscriptions","organizations_url":"https://api.github.com/users/guardian/orgs","repos_url":"https://api.github.com/users/guardian/repos","events_url":"https://api.github.com/users/guardian/events{/privacy}","received_events_url":"https://api.github.com/users/guardian/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/guardian/subscriptions-frontend","description":"","fork":false,"url":"https://api.github.com/repos/guardian/subscriptions-frontend","forks_url":"https://api.github.com/repos/guardian/subscriptions-frontend/forks","keys_url":"https://api.github.com/repos/guardian/subscriptions-frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/guardian/subscriptions-frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/guardian/subscriptions-frontend/teams","hooks_url":"https://api.github.com/repos/guardian/subscriptions-frontend/hooks","issue_events_url":"https://api.github.com/repos/guardian/subscriptions-frontend/issues/events{/number}","events_url":"https://api.github.com/repos/guardian/subscriptions-frontend/events","assignees_url":"https://api.github.com/repos/guardian/subscriptions-frontend/assignees{/user}","branches_url":"https://api.github.com/repos/guardian/subscriptions-frontend/branches{/branch}","tags_url":"https://api.github.com/repos/guardian/subscriptions-frontend/tags","blobs_url":"https://api.github.com/repos/guardian/subscriptions-frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/guardian/subscriptions-frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/guardian/subscriptions-frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/guardian/subscriptions-frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/guardian/subscriptions-frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/guardian/subscriptions-frontend/languages","stargazers_url":"https://api.github.com/repos/guardian/subscriptions-frontend/stargazers","contributors_url":"https://api.github.com/repos/guardian/subscriptions-frontend/contributors","subscribers_url":"https://api.github.com/repos/guardian/subscriptions-frontend/subscribers","subscription_url":"https://api.github.com/repos/guardian/subscriptions-frontend/subscription","commits_url":"https://api.github.com/repos/guardian/subscriptions-frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/guardian/subscriptions-frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/guardian/subscriptions-frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/guardian/subscriptions-frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/guardian/subscriptions-frontend/contents/{+path}","compare_url":"https://api.github.com/repos/guardian/subscriptions-frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/guardian/subscriptions-frontend/merges","archive_url":"https://api.github.com/repos/guardian/subscriptions-frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/guardian/subscriptions-frontend/downloads","issues_url":"https://api.github.com/repos/guardian/subscriptions-frontend/issues{/number}","pulls_url":"https://api.github.com/repos/guardian/subscriptions-frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/guardian/subscriptions-frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/guardian/subscriptions-frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/guardian/subscriptions-frontend/labels{/name}","releases_url":"https://api.github.com/repos/guardian/subscriptions-frontend/releases{/id}","created_at":"2015-04-22T13:30:13Z","updated_at":"2015-10-14T23:01:45Z","pushed_at":"2015-10-16T12:13:54Z","git_url":"git://github.com/guardian/subscriptions-frontend.git","ssh_url":"git@github.com:guardian/subscriptions-frontend.git","clone_url":"https://github.com/guardian/subscriptions-frontend.git","svn_url":"https://github.com/guardian/subscriptions-frontend","homepage":"https://sites.google.com/a/guardian.co.uk/guardian-subscriptions/","size":7012,"stargazers_count":5,"watchers_count":5,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":5,"default_branch":"master"}},"base":{"label":"guardian:master","ref":"master","sha":"56cd8360f22ca2768cfff1eb578ea2fc2c82f6eb","user":{"login":"guardian","id":164318,"avatar_url":"https://avatars.githubusercontent.com/u/164318?v=3","gravatar_id":"","url":"https://api.github.com/users/guardian","html_url":"https://github.com/guardian","followers_url":"https://api.github.com/users/guardian/followers","following_url":"https://api.github.com/users/guardian/following{/other_user}","gists_url":"https://api.github.com/users/guardian/gists{/gist_id}","starred_url":"https://api.github.com/users/guardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardian/subscriptions","organizations_url":"https://api.github.com/users/guardian/orgs","repos_url":"https://api.github.com/users/guardian/repos","events_url":"https://api.github.com/users/guardian/events{/privacy}","received_events_url":"https://api.github.com/users/guardian/received_events","type":"Organization","site_admin":false},"repo":{"id":34392023,"name":"subscriptions-frontend","full_name":"guardian/subscriptions-frontend","owner":{"login":"guardian","id":164318,"avatar_url":"https://avatars.githubusercontent.com/u/164318?v=3","gravatar_id":"","url":"https://api.github.com/users/guardian","html_url":"https://github.com/guardian","followers_url":"https://api.github.com/users/guardian/followers","following_url":"https://api.github.com/users/guardian/following{/other_user}","gists_url":"https://api.github.com/users/guardian/gists{/gist_id}","starred_url":"https://api.github.com/users/guardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardian/subscriptions","organizations_url":"https://api.github.com/users/guardian/orgs","repos_url":"https://api.github.com/users/guardian/repos","events_url":"https://api.github.com/users/guardian/events{/privacy}","received_events_url":"https://api.github.com/users/guardian/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/guardian/subscriptions-frontend","description":"","fork":false,"url":"https://api.github.com/repos/guardian/subscriptions-frontend","forks_url":"https://api.github.com/repos/guardian/subscriptions-frontend/forks","keys_url":"https://api.github.com/repos/guardian/subscriptions-frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/guardian/subscriptions-frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/guardian/subscriptions-frontend/teams","hooks_url":"https://api.github.com/repos/guardian/subscriptions-frontend/hooks","issue_events_url":"https://api.github.com/repos/guardian/subscriptions-frontend/issues/events{/number}","events_url":"https://api.github.com/repos/guardian/subscriptions-frontend/events","assignees_url":"https://api.github.com/repos/guardian/subscriptions-frontend/assignees{/user}","branches_url":"https://api.github.com/repos/guardian/subscriptions-frontend/branches{/branch}","tags_url":"https://api.github.com/repos/guardian/subscriptions-frontend/tags","blobs_url":"https://api.github.com/repos/guardian/subscriptions-frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/guardian/subscriptions-frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/guardian/subscriptions-frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/guardian/subscriptions-frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/guardian/subscriptions-frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/guardian/subscriptions-frontend/languages","stargazers_url":"https://api.github.com/repos/guardian/subscriptions-frontend/stargazers","contributors_url":"https://api.github.com/repos/guardian/subscriptions-frontend/contributors","subscribers_url":"https://api.github.com/repos/guardian/subscriptions-frontend/subscribers","subscription_url":"https://api.github.com/repos/guardian/subscriptions-frontend/subscription","commits_url":"https://api.github.com/repos/guardian/subscriptions-frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/guardian/subscriptions-frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/guardian/subscriptions-frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/guardian/subscriptions-frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/guardian/subscriptions-frontend/contents/{+path}","compare_url":"https://api.github.com/repos/guardian/subscriptions-frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/guardian/subscriptions-frontend/merges","archive_url":"https://api.github.com/repos/guardian/subscriptions-frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/guardian/subscriptions-frontend/downloads","issues_url":"https://api.github.com/repos/guardian/subscriptions-frontend/issues{/number}","pulls_url":"https://api.github.com/repos/guardian/subscriptions-frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/guardian/subscriptions-frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/guardian/subscriptions-frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/guardian/subscriptions-frontend/labels{/name}","releases_url":"https://api.github.com/repos/guardian/subscriptions-frontend/releases{/id}","created_at":"2015-04-22T13:30:13Z","updated_at":"2015-10-14T23:01:45Z","pushed_at":"2015-10-16T12:13:54Z","git_url":"git://github.com/guardian/subscriptions-frontend.git","ssh_url":"git@github.com:guardian/subscriptions-frontend.git","clone_url":"https://github.com/guardian/subscriptions-frontend.git","svn_url":"https://github.com/guardian/subscriptions-frontend","homepage":"https://sites.google.com/a/guardian.co.uk/guardian-subscriptions/","size":7012,"stargazers_count":5,"watchers_count":5,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/guardian/subscriptions-frontend/pulls/258"},"html":{"href":"https://github.com/guardian/subscriptions-frontend/pull/258"},"issue":{"href":"https://api.github.com/repos/guardian/subscriptions-frontend/issues/258"},"comments":{"href":"https://api.github.com/repos/guardian/subscriptions-frontend/issues/258/comments"},"review_comments":{"href":"https://api.github.com/repos/guardian/subscriptions-frontend/pulls/258/comments"},"review_comment":{"href":"https://api.github.com/repos/guardian/subscriptions-frontend/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/guardian/subscriptions-frontend/pulls/258/commits"},"statuses":{"href":"https://api.github.com/repos/guardian/subscriptions-frontend/statuses/068d6eeaec4485731b8211667710f212b4b5f7b4"}}}}