Closed swissspidy closed 4 years ago
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.
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
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
.
@jasti WDYT about this as a baseline?
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.
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 https://github.com/WordPress/gutenberg/pull/13361 / https://github.com/WordPress/gutenberg/issues/13357
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.
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.
AMP Stories supports an
amp-story-auto-ads
component that works like this:(source)
Right now, the only way to insert that component is by filtering
the_content
:https://github.com/ampproject/amp-wp/blob/1aa2afaec26781a953ca7f7442fc21973e4ce243/includes/templates/single-amp_story.php#L41-L55
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.