{"action":"created","comment":{"url":"https://api.github.com/repos/ampproject/amp-by-example/pulls/comments/72037669","id":72037669,"diff_hunk":"@@ -0,0 +1,80 @@\n+<!---{\n+    \"experiment\": true,\n+    \"component\": \"amp-experiment\"\n+  }--->\n+<!-- \n+  #### Introduction\n+\n+  [amp-experiment](https://github.com/ampproject/amphtml/blob/master/extensions/amp-experiment/amp-experiment.md) allows to perform user experience experiments on an AMP document and collect resulting data.\n+-->\n+<!-- -->\n+<!doctype html>\n+<html ⚡>\n+<head>\n+  <meta charset=\"utf-8\">\n+  <link rel=\"canonical\" href=\"https://ampbyexample.com/components/amp-img/\">\n+  <meta name=\"viewport\" content=\"width=device-width,minimum-scale=1,initial-scale=1\">\n+  <style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>\n+  <script async src=\"https://cdn.ampproject.org/v0.js\"></script>\n+   <!-- #### Setup -->\n+  <!--\n+    Import the library.\n+  -->\n+  <script async custom-element=\"amp-experiment\" src=\"https://cdn.ampproject.org/v0/amp-experiment-0.1.js\"></script>\n+  <!--\n+    Style different variants of the experiment by using `body[amp-x-name-of-experiment=\"nameOfVariant\"`].\n+  -->\n+  <style amp-custom>\n+    body[amp-x-button-color-experiment=\"yellow\"] .test-button{\n+      background-color: yellow;\n+      color: black;\n+    }\n+    body[amp-x-button-color-experiment=\"red\"] .test-button{\n+      background-color: red;\n+    }\n+    body[amp-x-button-color-experiment=\"blue\"] .test-button{\n+      background-color: blue;\n+    }\n+  </style>\n+</head>\n+<body>\n+\n+  <!-- #### Basic Usage -->\n+  <!--\n+    Configure the experiment realized with `amp-experiment` with a JSON object. Use `variants` within each experiment to declare how many users will be part of an experiment variant. The total sum of the variants must be a number <= 100, if the number is < 100, then the default behaviour is used. An user belongs to one of the variants based on a random number generated between 0 and 100. For more details about variants read the official [documentation](https://github.com/ampproject/amphtml/blob/master/extensions/amp-experiment/amp-experiment.md). Multiple experiments can be run on the same AMP document in parallel with their own sets of variants. One AMP document can have at most one `amp-experiment` element.\n+  -->\n+  <amp-experiment>\n+    <script type=\"application/json\">\n+      {\n+        \"button-color-experiment\": {\n+          \"variants\": {\n+            \"yellow\": 30,\n+            \"red\": 30,\n+            \"blue\": 30\n+          }\n+        }\n+      }\n+    </script>\n+  </amp-experiment>\n+</amp-experiment>\n+<!--\n+  An experimental button. The background of the button is going to be yellow for the 30% of users, red for 30% of users, blue for 30% of users and, for the remaining 10% of users, the button background is going to be the default color.\n+-->\n+<button class= \"button button-primary test-button\" target=\"_blank\">Click here</button>\n+\n+<!-- #### Reporting -->\n+\n+<!--\n+  Measure results of the experiment using [amp-pixel](https://github.com/ampproject/amphtml/blob/master/builtins/amp-pixel.md). Allocated variants are available as a URL substitution variable: `VARIANT(name-of-the-experiment)`.\n+-->\n+<amp-pixel src=\"https://ampbyexample.com/components/amp-experiment?xname=button-color-experiment&xvar=VARIANT(button-color-experiment)\"></amp-pixel>\n+\n+<!-- #### Development tip -->\n+<!--\n+  You can force an experiment to be in a specific variant by adding `amp-x-experiment-name` to the AMP page URL. \n+-->\n+<a href=\"#amp-x-button-color-experiment=red\" target=\"_blank\">Click here to force the background color of the button to red</a>","path":"src/20_Components/amp-experiment.html","position":76,"original_position":76,"commit_id":"b8e4123bd3bcb4882f328767596df1b6cc62d3ee","original_commit_id":"b8e4123bd3bcb4882f328767596df1b6cc62d3ee","user":{"login":"sebastianbenz","id":380472,"avatar_url":"https://avatars.githubusercontent.com/u/380472?v=3","gravatar_id":"","url":"https://api.github.com/users/sebastianbenz","html_url":"https://github.com/sebastianbenz","followers_url":"https://api.github.com/users/sebastianbenz/followers","following_url":"https://api.github.com/users/sebastianbenz/following{/other_user}","gists_url":"https://api.github.com/users/sebastianbenz/gists{/gist_id}","starred_url":"https://api.github.com/users/sebastianbenz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebastianbenz/subscriptions","organizations_url":"https://api.github.com/users/sebastianbenz/orgs","repos_url":"https://api.github.com/users/sebastianbenz/repos","events_url":"https://api.github.com/users/sebastianbenz/events{/privacy}","received_events_url":"https://api.github.com/users/sebastianbenz/received_events","type":"User","site_admin":false},"body":"don't use  target=\"_blank\"","created_at":"2016-07-25T09:58:32Z","updated_at":"2016-07-25T09:58:32Z","html_url":"https://github.com/ampproject/amp-by-example/pull/280#discussion_r72037669","pull_request_url":"https://api.github.com/repos/ampproject/amp-by-example/pulls/280","_links":{"self":{"href":"https://api.github.com/repos/ampproject/amp-by-example/pulls/comments/72037669"},"html":{"href":"https://github.com/ampproject/amp-by-example/pull/280#discussion_r72037669"},"pull_request":{"href":"https://api.github.com/repos/ampproject/amp-by-example/pulls/280"}}},"pull_request":{"url":"https://api.github.com/repos/ampproject/amp-by-example/pulls/280","id":78593372,"html_url":"https://github.com/ampproject/amp-by-example/pull/280","diff_url":"https://github.com/ampproject/amp-by-example/pull/280.diff","patch_url":"https://github.com/ampproject/amp-by-example/pull/280.patch","issue_url":"https://api.github.com/repos/ampproject/amp-by-example/issues/280","number":280,"state":"open","locked":false,"title":"Add example for amp-experiment","user":{"login":"kul3r4","id":820891,"avatar_url":"https://avatars.githubusercontent.com/u/820891?v=3","gravatar_id":"","url":"https://api.github.com/users/kul3r4","html_url":"https://github.com/kul3r4","followers_url":"https://api.github.com/users/kul3r4/followers","following_url":"https://api.github.com/users/kul3r4/following{/other_user}","gists_url":"https://api.github.com/users/kul3r4/gists{/gist_id}","starred_url":"https://api.github.com/users/kul3r4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kul3r4/subscriptions","organizations_url":"https://api.github.com/users/kul3r4/orgs","repos_url":"https://api.github.com/users/kul3r4/repos","events_url":"https://api.github.com/users/kul3r4/events{/privacy}","received_events_url":"https://api.github.com/users/kul3r4/received_events","type":"User","site_admin":false},"body":"This is a sample for [amp-experiment](https://github.com/ampproject/amphtml/blob/master/extensions/amp-experiment/amp-experiment.md).\r\nThis does not use the sticky user feature, we can create a different example using it later.\r\n@sebastianbenz PTAL","created_at":"2016-07-24T08:58:03Z","updated_at":"2016-07-25T09:58:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5760abad4f0da21d4cf8df4f54cf80ca307bded7","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ampproject/amp-by-example/pulls/280/commits","review_comments_url":"https://api.github.com/repos/ampproject/amp-by-example/pulls/280/comments","review_comment_url":"https://api.github.com/repos/ampproject/amp-by-example/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ampproject/amp-by-example/issues/280/comments","statuses_url":"https://api.github.com/repos/ampproject/amp-by-example/statuses/b8e4123bd3bcb4882f328767596df1b6cc62d3ee","head":{"label":"kul3r4:amp-experiment-sample","ref":"amp-experiment-sample","sha":"b8e4123bd3bcb4882f328767596df1b6cc62d3ee","user":{"login":"kul3r4","id":820891,"avatar_url":"https://avatars.githubusercontent.com/u/820891?v=3","gravatar_id":"","url":"https://api.github.com/users/kul3r4","html_url":"https://github.com/kul3r4","followers_url":"https://api.github.com/users/kul3r4/followers","following_url":"https://api.github.com/users/kul3r4/following{/other_user}","gists_url":"https://api.github.com/users/kul3r4/gists{/gist_id}","starred_url":"https://api.github.com/users/kul3r4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kul3r4/subscriptions","organizations_url":"https://api.github.com/users/kul3r4/orgs","repos_url":"https://api.github.com/users/kul3r4/repos","events_url":"https://api.github.com/users/kul3r4/events{/privacy}","received_events_url":"https://api.github.com/users/kul3r4/received_events","type":"User","site_admin":false},"repo":{"id":52002202,"name":"amp-by-example","full_name":"kul3r4/amp-by-example","owner":{"login":"kul3r4","id":820891,"avatar_url":"https://avatars.githubusercontent.com/u/820891?v=3","gravatar_id":"","url":"https://api.github.com/users/kul3r4","html_url":"https://github.com/kul3r4","followers_url":"https://api.github.com/users/kul3r4/followers","following_url":"https://api.github.com/users/kul3r4/following{/other_user}","gists_url":"https://api.github.com/users/kul3r4/gists{/gist_id}","starred_url":"https://api.github.com/users/kul3r4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kul3r4/subscriptions","organizations_url":"https://api.github.com/users/kul3r4/orgs","repos_url":"https://api.github.com/users/kul3r4/repos","events_url":"https://api.github.com/users/kul3r4/events{/privacy}","received_events_url":"https://api.github.com/users/kul3r4/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kul3r4/amp-by-example","description":"Accelerated Mobile Pages in Action","fork":true,"url":"https://api.github.com/repos/kul3r4/amp-by-example","forks_url":"https://api.github.com/repos/kul3r4/amp-by-example/forks","keys_url":"https://api.github.com/repos/kul3r4/amp-by-example/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kul3r4/amp-by-example/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kul3r4/amp-by-example/teams","hooks_url":"https://api.github.com/repos/kul3r4/amp-by-example/hooks","issue_events_url":"https://api.github.com/repos/kul3r4/amp-by-example/issues/events{/number}","events_url":"https://api.github.com/repos/kul3r4/amp-by-example/events","assignees_url":"https://api.github.com/repos/kul3r4/amp-by-example/assignees{/user}","branches_url":"https://api.github.com/repos/kul3r4/amp-by-example/branches{/branch}","tags_url":"https://api.github.com/repos/kul3r4/amp-by-example/tags","blobs_url":"https://api.github.com/repos/kul3r4/amp-by-example/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kul3r4/amp-by-example/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kul3r4/amp-by-example/git/refs{/sha}","trees_url":"https://api.github.com/repos/kul3r4/amp-by-example/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kul3r4/amp-by-example/statuses/{sha}","languages_url":"https://api.github.com/repos/kul3r4/amp-by-example/languages","stargazers_url":"https://api.github.com/repos/kul3r4/amp-by-example/stargazers","contributors_url":"https://api.github.com/repos/kul3r4/amp-by-example/contributors","subscribers_url":"https://api.github.com/repos/kul3r4/amp-by-example/subscribers","subscription_url":"https://api.github.com/repos/kul3r4/amp-by-example/subscription","commits_url":"https://api.github.com/repos/kul3r4/amp-by-example/commits{/sha}","git_commits_url":"https://api.github.com/repos/kul3r4/amp-by-example/git/commits{/sha}","comments_url":"https://api.github.com/repos/kul3r4/amp-by-example/comments{/number}","issue_comment_url":"https://api.github.com/repos/kul3r4/amp-by-example/issues/comments{/number}","contents_url":"https://api.github.com/repos/kul3r4/amp-by-example/contents/{+path}","compare_url":"https://api.github.com/repos/kul3r4/amp-by-example/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kul3r4/amp-by-example/merges","archive_url":"https://api.github.com/repos/kul3r4/amp-by-example/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kul3r4/amp-by-example/downloads","issues_url":"https://api.github.com/repos/kul3r4/amp-by-example/issues{/number}","pulls_url":"https://api.github.com/repos/kul3r4/amp-by-example/pulls{/number}","milestones_url":"https://api.github.com/repos/kul3r4/amp-by-example/milestones{/number}","notifications_url":"https://api.github.com/repos/kul3r4/amp-by-example/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kul3r4/amp-by-example/labels{/name}","releases_url":"https://api.github.com/repos/kul3r4/amp-by-example/releases{/id}","deployments_url":"https://api.github.com/repos/kul3r4/amp-by-example/deployments","created_at":"2016-02-18T11:18:36Z","updated_at":"2016-02-18T11:18:36Z","pushed_at":"2016-07-24T18:47:54Z","git_url":"git://github.com/kul3r4/amp-by-example.git","ssh_url":"git@github.com:kul3r4/amp-by-example.git","clone_url":"https://github.com/kul3r4/amp-by-example.git","svn_url":"https://github.com/kul3r4/amp-by-example","homepage":"http://amp-by-example.appspot.com/","size":91744,"stargazers_count":0,"watchers_count":0,"language":"HTML","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":"ampproject:master","ref":"master","sha":"f928e462d18495b2b13e9a516d9c015d22b24693","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":51327024,"name":"amp-by-example","full_name":"ampproject/amp-by-example","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/amp-by-example","description":"A hands-on introduction to Accelerated Mobile Pages (AMP) focusing on code and live samples.","fork":false,"url":"https://api.github.com/repos/ampproject/amp-by-example","forks_url":"https://api.github.com/repos/ampproject/amp-by-example/forks","keys_url":"https://api.github.com/repos/ampproject/amp-by-example/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ampproject/amp-by-example/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ampproject/amp-by-example/teams","hooks_url":"https://api.github.com/repos/ampproject/amp-by-example/hooks","issue_events_url":"https://api.github.com/repos/ampproject/amp-by-example/issues/events{/number}","events_url":"https://api.github.com/repos/ampproject/amp-by-example/events","assignees_url":"https://api.github.com/repos/ampproject/amp-by-example/assignees{/user}","branches_url":"https://api.github.com/repos/ampproject/amp-by-example/branches{/branch}","tags_url":"https://api.github.com/repos/ampproject/amp-by-example/tags","blobs_url":"https://api.github.com/repos/ampproject/amp-by-example/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ampproject/amp-by-example/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ampproject/amp-by-example/git/refs{/sha}","trees_url":"https://api.github.com/repos/ampproject/amp-by-example/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ampproject/amp-by-example/statuses/{sha}","languages_url":"https://api.github.com/repos/ampproject/amp-by-example/languages","stargazers_url":"https://api.github.com/repos/ampproject/amp-by-example/stargazers","contributors_url":"https://api.github.com/repos/ampproject/amp-by-example/contributors","subscribers_url":"https://api.github.com/repos/ampproject/amp-by-example/subscribers","subscription_url":"https://api.github.com/repos/ampproject/amp-by-example/subscription","commits_url":"https://api.github.com/repos/ampproject/amp-by-example/commits{/sha}","git_commits_url":"https://api.github.com/repos/ampproject/amp-by-example/git/commits{/sha}","comments_url":"https://api.github.com/repos/ampproject/amp-by-example/comments{/number}","issue_comment_url":"https://api.github.com/repos/ampproject/amp-by-example/issues/comments{/number}","contents_url":"https://api.github.com/repos/ampproject/amp-by-example/contents/{+path}","compare_url":"https://api.github.com/repos/ampproject/amp-by-example/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ampproject/amp-by-example/merges","archive_url":"https://api.github.com/repos/ampproject/amp-by-example/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ampproject/amp-by-example/downloads","issues_url":"https://api.github.com/repos/ampproject/amp-by-example/issues{/number}","pulls_url":"https://api.github.com/repos/ampproject/amp-by-example/pulls{/number}","milestones_url":"https://api.github.com/repos/ampproject/amp-by-example/milestones{/number}","notifications_url":"https://api.github.com/repos/ampproject/amp-by-example/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ampproject/amp-by-example/labels{/name}","releases_url":"https://api.github.com/repos/ampproject/amp-by-example/releases{/id}","deployments_url":"https://api.github.com/repos/ampproject/amp-by-example/deployments","created_at":"2016-02-08T21:05:29Z","updated_at":"2016-07-21T10:33:15Z","pushed_at":"2016-07-24T18:58:32Z","git_url":"git://github.com/ampproject/amp-by-example.git","ssh_url":"git@github.com:ampproject/amp-by-example.git","clone_url":"https://github.com/ampproject/amp-by-example.git","svn_url":"https://github.com/ampproject/amp-by-example","homepage":"http://ampbyexample.com/","size":92236,"stargazers_count":147,"watchers_count":147,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":63,"mirror_url":null,"open_issues_count":71,"forks":63,"open_issues":71,"watchers":147,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ampproject/amp-by-example/pulls/280"},"html":{"href":"https://github.com/ampproject/amp-by-example/pull/280"},"issue":{"href":"https://api.github.com/repos/ampproject/amp-by-example/issues/280"},"comments":{"href":"https://api.github.com/repos/ampproject/amp-by-example/issues/280/comments"},"review_comments":{"href":"https://api.github.com/repos/ampproject/amp-by-example/pulls/280/comments"},"review_comment":{"href":"https://api.github.com/repos/ampproject/amp-by-example/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ampproject/amp-by-example/pulls/280/commits"},"statuses":{"href":"https://api.github.com/repos/ampproject/amp-by-example/statuses/b8e4123bd3bcb4882f328767596df1b6cc62d3ee"}}}}
{"actor":{"display_login":"sebastianbenz"}}