Include AdSense for Platforms meta tag
See original GitHub issueFor sites with the AdSense module active, Site Kit should include the new AdSense for Platforms meta tag (see https://developers.google.com/adsense/platforms/transparent/meta-tags). It has the following shape: <meta name="google-adsense-platform-account" content="{host-publisher-id}">
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
- When the AdSense module is active, the following meta tags should be placed in the frontend, to associate the site with Site Kit’s platform account (learn more):
<meta name="google-adsense-platform-account" content="ca-host-pub-2644536267352236">
<meta name="google-adsense-platform-domain" content="sitekit.withgoogle.com">
- This should be regardless of whether the module is connected or whether the
useSnippet
option is enabled.
Implementation Brief
Important: Before merging any PR for this, please confirm with @felixarntz whether the Google side infrastructure is ready to go.
In Google\Site_Kit\Modules\AdSense
class,
- add the necessary platform meta tags in a new private
render_platform_meta_tags
method.- The values of the platform meta tags are exactly as they are listed in the AC, and can be hard coded.
- In the
register
method, add a new action forwp_head
that calls the newly addedrender_platform_meta_tags
method likerender
method is called in theGoogle\Site_Kit\Modules\AdSense\Web_Tag
’sregister
method.
Test Coverage
- Add tests for checking existence of the meta tags when adsense module is activated (whether fully connected or not).
Visual Regression Changes
- Not needed.
QA Brief
- Activate Adsense module.
- Check for the existence platform tags from the AC in AMP and Non-AMP version of the website when the module is not fully connected.
- Do the same for module fully connected state as well.
Changelog entry
- Add AdSense for Platforms meta tag
Issue Analytics
- State:
- Created 2 years ago
- Comments:13 (1 by maintainers)
Top Results From Across the Web
Meta tags - AdSense for Platforms - Google Developers
We use a series of meta tags to help scale your platform for ad serving. Below is a list of meta tags and...
Read more >Different Meta Values on my site - WordPress.org
I noticed Site Kits ads Meta Tags on my site. Shouldn't these values have my information, such as my domain and account number?...
Read more >Connect your site to AdSense - Google Support
Sign in to your AdSense account. · On the AdSense homepage, click Add site. · Enter the URL of the site that you...
Read more >How to grow your website traffic - Google AdSense
Paid promotions are when you pay to advertise on other platforms or websites ... On a related note, always use social media meta...
Read more >How to Properly Add Google AdSense to Your WordPress Site
The auto-ads code uses a single code snippet to generate ads everywhere on your WordPress blog. This means you need to add the...
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
@eclarke1 @aaemnnosttv It’s now confirmed that this can go out in 1.43.0 as planned - so we don’t need to create another issue to comment out that code. 👍
Great, thanks @kuasha420 !
IB ✅