Skip to content

✨ Add amp-ad implementation for gsrv - #40564

Open
goadserver wants to merge 1 commit into
ampproject:mainfrom
goadserver:gsrv-amp-ad
Open

goadserver wants to merge 1 commit into
ampproject:mainfrom
goadserver:gsrv-amp-ad

Conversation

@goadserver

Copy link
Copy Markdown

Adds gsrv as a third-party ad vendor: ad zones served by ad networks that run on GoAdserver.

<amp-ad width="300" height="250" type="gsrv"
  data-host="g2.gsrv.dev" data-ctrl="19460" data-zone="12512838">
</amp-ad>

How it works

  • ads/vendors/gsrv.js validates the attributes and loads the network's ad controller from https://<data-host>/ctrl/<data-ctrl>.js into the 3p frame. data-host is the network's own serving domain, validated as a plain host name (each network on the platform serves from its own domain, the same model as the aso integration).
  • The controller renders the zone into a div inside #c and reports to AMP itself:
    • renderStart({width, height}) once the ad has rendered (images loaded), with the creative's height; the width stays the slot's.
    • noContentAvailable() when the zone has no ad, or the controller cannot be loaded.
    • reportRenderedEntityIdentifier() with the zone id (no user data).
  • Clicks open in a new window through the ad server's click URL.
  • Publisher documentation: ads/vendors/gsrv.md.

Changes included

  • 3p/vendors/gsrv.js: vendor bootstrap.
  • ads/vendors/gsrv.js: main logic.
  • ads/vendors/gsrv.md: publisher documentation.
  • ads/_config.js: renderStartImplemented: true. There is no prefetch/preconnect entry because the host differs per network.
  • extensions/amp-ad/amp-ad.md: link to the documentation.
  • examples/amp-ad/ads.amp.html + ads.amp.esm.html: an example on a demo zone that always fills.
  • test/unit/ads/test-gsrv.js: unit tests.

Testing

  • amp lint, amp prettify, amp check-types all pass.
  • amp unit --files=test/unit/{test-ads-config.js,test-integration.js},test/unit/ads/test-gsrv.js passes.
  • Manual test on the local dev server at desktop and mobile widths, against the live ad servers:
    • banner and native zones render and resize;
    • the impression is logged and clicks go through the click URL;
    • a zone with no ad collapses.

Live demo of ads on AMP pages: https://www.goadserver.com/demo/amp/

Contact: support@goadserver.com

cc @ampproject/wg-monetization

Ad zones served by an ad network that runs on GoAdserver. The vendor
script loads the network's ad controller from data-host and hands it the
zone; the controller renders it into the frame and calls renderStart()
with the ad's size, noContentAvailable() on no fill, and
reportRenderedEntityIdentifier().
@CLAassistant

CLAassistant commented Oct 18, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants