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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃摉story-ads: update docs #19308

Merged
merged 4 commits into from Nov 16, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
55 changes: 17 additions & 38 deletions extensions/amp-story/amp-story-auto-ads.md
Expand Up @@ -16,8 +16,6 @@ limitations under the License.

# <a name="`amp-story-auto-ads`"></a> `amp-story-auto-ads`

## THIS IS A WORK-IN-PROGRESS

<table>
<tr>
<td width="40%"><strong>Description</strong></td>
Expand Down Expand Up @@ -58,15 +56,14 @@ looks like the following:
<amp-story>
<amp-story-auto-ads>
<script type="application/json">
{
"ad-attributes": {
"type": "custom",
"data-url": "https://adserver.com/getad?slot=abcd1234"
{
"ad-attributes": {
"type": "doubleclick",
"data-slot": "/30497360/a4a/amp_story_dfp_example"
}
}
}
</script>
</amp-story-auto-ads>
<amp-story-page>
...
</amp-story>
```
Expand All @@ -75,45 +72,27 @@ looks like the following:
`amp-ad` element to be inserted.

The above example will insert the following `amp-ad` element, which represents
a [custom ad](../../ads/custom.md):
a [ad served by doubleclick](../../extensions/amp-ad-network-doubleclick-impl/amp-ad-network-doubleclick-impl-internal.md):

```html
<amp-ad type="custom"
data-url="https://adserver.com/getad?slot=abcd1234"
<amp-ad type="doubleclick"
data-slot="/30497360/a4a/amp_story_dfp_example">
</amp-ad>
```

Unlike normal `amp-ad`, no `<fallback>` or `<placeholder>` needs to be specified
here, as ads in story can only be displayed once fully rendered.

## Inlined templates
If [custom ad](../../ads/custom.md) is used, templates can be inlined in the
`<amp-story-auto-ads>` element:
## Validation

```html
<amp-story-auto-ads>
<script type="application/json">
{
"ad-attributes": {
"type": "custom",
"data-url": "https://adserver.com/getad?slot=abcd1234"
}
}
</script>
It has to be a direct child of `amp-story` element.

<template type="amp-mustache" id="template-1">
<amp-img layout="fill" src="{{imgSrc}}"></amp-img>
<amp-pixel src="{{impressionUrl}}"></amp-pixel>
</template>
## Insertion Control
If there is a specific position in a story that you wish to never show an ad,
you can add the `next-page-no-ad` attribute an `<amp-story-page>`. The insertion
Copy link
Contributor

Choose a reason for hiding this comment

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

馃敟

algorithm will then skip the slot after this page when trying to insert an ad.

<template type="amp-mustache" id="template-2">
<div class="creative-line-1">{{creativeLine1}}</div>
<div class="creative-line-2">{{creativeLine2}}</div>
<amp-pixel src="{{impressionUrl}}"></amp-pixel>
</template>
</amp-story-auto-ads>
```html
<amp-story-page next-page-no-ad id="page-2">
</amp-story-page>
```

## Validation

It has to be a direct child of `amp-story` element.