-
Notifications
You must be signed in to change notification settings - Fork 278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Place Ad blocking recovery and Error protection tag in the website based on Ad Blocking Recovery settings #7186
Comments
AC ✅ |
@kuasha420 why would we require this? 🤔 The AdSense tag doesn't have this requirement/restriction (AFAIK), so it would be odd that we'd apply this differently here. |
I'd argue it makes more sense to omit the recovery tags on 404 than normal. The 404 page is one that the user—ideally—shouldn't be seeing (in an ideal world they wouldn't get to a 404) but if they do, they need to navigate out of to be in a usable place on the site. We shouldn't be interrupting the flow flow of returning the user to a "good place" on the site. Plus—they aren't really viewing any content on the 404 page (which also could be a likely entrypoint into the site from external sources—outdated/incorrect 3rd-party links or search results). So asking them to please enable ads to support content they can't see is disjointed I think. @marrrmarrr mentioned it'd be good to omit the recovery tags from the 404 page. I think it's possibly worth doing for regular ads too, but definitely for the recovery UI. IB ✅ |
QA Update: ✅Verified:
|
Feature Description
The Ad blocking recovery and error protection tag should be placed on the front end of the website once the feature is setup and the respective setting toggles are turned on regardless of whether the main AdSense tag is placed (by Site Kit or otherwise).
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
adBlockingRecoverySetupStatus
is not an empty string) and their respective snippet toggles are enabled.Implementation Brief
Google\Site_Kit\Core\Tags\Guards
namespace:WP_Query_404_Guard
that implementsGuard_Interface
.can_activate
method should return! is_404()
.Google\Site_Kit\Modules\AdSense
namespace:Ad_Blocking_Recovery_Tag_Guard
that extendsModule_Tag_Guard
.can_activate
method should returntrue
whenadBlockingRecoverySetupStatus
is not an empty string anduseAdBlockerDetectionSnippet
istrue
.Ad_Blocking_Recovery_Web_Tag
.ad_blocking_recovery_tag
anduse_error_protection_snippet
.render
method, render the$ad_blocking_recovery->get()['tag']
.$ad_blocking_recovery->get()['error_protection_code']
ifuse_error_snippet
istrue
.Tag_Guard
:can_activate
method, remove the logic ofis_404
.Google\Site_Kit\Modules\AdSense
.register_tag
method:WP_Query_404_Guard
to the current tag as the logic was removed previously.Ad_Blocking_Recovery_Web_Tag
, set the fields with setters, guard and register it whenadBlockerDetection
is enabled and site is not inamp
.Test Coverage
QA Brief
googlesitekit_adsense_ad_blocking_recovery_tag
with garbage date ('mash keyboard') using phpMyAdmin or similar tools.. 😄Changelog entry
The text was updated successfully, but these errors were encountered: