Skip to content

Commit

Permalink
Support the data-language attribute for AdSense (#12300)
Browse files Browse the repository at this point in the history
* Support the data-language attribute for AdSense

* Updated AdSense documentation.

* Address review comment
  • Loading branch information
eshienbrood authored and keithwrightbos committed Dec 5, 2017
1 parent 2b16d73 commit 8355bc6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions ads/google/adsense.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ Supported parameters:
- data-ad-host
- data-adtest
- data-tag-origin
- data-language
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ export class AmpAdNetworkAdsenseImpl extends AmpA4A {
'bc': global.SVGElement && global.document.createElementNS ? '1' : null,
'ctypes': this.getCtypes_(),
'host': this.element.getAttribute('data-ad-host'),
'hl': this.element.getAttribute('data-language'),
'to': this.element.getAttribute('data-tag-origin'),
'pv': sharedStateParams.pv,
'channel': this.element.getAttribute('data-ad-channel'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,7 @@ describes.realWin('amp-ad-network-adsense-impl', {
});
it('returns the right URL', () => {
element.setAttribute('data-ad-slot', 'some_slot');
element.setAttribute('data-language', 'lxz');
return impl.getAdUrl().then(url => {
[
/^https:\/\/googleads\.g\.doubleclick\.net\/pagead\/ads/,
Expand Down Expand Up @@ -509,6 +510,7 @@ describes.realWin('amp-ad-network-adsense-impl', {
/(\?|&)isw=\d+(&|$)/,
/(\?|&)ish=\d+(&|$)/,
/(\?|&)pfx=(1|0)(&|$)/,
/(\?|&)hl=lxz(&|$)/,
/(\?|&)url=https?%3A%2F%2F[a-zA-Z0-9.:%]+(&|$)/,
/(\?|&)top=localhost(&|$)/,
/(\?|&)ref=https%3A%2F%2Facme.org%2F(&|$)/,
Expand Down

0 comments on commit 8355bc6

Please sign in to comment.