Introduced new AdSense Code to Improve the Ad performance
See original GitHub issueFeature Description
Google AdSense recently introduced the new AdSense snippet schema to improve the Ad performance. A user on the support forum also reported this.
Auto ads code example:
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1234" crossorigin="anonymous"</script>
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
- The web tag for AdSense should be updated accordingly:
- The script
src
should include a newclient={publisher-id}
query parameter - The script tag should receive an added
crossorigin="anonymous"
attribute
- The script
Implementation Brief
- Using
includes/Modules/AdSense/Web_Tag.php
- Update the
render
method to add theclient
URL parameter having$this->tag_id
as value and add thecrossorigin="anonymous"
attribute to the script tag.
- Update the
Test Coverage
- No new tests to be added
Visual Regression Changes
- N/A
QA Brief
- Enable AdSense on a site and ensure it is placing the AdSense tag for you.
- Check the source code for new markup (ctrl+u, ctrl+f and search for ''adsbygoogle.js?client=")
Changelog entry
- Update AdSense tag code to improve Ad performance.
Issue Analytics
- State:
- Created 2 years ago
- Comments:12
Top Results From Across the Web
Improving ad performance with the new AdSense code
July 19, 2021We recently launched a new version of the AdSense code. The new AdSense code allows AdSense to trigger optimization features ...
Read more >New Adsense Code To Improve Ad Performance
This doesn't currently seem to be deployed on my sites using SiteKit. Any idea when this will be deployed, or do I have...
Read more >Improving ad performance with the new AdSense code - Drupal
The new AdSense code allows AdSense to trigger optimization features earlier which can improve the performance of the ads on your site.
Read more >New Faster Google AdSense Embed Code
Google has announced that is launched a new version of its AdSense code that improves ad performance. I assume that means it performs...
Read more >Introducing the new and improved Auto ads
- No more messing with ad codes! Auto ads now work through any AdSense ad unit code, so using them on your existing...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
QA Update: ✅
adsbygoogle.js?client=
crossorigin="anonymous"
attribute.@asvinb to me it seems like we just need to add
?client=ca-pub-...
parameter to the src URL andcrossorigin="anonymous"
attribute to the script tag itself. Everything else should remain the same.