Skip to content

Commit

Permalink
Merge pull request ampproject#1911 from bobcassels/fix-adsense-google…
Browse files Browse the repository at this point in the history
…_page_url

Fix the handling of google_page_url in ads/adsense.js
  • Loading branch information
cramforce committed Feb 10, 2016
2 parents 52ab8c6 + 8c10f89 commit db7e7cb
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions ads/adsense.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ export function adsense(global, data) {
hid: global.context.pageViewId,
};
}
/*eslint "google-camelcase/google-camelcase": 0*/
global.google_page_url = global.context.canonicalUrl;
const s = document.createElement('script');
s.src = 'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js';
global.document.body.appendChild(s);
Expand All @@ -40,6 +38,7 @@ export function adsense(global, data) {
if (data['adSlot']) {
i.setAttribute('data-ad-slot', data['adSlot']);
}
i.setAttribute('data-page-url', global.context.canonicalUrl);
i.setAttribute('class', 'adsbygoogle');
i.style.cssText = 'display:inline-block;width:100%;height:100%;';
global.document.getElementById('c').appendChild(i);
Expand Down

0 comments on commit db7e7cb

Please sign in to comment.