Skip to content
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

Merged
merged 2 commits into from Mar 7, 2017
Merged

Add client check/formatting to AdSense Fast Fetch #7977

merged 2 commits into from Mar 7, 2017

Conversation

keithwrightbos
Copy link
Contributor

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).

@keithwrightbos
Copy link
Contributor Author

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') &&
Copy link
Member

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?

Copy link
Contributor Author

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 lannka self-assigned this Mar 6, 2017
@keithwrightbos
Copy link
Contributor Author

@lannka please merge once build is green. Thanks!

@lannka lannka merged commit de9f573 into ampproject:master Mar 7, 2017
kmh287 pushed a commit to kmh287/amphtml that referenced this pull request Mar 13, 2017
@taymonbeal taymonbeal deleted the a4a_adsense_params_validity_check branch March 20, 2017 16:05
mrjoro pushed a commit to mrjoro/amphtml that referenced this pull request Apr 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants