Remove need for <amp-auto-ads> tag in the body
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.
This sounds like a reasonable enhancement.
Few very quick tech pointers:
- The amp-auto-ads will have to be set up as a doc service (
AMP.registerServiceForDoc). - Lookup for the
scriptelement will have to be chained onampdoc.whenBodyAvailable()to ensure that the whole<head></head>is parsed. - I still think ideally we'd support both forms.
- 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.
- Correct: validator may need to be adjusted.
This issue seems to be in Pending Triage for awhile. @tlong2 Please triage this to an appropriate milestone.
This issue seems to be in Pending Triage for awhile. @tlong2 Please triage this to an appropriate milestone.
This issue seems to be in Pending Triage for awhile. @tlong2 Please triage this to an appropriate milestone.
Closing since this approach has been shelved for now: https://github.com/ampproject/amphtml/pull/9669#issuecomment-306323169