{"action":"created","comment":{"url":"https://api.github.com/repos/guardian/frontend/pulls/comments/76051323","id":76051323,"diff_hunk":"@@ -0,0 +1,124 @@\n+define([\n+    'bean',\n+    'qwery',\n+    'common/utils/$',\n+    'common/utils/template',\n+    'common/views/svg',\n+    'common/utils/fastdom-promise',\n+    'common/utils/mediator',\n+    'text!common/views/contributions-embed.html',\n+    'common/utils/robust',\n+    'text!common/views/giraffe-message.html',\n+    'inlineSvg!svgs/icon/arrow-right'\n+\n+], function (bean,\n+             qwery,\n+             $,\n+             template,\n+             svg,\n+             fastdom,\n+             mediator,\n+             contributionsEmbed,\n+             robust,\n+             giraffeMessage,\n+             arrowRight\n+) {\n+\n+\n+    return function () {\n+\n+        this.id = 'ContributionsEmbed20160823';\n+        this.start = '2016-08-23';\n+        this.expiry = '2016-08-30';\n+        this.author = 'Jonathan Rankin';\n+        this.description = 'Test contributions embed with amount picker.';\n+        this.showForSensitive = false;\n+        this.audience = 0.10;\n+        this.audienceOffset = 0.13;\n+        this.successMeasure = 'Impressions to number of contributions';\n+        this.audienceCriteria = 'All users';\n+        this.dataLinkNames = '';\n+        this.idealOutcome = 'The interactive embed performs 3x better than the control';\n+        this.canRun = function () {\n+            var pageObj = window.guardian.config.page;\n+            return !(pageObj.isSensitive || pageObj.isLiveBlog || pageObj.isFront || pageObj.isAdvertisementFeature) && pageObj.edition === 'UK';\n+        };\n+\n+\n+        var writer = function (component) {\n+\n+            return fastdom.write(function () {\n+                var a = $('.submeta');\n+                component.insertBefore(a);\n+                mediator.emit('contributions-embed:insert');\n+            });\n+\n+        };\n+\n+        var interactiveCompleter = function (complete) {\n+            mediator.on('contributions-embed:insert', function () {\n+                qwery('figure.interactive.contribute-embed').forEach(function (el) {\n+                    require([el.getAttribute('data-interactive')], function (interactive) {\n+                        robust.catchErrorsAndLog('interactive-bootstrap', function () {\n+                            interactive.boot(el, document, window.guardian.config, mediator);","path":"static/src/javascripts/projects/common/modules/experiments/tests/contributions-embed.js","position":63,"original_position":63,"commit_id":"97f572bc740a98210549ae31e5fb94a22432aa4a","original_commit_id":"97f572bc740a98210549ae31e5fb94a22432aa4a","user":{"login":"gtrufitt","id":638051,"avatar_url":"https://avatars.githubusercontent.com/u/638051?v=3","gravatar_id":"","url":"https://api.github.com/users/gtrufitt","html_url":"https://github.com/gtrufitt","followers_url":"https://api.github.com/users/gtrufitt/followers","following_url":"https://api.github.com/users/gtrufitt/following{/other_user}","gists_url":"https://api.github.com/users/gtrufitt/gists{/gist_id}","starred_url":"https://api.github.com/users/gtrufitt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gtrufitt/subscriptions","organizations_url":"https://api.github.com/users/gtrufitt/orgs","repos_url":"https://api.github.com/users/gtrufitt/repos","events_url":"https://api.github.com/users/gtrufitt/events{/privacy}","received_events_url":"https://api.github.com/users/gtrufitt/received_events","type":"User","site_admin":false},"body":"If possible, same here with passing config object from util rather than window","created_at":"2016-08-24T13:01:03Z","updated_at":"2016-08-24T13:01:03Z","html_url":"https://github.com/guardian/frontend/pull/14090#discussion_r76051323","pull_request_url":"https://api.github.com/repos/guardian/frontend/pulls/14090","_links":{"self":{"href":"https://api.github.com/repos/guardian/frontend/pulls/comments/76051323"},"html":{"href":"https://github.com/guardian/frontend/pull/14090#discussion_r76051323"},"pull_request":{"href":"https://api.github.com/repos/guardian/frontend/pulls/14090"}}},"pull_request":{"url":"https://api.github.com/repos/guardian/frontend/pulls/14090","id":82360684,"html_url":"https://github.com/guardian/frontend/pull/14090","diff_url":"https://github.com/guardian/frontend/pull/14090.diff","patch_url":"https://github.com/guardian/frontend/pull/14090.patch","issue_url":"https://api.github.com/repos/guardian/frontend/issues/14090","number":14090,"state":"open","locked":false,"title":"Contributions embed abtest","user":{"login":"jranks123","id":2844554,"avatar_url":"https://avatars.githubusercontent.com/u/2844554?v=3","gravatar_id":"","url":"https://api.github.com/users/jranks123","html_url":"https://github.com/jranks123","followers_url":"https://api.github.com/users/jranks123/followers","following_url":"https://api.github.com/users/jranks123/following{/other_user}","gists_url":"https://api.github.com/users/jranks123/gists{/gist_id}","starred_url":"https://api.github.com/users/jranks123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jranks123/subscriptions","organizations_url":"https://api.github.com/users/jranks123/orgs","repos_url":"https://api.github.com/users/jranks123/repos","events_url":"https://api.github.com/users/jranks123/events{/privacy}","received_events_url":"https://api.github.com/users/jranks123/received_events","type":"User","site_admin":false},"body":"## What does this change?\r\nThis is a test which adds the contributions interactive embed at the end of articles. This embed is inserted as an interactive. The way it is implemented is as follows:\r\n\r\n1. If the user is in the test, insert the following <figure> element to the end of the article, which is invisible until explicitly rendered: \r\n2. Run a script which looks for this specific interactive and renders it. \r\n\r\nWhat makes this contributions ad different from those previous is that it asks the user to select their contribution amount in the ad itself, which propagates through to the contributions form \r\n\r\n## What is the value of this and can you measure success?\r\nThe value is we can evaluate the effectiveness of asking for the contribution amount in the ad. We are measuring the success by looking at the impression to contribution rate. \r\n\r\n## Does this affect other platforms - Amp, Apps, etc?\r\nNo\r\n\r\n## Screenshots\r\n\r\nThe embed on desktop\r\n\r\n![screenshot at aug 23 13-55-02](https://cloud.githubusercontent.com/assets/2844554/17892688/7c993286-693a-11e6-8f36-f3ca8aab8223.png)\r\n\r\n\r\n\r\nThe embed on mobile\r\n![screenshot at aug 23 13-59-13](https://cloud.githubusercontent.com/assets/2844554/17892690/7e8941c6-693a-11e6-9ea7-e06617f74370.png)\r\n\r\n\r\nNote: the design is set to change, but this doesn't affect this pull request as the interactive embed is built and deployed separately from frontend. \r\n\r\n\r\n## Request for comment\r\n\r\n<!--\r\n*Does this PR meet the [contributing guidelines](https://github.com/guardian/frontend/blob/issue_pr_templates/.github/CONTRIBUTING.md#submission)?*\r\n-->","created_at":"2016-08-23T13:05:27Z","updated_at":"2016-08-24T13:01:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1fdf0cc94c51922ee857b74d26f7bea1a0309c5b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/guardian/frontend/pulls/14090/commits","review_comments_url":"https://api.github.com/repos/guardian/frontend/pulls/14090/comments","review_comment_url":"https://api.github.com/repos/guardian/frontend/pulls/comments{/number}","comments_url":"https://api.github.com/repos/guardian/frontend/issues/14090/comments","statuses_url":"https://api.github.com/repos/guardian/frontend/statuses/97f572bc740a98210549ae31e5fb94a22432aa4a","head":{"label":"guardian:contributions-embed-abtest","ref":"contributions-embed-abtest","sha":"97f572bc740a98210549ae31e5fb94a22432aa4a","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":4370755,"name":"frontend","full_name":"guardian/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/frontend","description":"Source for theguardian.com","fork":false,"url":"https://api.github.com/repos/guardian/frontend","forks_url":"https://api.github.com/repos/guardian/frontend/forks","keys_url":"https://api.github.com/repos/guardian/frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/guardian/frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/guardian/frontend/teams","hooks_url":"https://api.github.com/repos/guardian/frontend/hooks","issue_events_url":"https://api.github.com/repos/guardian/frontend/issues/events{/number}","events_url":"https://api.github.com/repos/guardian/frontend/events","assignees_url":"https://api.github.com/repos/guardian/frontend/assignees{/user}","branches_url":"https://api.github.com/repos/guardian/frontend/branches{/branch}","tags_url":"https://api.github.com/repos/guardian/frontend/tags","blobs_url":"https://api.github.com/repos/guardian/frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/guardian/frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/guardian/frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/guardian/frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/guardian/frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/guardian/frontend/languages","stargazers_url":"https://api.github.com/repos/guardian/frontend/stargazers","contributors_url":"https://api.github.com/repos/guardian/frontend/contributors","subscribers_url":"https://api.github.com/repos/guardian/frontend/subscribers","subscription_url":"https://api.github.com/repos/guardian/frontend/subscription","commits_url":"https://api.github.com/repos/guardian/frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/guardian/frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/guardian/frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/guardian/frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/guardian/frontend/contents/{+path}","compare_url":"https://api.github.com/repos/guardian/frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/guardian/frontend/merges","archive_url":"https://api.github.com/repos/guardian/frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/guardian/frontend/downloads","issues_url":"https://api.github.com/repos/guardian/frontend/issues{/number}","pulls_url":"https://api.github.com/repos/guardian/frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/guardian/frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/guardian/frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/guardian/frontend/labels{/name}","releases_url":"https://api.github.com/repos/guardian/frontend/releases{/id}","deployments_url":"https://api.github.com/repos/guardian/frontend/deployments","created_at":"2012-05-18T15:39:15Z","updated_at":"2016-08-23T11:35:08Z","pushed_at":"2016-08-24T12:45:44Z","git_url":"git://github.com/guardian/frontend.git","ssh_url":"git@github.com:guardian/frontend.git","clone_url":"https://github.com/guardian/frontend.git","svn_url":"https://github.com/guardian/frontend","homepage":"http://www.theguardian.com","size":522489,"stargazers_count":3279,"watchers_count":3279,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":340,"mirror_url":null,"open_issues_count":46,"forks":340,"open_issues":46,"watchers":3279,"default_branch":"master"}},"base":{"label":"guardian:master","ref":"master","sha":"520718aa014e448a127e3428f91731335022f91c","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":4370755,"name":"frontend","full_name":"guardian/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/frontend","description":"Source for theguardian.com","fork":false,"url":"https://api.github.com/repos/guardian/frontend","forks_url":"https://api.github.com/repos/guardian/frontend/forks","keys_url":"https://api.github.com/repos/guardian/frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/guardian/frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/guardian/frontend/teams","hooks_url":"https://api.github.com/repos/guardian/frontend/hooks","issue_events_url":"https://api.github.com/repos/guardian/frontend/issues/events{/number}","events_url":"https://api.github.com/repos/guardian/frontend/events","assignees_url":"https://api.github.com/repos/guardian/frontend/assignees{/user}","branches_url":"https://api.github.com/repos/guardian/frontend/branches{/branch}","tags_url":"https://api.github.com/repos/guardian/frontend/tags","blobs_url":"https://api.github.com/repos/guardian/frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/guardian/frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/guardian/frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/guardian/frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/guardian/frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/guardian/frontend/languages","stargazers_url":"https://api.github.com/repos/guardian/frontend/stargazers","contributors_url":"https://api.github.com/repos/guardian/frontend/contributors","subscribers_url":"https://api.github.com/repos/guardian/frontend/subscribers","subscription_url":"https://api.github.com/repos/guardian/frontend/subscription","commits_url":"https://api.github.com/repos/guardian/frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/guardian/frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/guardian/frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/guardian/frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/guardian/frontend/contents/{+path}","compare_url":"https://api.github.com/repos/guardian/frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/guardian/frontend/merges","archive_url":"https://api.github.com/repos/guardian/frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/guardian/frontend/downloads","issues_url":"https://api.github.com/repos/guardian/frontend/issues{/number}","pulls_url":"https://api.github.com/repos/guardian/frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/guardian/frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/guardian/frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/guardian/frontend/labels{/name}","releases_url":"https://api.github.com/repos/guardian/frontend/releases{/id}","deployments_url":"https://api.github.com/repos/guardian/frontend/deployments","created_at":"2012-05-18T15:39:15Z","updated_at":"2016-08-23T11:35:08Z","pushed_at":"2016-08-24T12:45:44Z","git_url":"git://github.com/guardian/frontend.git","ssh_url":"git@github.com:guardian/frontend.git","clone_url":"https://github.com/guardian/frontend.git","svn_url":"https://github.com/guardian/frontend","homepage":"http://www.theguardian.com","size":522489,"stargazers_count":3279,"watchers_count":3279,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":340,"mirror_url":null,"open_issues_count":46,"forks":340,"open_issues":46,"watchers":3279,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/guardian/frontend/pulls/14090"},"html":{"href":"https://github.com/guardian/frontend/pull/14090"},"issue":{"href":"https://api.github.com/repos/guardian/frontend/issues/14090"},"comments":{"href":"https://api.github.com/repos/guardian/frontend/issues/14090/comments"},"review_comments":{"href":"https://api.github.com/repos/guardian/frontend/pulls/14090/comments"},"review_comment":{"href":"https://api.github.com/repos/guardian/frontend/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/guardian/frontend/pulls/14090/commits"},"statuses":{"href":"https://api.github.com/repos/guardian/frontend/statuses/97f572bc740a98210549ae31e5fb94a22432aa4a"}}}}
{"actor":{"display_login":"gtrufitt"}}