New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add client check/formatting to AdSense Fast Fetch #7977
Add client check/formatting to AdSense Fast Fetch #7977
Conversation
…ormatted properly
cc @ampproject/a4a |
@@ -105,7 +105,8 @@ export class AmpAdNetworkAdsenseImpl extends AmpA4A { | |||
|
|||
/** @override */ | |||
isValidElement() { | |||
return isGoogleAdsA4AValidEnvironment(this.win) && this.isAmpAdElement(); | |||
return !!this.element.getAttribute('data-ad-client') && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems redundant, since if there's no client it'll get filtered out by adsenseIsA4AEnabled?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, just being overly cautious.
@lannka please merge once build is green. Thanks! |
…ormatted properly (ampproject#7977)
…ormatted properly (ampproject#7977)
Add existence check for data-ad-client as part of isValidElement otherwise request could be sent with missing id causing 400 response. Ensure that client is properly formatted (lower case with ca- prefix).