-
Notifications
You must be signed in to change notification settings - Fork 293
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
Allow testing tags in non-production environments #4774
Labels
P2
Low priority
PHP
QA: Eng
Requires specialized QA by an engineer
Rollover
Issues which role over to the next sprint
Type: Enhancement
Improvement of an existing feature
Comments
aaemnnosttv
added
P2
Low priority
Type: Enhancement
Improvement of an existing feature
labels
Feb 2, 2022
cc: @felixarntz |
IB ✔️ |
18 tasks
QA Update
|
@mohitwp, yes, you have to verify whether the GA and GTM tags are added as how it works today. |
QA: Eng ✅
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
P2
Low priority
PHP
QA: Eng
Requires specialized QA by an engineer
Rollover
Issues which role over to the next sprint
Type: Enhancement
Improvement of an existing feature
Feature Description
In #2054, we added a guard to prevent module tags from being placed in non-production environments to tracking page views, displaying ads, etc in such environments. There are however cases where it makes sense for a developer to want these tags to be rendered in a local/development/staging environment in order to test integration with them (e.g. custom Analytics events).
With this in mind, we should allow for a developer to disable/bypass the environment type guard for tags.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Tag_Production_Guard
tag guard should be replaced with a newTag_Environment_Type_Guard
which works similar to the current production guard, but allows for flexibility in the environments it disables tags forwp_get_environment_type
function does not exist, it should continue to returntrue
googlesitekit_allowed_tag_environment_types
which filters an array of valid environment types which should initially be onlyproduction
as todaycan_activate
method should returntrue
if the current environment type is in the filtered arrayTag_Production_Guard
class should be removed and its usage replaced with the newTag_Environment_Type_Guard
Implementation Brief
Tag_Production_Guard
class to a new class namedTag_Environment_Type_Guard
. It should implement the sameGuard_Interface
.can_activate()
method, useapply_filters()
with the hook name to begooglesitekit_allowed_tag_environment_types
. Pass an array with the valueproduction
as the value to filter.Test Coverage
Tag_Production_GuardTest
to test the newly created filter.QA Brief
QA:Eng
development
environment.Changelog entry
The text was updated successfully, but these errors were encountered: