Closed kuasha420 closed 9 months ago
I can confirm the same. Site Kit is placing the plugin inserted AdSense snippet despite an existing AdSense snippet already manually placed. Recording.
ACs are good 👍🏻
IB ✔️
@10upsimon thanks for the helpful QAB instructions! I have an observation. I ran some additional testing with setting up AdSense with the mu-lugin activated. I saw the tag already present
message, but when I enable the toggle another message appears warning of a potential conflict. See screenshot below.
When I do the same in Analytics settings, the text doesn't change. Should it?
This is what I see when the toggle is disabled.
This is the text that appears when the toggle is enabled.
Verified:
tag already present
message shows when my mu-plugin is installed. tag already present
message does not appear.
Feature Description
Currently AdSense existing tag detection only detects old style AdSense tags. But it does not detect new Auto Ad Snippets. We should enhance the detection to detect both snippets as existing AdSense tag.
Old tag example:
Auto ads tag example:
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
getExistingTag
andhasExistingTag
) ofAdSense
module should be updated to detect both the old style and auto ad AdSense snippets.Implementation Brief
In
assets/js/modules/adsense/util/tag-matchers.js
:ca-pub
prefix:Test Coverage
assets/js/util/test/extractExistingTag.js
, add a new test case to detect the new Auto Ad Snippet script tag similar to other test cases.QA Brief
In order to test this functionality, a custom AdSense script of the new version format must be added to the page by a means other than site kit. This can be done via the active themes
functions.php
file, or via a custom mu-plugin.functions.php
file (or create one if not present), OR[...]/wp-content/mu-plugins/00-adsense-testing.php
functions.php
file ormu-plugin
method, add the following snippet of code to either of the above locations:3467161889682403
) with the pub ID of the AdSense account attached to your test environment.Google Site Kit > Settings > AdSense
Edit
CTA link for said modulemu-plugin
or the code from thefunctions.php
file of said theme and validate that the "tag already present" message disappears.Changelog entry