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

Comments

@swissspidy
Copy link
Collaborator

@swissspidy swissspidy commented May 27, 2019

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.

@westonruter

This comment has been minimized.

Copy link
Member

@westonruter westonruter commented May 27, 2019

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

This comment has been minimized.

Copy link
Member

@amedina 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

This comment has been minimized.

Copy link
Collaborator Author

@swissspidy swissspidy commented Jun 3, 2019

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

This comment has been minimized.

Copy link
Member

@amedina amedina commented Jun 6, 2019

@jasti WDYT about this as a baseline?

@jasti

This comment has been minimized.

Copy link
Collaborator

@jasti 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

This comment has been minimized.

Copy link
Collaborator Author

@swissspidy swissspidy commented Jul 3, 2019

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

This comment has been minimized.

Copy link
Collaborator Author

@swissspidy swissspidy commented Sep 26, 2019

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

This comment has been minimized.

Copy link
Collaborator Author

@swissspidy swissspidy commented Oct 16, 2019

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.

@ThierryA ThierryA closed this Nov 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.