{"action":"created","issue":{"url":"https://api.github.com/repos/ampproject/amphtml/issues/7546","repository_url":"https://api.github.com/repos/ampproject/amphtml","labels_url":"https://api.github.com/repos/ampproject/amphtml/issues/7546/labels{/name}","comments_url":"https://api.github.com/repos/ampproject/amphtml/issues/7546/comments","events_url":"https://api.github.com/repos/ampproject/amphtml/issues/7546/events","html_url":"https://github.com/ampproject/amphtml/pull/7546","id":207573529,"number":7546,"title":"amp-auto-ads: Allows attributes for the <amp-ad>s to be specified in the config","user":{"login":"tlong2","id":21240004,"avatar_url":"https://avatars.githubusercontent.com/u/21240004?v=3","gravatar_id":"","url":"https://api.github.com/users/tlong2","html_url":"https://github.com/tlong2","followers_url":"https://api.github.com/users/tlong2/followers","following_url":"https://api.github.com/users/tlong2/following{/other_user}","gists_url":"https://api.github.com/users/tlong2/gists{/gist_id}","starred_url":"https://api.github.com/users/tlong2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tlong2/subscriptions","organizations_url":"https://api.github.com/users/tlong2/orgs","repos_url":"https://api.github.com/users/tlong2/repos","events_url":"https://api.github.com/users/tlong2/events{/privacy}","received_events_url":"https://api.github.com/users/tlong2/received_events","type":"User","site_admin":false},"labels":[{"id":283436627,"url":"https://api.github.com/repos/ampproject/amphtml/labels/Category:%20Ads","name":"Category: Ads","color":"1d76db","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-02-14T16:54:55Z","updated_at":"2017-02-17T19:09:57Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ampproject/amphtml/pulls/7546","html_url":"https://github.com/ampproject/amphtml/pull/7546","diff_url":"https://github.com/ampproject/amphtml/pull/7546.diff","patch_url":"https://github.com/ampproject/amphtml/pull/7546.patch"},"body":"Attributes can be specified at the config level and will be applied to all `<amp-ad>`s inserted. Attributes can also be specified at the placement level and will only be applied to `<amp-ad>`s inserted using that placement.\r\n\r\nExample:\r\n```json\r\n {\r\n  \"placements\": [\r\n    {\r\n      \"anchor\": {\r\n        \"selector\": \"DIV#anId\",\r\n      },\r\n      \"pos\": 2,\r\n      \"type\": 1,\r\n      \"attributes\": {\r\n        \"data-att-1\": \"val1\",\r\n        \"data-att-2\": \"val2\",\r\n      },\r\n    },\r\n  ],\r\n  \"attributes\": {\r\n    \"data-att-2\": \"val3\",\r\n    \"data-att-4\": \"val4\",\r\n  },\r\n}\r\n```\r\nWould result in the following amp-ad being inserted:\r\n`<amp-ad \"data-att-1=\"val1\" data-att-2=\"val2\" data-att-4=\"val4\">`\r\n\r\nFYI: I'm working on an MD file for amp-auto-ads that will document the API with examples. Will send in a PR soon.\r\n\r\nIncorporates the fix in https://github.com/ampproject/amphtml/pull/7427, since testing attributes is important to this change.\r\n\r\nhttps://github.com/ampproject/amphtml/issues/6196"},"comment":{"url":"https://api.github.com/repos/ampproject/amphtml/issues/comments/280739190","html_url":"https://github.com/ampproject/amphtml/pull/7546#issuecomment-280739190","issue_url":"https://api.github.com/repos/ampproject/amphtml/issues/7546","id":280739190,"user":{"login":"lannka","id":8496897,"avatar_url":"https://avatars.githubusercontent.com/u/8496897?v=3","gravatar_id":"","url":"https://api.github.com/users/lannka","html_url":"https://github.com/lannka","followers_url":"https://api.github.com/users/lannka/followers","following_url":"https://api.github.com/users/lannka/following{/other_user}","gists_url":"https://api.github.com/users/lannka/gists{/gist_id}","starred_url":"https://api.github.com/users/lannka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lannka/subscriptions","organizations_url":"https://api.github.com/users/lannka/orgs","repos_url":"https://api.github.com/users/lannka/repos","events_url":"https://api.github.com/users/lannka/events{/privacy}","received_events_url":"https://api.github.com/users/lannka/received_events","type":"User","site_admin":false},"created_at":"2017-02-17T19:09:57Z","updated_at":"2017-02-17T19:09:57Z","body":"Only allowing data attributes sounds good to me. Code looks good in general. Waiting for the README :-)"}}
{"actor":{"display_login":"lannka"}}