🌸 Cherry-pick request for #37484 into #37411
See original GitHub issueIssue (P0 Bug)
Pull Request(s)
Release Tracker(s)
Channels
Stable, ~LTS~
Formats
Ads
Justification
As described in the issue 37484, the regression of the <amp-ad> extension from Smart Adserver prevents any ad call to be sent by the AMP inventory of Smart’s customers. The monetization of their AMP inventory is down to 0.
The fix has been pushed in 37483 where you can see the change is related to how the <amp-ad> tag gets access to the domain of the page.
The change has flown into Stable and is about to reach LTS version. Hence, we kindly ask this cherry-pick for an urgent fix of the Stable and LTS versions (so that publishers who rollbacked on LTS version benefit from the fix as well).
❓ In order to give some visibility to our customers, would you be able to tell us if the request can be accepted or not ASAP? Thank you very much. Please find below additional details.
Verification Steps
In the file below we reproduced the situation where an AMP page “cached_page.html” is executed in a Google Cache frame (index.html). If you browse index.html on localhost:8080 domain, you will get the error with the Stable version
Error: Blocked a frame with origin "http://127.0.0.1:8080" from accessing a cross-origin frame at amp-ad-network-smartadserver-impl-0.1.js:1:185883
Summary
Bug: no ad call are triggered from the <amp-ad> extension of Smart Adserver
Cause: the code tries to access this.win.top.location.hostname
to add the page domain in the ad request.
Solution: the code now uses Services.documentInfoForDoc(this.element).canonicalUrl
.
Todo: As the issue did not appear during our test phase, but only when the AMP page is executed in Google Cache for AMP, it might be interesting to know how we could reproduce this kind of integration on our local test page (or in a kind of Google Cache sandbox).
Impact
All users from Smart Adserver customers are affected, for all OS and all devices when they browse an AMP page through Google Cache domain. No ad call is sent, hence there is no advertising monetization for the publisher.
Action Items
I think the main step we missed is the testing with a replica of the Google Cache for AMP integration.
Notifications
/cc @ampproject/release-on-duty @ampproject/wg-approvers @ampproject/cherry-pick-approvers /cc helpful folks from Slack channel @powerivq @erwinmombay @kristoferbaxter @calebcordry 🙏
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (4 by maintainers)
Hello @newmuis, @rsimha, Thank you guys and sorry for the mess.
I tested the stable branch on my test page which reproduces a “Google AMP Cache powered” page and I see the bug is no longer there (ou <amp-ad> tag sends ad requests)
I also checked on a customer’s page in production. It uses the stable version as well and now generates ad requests 💪
PS: do you know how I could “force” or at least accurately reproduce using the Google AMP cache on my test pages? Or I need to publish a fully valid AMP page on production and wait for the bot to crawl my page?
Thanks!
This cherrypick has made it to beta/experimental and stable.
@mlapeyre3 can you help verify that the bug is no longer reproducible?