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

Make it easier to advertise in AMP Stories #2430

Closed
swissspidy opened this issue May 27, 2019 · 8 comments
Closed

Make it easier to advertise in AMP Stories #2430

swissspidy opened this issue May 27, 2019 · 8 comments
Labels
Enhancement New feature or improvement of an existing one

Comments

@swissspidy
Copy link
Collaborator

AMP Stories supports an amp-story-auto-ads component that works like this:

<amp-story>
  <amp-story-auto-ads>
    <script type="application/json">
      {
        "ad-attributes": {
          // ad server configuration
        }
      }
    </script>
  </amp-story-auto-ads>
  <amp-story-page>
  ...
</amp-story>

(source)

Right now, the only way to insert that component is by filtering the_content:

<amp-story
standalone
publisher-logo-src="<?php echo esc_url( $publisher_logo_src ); ?>"
publisher="<?php echo esc_attr( $publisher ); ?>"
title="<?php the_title_attribute(); ?>"
poster-portrait-src="<?php echo esc_url( $poster_portrait ); ?>"
<?php if ( $poster_square ) : ?>
poster-square-src="<?php echo esc_url( $poster_square ); ?>"
<?php endif; ?>
<?php if ( $poster_landscape ) : ?>
poster-landscape-src="<?php echo esc_url( $poster_landscape ); ?>"
<?php endif; ?>
>
<?php the_content(); ?>
</amp-story>

I wonder if we should add a dedicated action to the template there. Perhaps we could even add a amp_stories_auto_ads_attributes filter and automatically print <amp-story-auto-ads> when the attributes are not empty.

@swissspidy swissspidy added Enhancement New feature or improvement of an existing one AMP-Stories labels May 27, 2019
@westonruter
Copy link
Member

I was chatting about this with @amedina last week as well. I also suggested a filter which would result in the AMP component printed when the array is not empty.

The alternative we chatted about was to add a new ads section to the Document sidebar in the editor, but that seems very premature. The configuration would need a UI and it seems likely that the same configuration would be used across stories anyway. And we'd want an ad-provider plugin to actually inject the ads and manage the UI.

So +1 for filter.

@amedina
Copy link
Member

amedina commented May 31, 2019

Sounds good; +1 for filter.

Chatted with @jasti a bit about Ads on Stories. Should sync further to discuss enabling strategies/recommended approaches for monetization. /cc @vinaymahag

@swissspidy
Copy link
Collaborator Author

The alternative we chatted about was to add a new ads section to the Document sidebar in the editor, but that seems very premature. The configuration would need a UI and it seems likely that the same configuration would be used across stories anyway. And we'd want an ad-provider plugin to actually inject the ads and manage the UI.

Makes sense. It seems that there are a few configurations that would need to be exposed in the UI. One example would be for toggling the next-page-no-ad attribute on an amp-story-page.

@amedina
Copy link
Member

amedina commented Jun 6, 2019

@jasti WDYT about this as a baseline?

@jasti
Copy link

jasti commented Jun 6, 2019

Yeah, there are a lot of options we can fiddle with. Lets discuss if this should all be bundled as part of the Site Kit Package or ship with the AMP plugin in the next version.

@swissspidy swissspidy removed this from the v1.2 milestone Jun 14, 2019
@swissspidy
Copy link
Collaborator Author

The alternative we chatted about was to add a new ads section to the Document sidebar in the editor

Note that it's finally possible to actually extend the document sidebar with the upcoming new Gutenberg version.

See WordPress/gutenberg#13361 / WordPress/gutenberg#13357

@swissspidy
Copy link
Collaborator Author

Here are the docs for next-page-no-ad: https://amp.dev/documentation/components/amp-story-auto-ads/#insertion-control

Since we have the amp_story_auto_ads_configuration filter, we could add a checkbox for next-page-no-ad to the Document sidebar if, and only if, the filter is not empty. However, this could also be done by any ads plugin.

Since amp-story-auto-ads still only supports Ad Manager at the moment, it's not really a priority.

@swissspidy
Copy link
Collaborator Author

An important detail for next-page-no-ad from the docs:

The AMP runtime makes the ad call as early as possible and places the first one sometime after the first two pages, and never as the last page.

That means the next-page-no-ad setting would be irrelevant on the first and last page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or improvement of an existing one
Projects
None yet
Development

No branches or pull requests

5 participants