{"action":"created","comment":{"url":"https://api.github.com/repos/economist-components/component-ad-panel/pulls/comments/44993741","id":44993741,"diff_hunk":"@@ -76,6 +67,25 @@ export default class AdPanel extends React.Component {\n     this.cleanupEventListeners();\n   }\n \n+  getOrCreateGoogleTag() {\n+    /* global window document */\n+    if (this.props.googletag) {\n+      return this.props.googletag;\n+    } else if (typeof window !== 'undefined' && window.document &&\n+        !window.googletag) {\n+      window.googletag = { cmd: [] };\n+      const gads = document.createElement('script');\n+      gads.async = true;\n+      gads.type = 'text/javascript';\n+      const useSsl = window.location.protocol === 'https:';\n+      gads.src = `${useSsl ? 'https:' : 'http:'}//www.googletagservices.com/tag/js/gpt.js`;\n+      document.head.appendChild(gads);\n+      return window.googletag;","path":"index.es6","position":44,"original_position":44,"commit_id":"7c2b35ffd2795da2bcd7ae71d86b9c333d2593d8","original_commit_id":"7c2b35ffd2795da2bcd7ae71d86b9c333d2593d8","user":{"login":"keithamus","id":118266,"avatar_url":"https://avatars.githubusercontent.com/u/118266?v=3","gravatar_id":"","url":"https://api.github.com/users/keithamus","html_url":"https://github.com/keithamus","followers_url":"https://api.github.com/users/keithamus/followers","following_url":"https://api.github.com/users/keithamus/following{/other_user}","gists_url":"https://api.github.com/users/keithamus/gists{/gist_id}","starred_url":"https://api.github.com/users/keithamus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keithamus/subscriptions","organizations_url":"https://api.github.com/users/keithamus/orgs","repos_url":"https://api.github.com/users/keithamus/repos","events_url":"https://api.github.com/users/keithamus/events{/privacy}","received_events_url":"https://api.github.com/users/keithamus/received_events","type":"User","site_admin":false},"body":"But you call `sizeMapping()` on `window.googleTag` [here](https://github.com/economist-components/component-ad-panel/pull/23/files#diff-f4c23493b2565b38dc321b9377a0a3b8R117) which surely is never going to work.","created_at":"2015-11-16T22:24:03Z","updated_at":"2015-11-16T22:24:03Z","html_url":"https://github.com/economist-components/component-ad-panel/pull/23#discussion_r44993741","pull_request_url":"https://api.github.com/repos/economist-components/component-ad-panel/pulls/23","_links":{"self":{"href":"https://api.github.com/repos/economist-components/component-ad-panel/pulls/comments/44993741"},"html":{"href":"https://github.com/economist-components/component-ad-panel/pull/23#discussion_r44993741"},"pull_request":{"href":"https://api.github.com/repos/economist-components/component-ad-panel/pulls/23"}}},"pull_request":{"url":"https://api.github.com/repos/economist-components/component-ad-panel/pulls/23","id":50854773,"html_url":"https://github.com/economist-components/component-ad-panel/pull/23","diff_url":"https://github.com/economist-components/component-ad-panel/pull/23.diff","patch_url":"https://github.com/economist-components/component-ad-panel/pull/23.patch","issue_url":"https://api.github.com/repos/economist-components/component-ad-panel/issues/23","number":23,"state":"open","locked":false,"title":"Test googletag interaction","user":{"login":"fabiosantoscode","id":1611595,"avatar_url":"https://avatars.githubusercontent.com/u/1611595?v=3","gravatar_id":"","url":"https://api.github.com/users/fabiosantoscode","html_url":"https://github.com/fabiosantoscode","followers_url":"https://api.github.com/users/fabiosantoscode/followers","following_url":"https://api.github.com/users/fabiosantoscode/following{/other_user}","gists_url":"https://api.github.com/users/fabiosantoscode/gists{/gist_id}","starred_url":"https://api.github.com/users/fabiosantoscode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabiosantoscode/subscriptions","organizations_url":"https://api.github.com/users/fabiosantoscode/orgs","repos_url":"https://api.github.com/users/fabiosantoscode/repos","events_url":"https://api.github.com/users/fabiosantoscode/events{/privacy}","received_events_url":"https://api.github.com/users/fabiosantoscode/received_events","type":"User","site_admin":false},"body":"This starts testing that googletag properly works, by passing a fake googletag with a (metric) ton of spies.","created_at":"2015-11-16T19:35:41Z","updated_at":"2015-11-16T22:24:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c1ef6d929e613395d28313ccac24b58f0e2e7d60","assignee":{"login":"keithamus","id":118266,"avatar_url":"https://avatars.githubusercontent.com/u/118266?v=3","gravatar_id":"","url":"https://api.github.com/users/keithamus","html_url":"https://github.com/keithamus","followers_url":"https://api.github.com/users/keithamus/followers","following_url":"https://api.github.com/users/keithamus/following{/other_user}","gists_url":"https://api.github.com/users/keithamus/gists{/gist_id}","starred_url":"https://api.github.com/users/keithamus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keithamus/subscriptions","organizations_url":"https://api.github.com/users/keithamus/orgs","repos_url":"https://api.github.com/users/keithamus/repos","events_url":"https://api.github.com/users/keithamus/events{/privacy}","received_events_url":"https://api.github.com/users/keithamus/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/economist-components/component-ad-panel/pulls/23/commits","review_comments_url":"https://api.github.com/repos/economist-components/component-ad-panel/pulls/23/comments","review_comment_url":"https://api.github.com/repos/economist-components/component-ad-panel/pulls/comments{/number}","comments_url":"https://api.github.com/repos/economist-components/component-ad-panel/issues/23/comments","statuses_url":"https://api.github.com/repos/economist-components/component-ad-panel/statuses/7c2b35ffd2795da2bcd7ae71d86b9c333d2593d8","head":{"label":"fabiosantoscode:master","ref":"master","sha":"7c2b35ffd2795da2bcd7ae71d86b9c333d2593d8","user":{"login":"fabiosantoscode","id":1611595,"avatar_url":"https://avatars.githubusercontent.com/u/1611595?v=3","gravatar_id":"","url":"https://api.github.com/users/fabiosantoscode","html_url":"https://github.com/fabiosantoscode","followers_url":"https://api.github.com/users/fabiosantoscode/followers","following_url":"https://api.github.com/users/fabiosantoscode/following{/other_user}","gists_url":"https://api.github.com/users/fabiosantoscode/gists{/gist_id}","starred_url":"https://api.github.com/users/fabiosantoscode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabiosantoscode/subscriptions","organizations_url":"https://api.github.com/users/fabiosantoscode/orgs","repos_url":"https://api.github.com/users/fabiosantoscode/repos","events_url":"https://api.github.com/users/fabiosantoscode/events{/privacy}","received_events_url":"https://api.github.com/users/fabiosantoscode/received_events","type":"User","site_admin":false},"repo":{"id":43806475,"name":"component-animatedpanel","full_name":"fabiosantoscode/component-animatedpanel","owner":{"login":"fabiosantoscode","id":1611595,"avatar_url":"https://avatars.githubusercontent.com/u/1611595?v=3","gravatar_id":"","url":"https://api.github.com/users/fabiosantoscode","html_url":"https://github.com/fabiosantoscode","followers_url":"https://api.github.com/users/fabiosantoscode/followers","following_url":"https://api.github.com/users/fabiosantoscode/following{/other_user}","gists_url":"https://api.github.com/users/fabiosantoscode/gists{/gist_id}","starred_url":"https://api.github.com/users/fabiosantoscode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabiosantoscode/subscriptions","organizations_url":"https://api.github.com/users/fabiosantoscode/orgs","repos_url":"https://api.github.com/users/fabiosantoscode/repos","events_url":"https://api.github.com/users/fabiosantoscode/events{/privacy}","received_events_url":"https://api.github.com/users/fabiosantoscode/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fabiosantoscode/component-animatedpanel","description":"simple panel component that animates when scrolled in view","fork":true,"url":"https://api.github.com/repos/fabiosantoscode/component-animatedpanel","forks_url":"https://api.github.com/repos/fabiosantoscode/component-animatedpanel/forks","keys_url":"https://api.github.com/repos/fabiosantoscode/component-animatedpanel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fabiosantoscode/component-animatedpanel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fabiosantoscode/component-animatedpanel/teams","hooks_url":"https://api.github.com/repos/fabiosantoscode/component-animatedpanel/hooks","issue_events_url":"https://api.github.com/repos/fabiosantoscode/component-animatedpanel/issues/events{/number}","events_url":"https://api.github.com/repos/fabiosantoscode/component-animatedpanel/events","assignees_url":"https://api.github.com/repos/fabiosantoscode/component-animatedpanel/assignees{/user}","branches_url":"https://api.github.com/repos/fabiosantoscode/component-animatedpanel/branches{/branch}","tags_url":"https://api.github.com/repos/fabiosantoscode/component-animatedpanel/tags","blobs_url":"https://api.github.com/repos/fabiosantoscode/component-animatedpanel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fabiosantoscode/component-animatedpanel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fabiosantoscode/component-animatedpanel/git/refs{/sha}","trees_url":"https://api.github.com/repos/fabiosantoscode/component-animatedpanel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fabiosantoscode/component-animatedpanel/statuses/{sha}","languages_url":"https://api.github.com/repos/fabiosantoscode/component-animatedpanel/languages","stargazers_url":"https://api.github.com/repos/fabiosantoscode/component-animatedpanel/stargazers","contributors_url":"https://api.github.com/repos/fabiosantoscode/component-animatedpanel/contributors","subscribers_url":"https://api.github.com/repos/fabiosantoscode/component-animatedpanel/subscribers","subscription_url":"https://api.github.com/repos/fabiosantoscode/component-animatedpanel/subscription","commits_url":"https://api.github.com/repos/fabiosantoscode/component-animatedpanel/commits{/sha}","git_commits_url":"https://api.github.com/repos/fabiosantoscode/component-animatedpanel/git/commits{/sha}","comments_url":"https://api.github.com/repos/fabiosantoscode/component-animatedpanel/comments{/number}","issue_comment_url":"https://api.github.com/repos/fabiosantoscode/component-animatedpanel/issues/comments{/number}","contents_url":"https://api.github.com/repos/fabiosantoscode/component-animatedpanel/contents/{+path}","compare_url":"https://api.github.com/repos/fabiosantoscode/component-animatedpanel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fabiosantoscode/component-animatedpanel/merges","archive_url":"https://api.github.com/repos/fabiosantoscode/component-animatedpanel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fabiosantoscode/component-animatedpanel/downloads","issues_url":"https://api.github.com/repos/fabiosantoscode/component-animatedpanel/issues{/number}","pulls_url":"https://api.github.com/repos/fabiosantoscode/component-animatedpanel/pulls{/number}","milestones_url":"https://api.github.com/repos/fabiosantoscode/component-animatedpanel/milestones{/number}","notifications_url":"https://api.github.com/repos/fabiosantoscode/component-animatedpanel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fabiosantoscode/component-animatedpanel/labels{/name}","releases_url":"https://api.github.com/repos/fabiosantoscode/component-animatedpanel/releases{/id}","created_at":"2015-10-07T09:33:18Z","updated_at":"2015-10-07T09:33:18Z","pushed_at":"2015-11-16T19:33:44Z","git_url":"git://github.com/fabiosantoscode/component-animatedpanel.git","ssh_url":"git@github.com:fabiosantoscode/component-animatedpanel.git","clone_url":"https://github.com/fabiosantoscode/component-animatedpanel.git","svn_url":"https://github.com/fabiosantoscode/component-animatedpanel","homepage":"","size":822,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"economist-components:master","ref":"master","sha":"e0a3e4bdb1e90eb5dd1d704db75aa5a35f9efb0a","user":{"login":"economist-components","id":14197671,"avatar_url":"https://avatars.githubusercontent.com/u/14197671?v=3","gravatar_id":"","url":"https://api.github.com/users/economist-components","html_url":"https://github.com/economist-components","followers_url":"https://api.github.com/users/economist-components/followers","following_url":"https://api.github.com/users/economist-components/following{/other_user}","gists_url":"https://api.github.com/users/economist-components/gists{/gist_id}","starred_url":"https://api.github.com/users/economist-components/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/economist-components/subscriptions","organizations_url":"https://api.github.com/users/economist-components/orgs","repos_url":"https://api.github.com/users/economist-components/repos","events_url":"https://api.github.com/users/economist-components/events{/privacy}","received_events_url":"https://api.github.com/users/economist-components/received_events","type":"Organization","site_admin":false},"repo":{"id":38681489,"name":"component-ad-panel","full_name":"economist-components/component-ad-panel","owner":{"login":"economist-components","id":14197671,"avatar_url":"https://avatars.githubusercontent.com/u/14197671?v=3","gravatar_id":"","url":"https://api.github.com/users/economist-components","html_url":"https://github.com/economist-components","followers_url":"https://api.github.com/users/economist-components/followers","following_url":"https://api.github.com/users/economist-components/following{/other_user}","gists_url":"https://api.github.com/users/economist-components/gists{/gist_id}","starred_url":"https://api.github.com/users/economist-components/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/economist-components/subscriptions","organizations_url":"https://api.github.com/users/economist-components/orgs","repos_url":"https://api.github.com/users/economist-components/repos","events_url":"https://api.github.com/users/economist-components/events{/privacy}","received_events_url":"https://api.github.com/users/economist-components/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/economist-components/component-ad-panel","description":"simple panel component that animates when scrolled in view","fork":false,"url":"https://api.github.com/repos/economist-components/component-ad-panel","forks_url":"https://api.github.com/repos/economist-components/component-ad-panel/forks","keys_url":"https://api.github.com/repos/economist-components/component-ad-panel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/economist-components/component-ad-panel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/economist-components/component-ad-panel/teams","hooks_url":"https://api.github.com/repos/economist-components/component-ad-panel/hooks","issue_events_url":"https://api.github.com/repos/economist-components/component-ad-panel/issues/events{/number}","events_url":"https://api.github.com/repos/economist-components/component-ad-panel/events","assignees_url":"https://api.github.com/repos/economist-components/component-ad-panel/assignees{/user}","branches_url":"https://api.github.com/repos/economist-components/component-ad-panel/branches{/branch}","tags_url":"https://api.github.com/repos/economist-components/component-ad-panel/tags","blobs_url":"https://api.github.com/repos/economist-components/component-ad-panel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/economist-components/component-ad-panel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/economist-components/component-ad-panel/git/refs{/sha}","trees_url":"https://api.github.com/repos/economist-components/component-ad-panel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/economist-components/component-ad-panel/statuses/{sha}","languages_url":"https://api.github.com/repos/economist-components/component-ad-panel/languages","stargazers_url":"https://api.github.com/repos/economist-components/component-ad-panel/stargazers","contributors_url":"https://api.github.com/repos/economist-components/component-ad-panel/contributors","subscribers_url":"https://api.github.com/repos/economist-components/component-ad-panel/subscribers","subscription_url":"https://api.github.com/repos/economist-components/component-ad-panel/subscription","commits_url":"https://api.github.com/repos/economist-components/component-ad-panel/commits{/sha}","git_commits_url":"https://api.github.com/repos/economist-components/component-ad-panel/git/commits{/sha}","comments_url":"https://api.github.com/repos/economist-components/component-ad-panel/comments{/number}","issue_comment_url":"https://api.github.com/repos/economist-components/component-ad-panel/issues/comments{/number}","contents_url":"https://api.github.com/repos/economist-components/component-ad-panel/contents/{+path}","compare_url":"https://api.github.com/repos/economist-components/component-ad-panel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/economist-components/component-ad-panel/merges","archive_url":"https://api.github.com/repos/economist-components/component-ad-panel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/economist-components/component-ad-panel/downloads","issues_url":"https://api.github.com/repos/economist-components/component-ad-panel/issues{/number}","pulls_url":"https://api.github.com/repos/economist-components/component-ad-panel/pulls{/number}","milestones_url":"https://api.github.com/repos/economist-components/component-ad-panel/milestones{/number}","notifications_url":"https://api.github.com/repos/economist-components/component-ad-panel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/economist-components/component-ad-panel/labels{/name}","releases_url":"https://api.github.com/repos/economist-components/component-ad-panel/releases{/id}","created_at":"2015-07-07T10:45:28Z","updated_at":"2015-11-10T14:58:30Z","pushed_at":"2015-11-16T19:35:41Z","git_url":"git://github.com/economist-components/component-ad-panel.git","ssh_url":"git@github.com:economist-components/component-ad-panel.git","clone_url":"https://github.com/economist-components/component-ad-panel.git","svn_url":"https://github.com/economist-components/component-ad-panel","homepage":"","size":434,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":2,"mirror_url":null,"open_issues_count":2,"forks":2,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/economist-components/component-ad-panel/pulls/23"},"html":{"href":"https://github.com/economist-components/component-ad-panel/pull/23"},"issue":{"href":"https://api.github.com/repos/economist-components/component-ad-panel/issues/23"},"comments":{"href":"https://api.github.com/repos/economist-components/component-ad-panel/issues/23/comments"},"review_comments":{"href":"https://api.github.com/repos/economist-components/component-ad-panel/pulls/23/comments"},"review_comment":{"href":"https://api.github.com/repos/economist-components/component-ad-panel/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/economist-components/component-ad-panel/pulls/23/commits"},"statuses":{"href":"https://api.github.com/repos/economist-components/component-ad-panel/statuses/7c2b35ffd2795da2bcd7ae71d86b9c333d2593d8"}}}}