amphtml icon indicating copy to clipboard operation
amphtml copied to clipboard

Remove need for <amp-auto-ads> tag in the body

Open tlong2 opened this issue 9 years ago • 5 comments

Currently to use amp-auto-ads a publisher has to place a <script> tag in the <head> as well as an <amp-auto-ads> tag in the body.

It would make the set up simpler if this could be reduced to a single snippet that has to be copied into the <head>. We propose to achieve this by allowing the setup data to be specified as follows:

`

`

Need to check, but this may require relaxing some of the constraints in the validator.

tlong2 avatar May 04 '17 16:05 tlong2

This sounds like a reasonable enhancement.

Few very quick tech pointers:

  1. The amp-auto-ads will have to be set up as a doc service (AMP.registerServiceForDoc).
  2. Lookup for the script element will have to be chained on ampdoc.whenBodyAvailable() to ensure that the whole <head></head> is parsed.
  3. I still think ideally we'd support both forms.
  4. This happens automatically for elements, but a service must block on document visibility. In other words, no network requests can be done while document is in pre-render.
  5. Correct: validator may need to be adjusted.

dvoytenko avatar May 05 '17 01:05 dvoytenko

This issue seems to be in Pending Triage for awhile. @tlong2 Please triage this to an appropriate milestone.

ampprojectbot avatar Dec 12 '17 02:12 ampprojectbot

This issue seems to be in Pending Triage for awhile. @tlong2 Please triage this to an appropriate milestone.

ampprojectbot avatar Jun 05 '18 15:06 ampprojectbot

This issue seems to be in Pending Triage for awhile. @tlong2 Please triage this to an appropriate milestone.

ampprojectbot avatar Sep 11 '18 14:09 ampprojectbot

Closing since this approach has been shelved for now: https://github.com/ampproject/amphtml/pull/9669#issuecomment-306323169

dreamofabear avatar Jan 03 '19 20:01 dreamofabear