Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AdSense/Doubleclick Fast Fetch update AMP creative metadata format change #10738

Merged
merged 2 commits into from Aug 1, 2017
Merged

AdSense/Doubleclick Fast Fetch update AMP creative metadata format change #10738

merged 2 commits into from Aug 1, 2017

Conversation

keithwrightbos
Copy link
Contributor

AMP creative transformation as part of validation includes metadata used for client-side render within friendly iframe. The metadata is wrapped in a json script tag whose format has changed from <script type=application/json amp-ad-metadata> to <script amp-ad-metadata type=application/json>. Add support for multiple versions (to be cleaned up in the future once stable).

/cc @ampproject/a4a

const METADATA_STRINGS = [
'<script amp-ad-metadata type=application/json>',
'<script type="application/json" amp-ad-metadata>',
'<script type=application/json amp-ad-metadata>'];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering whether we just want to look for the first string, i.e., <script amp-metadata type=...>. According to an internal discussion in May, attribute names should always be sorted, and quotes should be omitted. I'm not sure that's become officially specified yet though. Most likely the best thing to do for now is to leave a TODO for later cleanup.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer to be backwards compatible for now but as mentioned in the description: "Add support for multiple versions (to be cleaned up in the future once stable)."

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking of a comment in the code itself. Are TODOs not a customary practice in this project?

@keithwrightbos keithwrightbos merged commit 0e83eab into ampproject:master Aug 1, 2017
cvializ pushed a commit that referenced this pull request Aug 1, 2017
…ange (#10738)

* handle metadata format change

* set initial value for metadataStart var
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants