AdSense For Search - Below the Fold
Description

This is an example of AdSense for Search (AFS) ads placed below the fold. See the reference documentation for more information about AFS.

AMP ad attributes:
  • type - Must be set to "csa".
  • height - Can be any value (300 per each ad is a good default).
  • data-afs-page-options - AFS page options as a string, in the same way you would specify the options in a normal web request.
  • data-afs-adblock-options - AFS block options as a string.
    • Set the width parameter to "auto" for best results.
    • No need to set the container parameter.
Additional requirements & information:
  • Although the page options containing the query parameter are passed as a string, you must dynamically change the query to match the actual search query.
  • Each amp-ad tag contains one adblock; only one data-afs-adblock-options attribute can be specified in the tag.
  • Although the height attribute must be set in the amp-ad tag, the ad will be resized automatically to match the height of the returned ads.


AMP Ad Tag


<amp-ad 
  height=300
  type="csa"
  data-afs-page-options='{"pubId": "partner-pub-id", "query": "user search query", "sellerRatings": true, "siteLinks": true}'
  data-afs-adblock-options='{"width": "auto", "number": 2}'>
</amp-ad> 
              
AMP Demo
Note: Emulate with a mobile user agent for accurate rendering.