amphtml icon indicating copy to clipboard operation
amphtml copied to clipboard

I2I: document-level infinite-scroll

Open emarchiori opened this issue 8 years ago • 4 comments

Objective

Provide publishers the ability to show several articles/document by the user just scrolling (aka infinite-scroll).

Background

Many publisher use this kind of solution in their non-AMP sites to further user engagement by providing related content in the same stream, with no loading times or clicking. The following articles (aka recommendations) can be provided in-line in the component, loaded from a URL or provided by a 3rd party (eventually). To adjust for different client side restrictions, the recommendations could eventually be rendered in different ways, besides infinite-scroll, such as previews or a stream of A2A links.

Details

Suggested name: amp-content-discovery

Initial version will include:

  • Support only inline JSON recommendations
  • Limit number of articles in scroll to 3 or 4, until performance risks can be addressed
  • Update URL and/or title in viewer
  • Add new events in analytics
  • Basic handling of fixed position elements

Features to be implemented later:

  • More sensible management of fixed elements (e.g. refresh sticky ads)
  • Collapsing of repeated or irrelevant elements
  • Ability to hide/unhide elements at the bottom of the page
  • Increase UI configuration options
  • Support dynamic and 3rd party recommendations

Example

Publishers will add a one tag with inline recommendations:

<script type="application/json">
   {
        "recos": [
          {
            "image": "http://example.com/image1.jpg",
            "title": "This is one another article",
            "ampUrl": "http://example.com/article1.amp.html"
          }, ...
        ]
   }
</script>
</amp-X>

amp-infinite-scroll

cc/ @aghassemi @ericlindley-g @dvoytenko

emarchiori avatar Jan 22 '18 09:01 emarchiori

Tried this out but needs CORS as I received the error "Response must contain the AMP-Access-Control-Allow-Source-Origin header". Please add to the documentation for this component or rework it like amp-story did for their bookend.json file as in https://github.com/ampproject/amphtml/issues/11846.

ghost avatar Mar 08 '18 17:03 ghost

Would this feature need to work for an AMP native site only, what would happen if some articles were AMP and some weren't?

Love this idea, and the short gif shown feels like it will work quite well from a UX perspective.

jwold avatar Nov 08 '18 22:11 jwold

All of the documents used in the infinite scroll would need to be available as AMP.

westonruter avatar Nov 09 '18 01:11 westonruter

implemented under doc-level opt-in as amp-next-page

aghassemi avatar Jun 20 '19 17:06 aghassemi