-
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
Fix Tag Manager useExistingTagEffect
to properly work in case of primary AMP
#5044
Comments
IB ✔️ |
QA Update:
|
QA Update:
|
QA Update:
|
@wpdarren It's the same behavior in |
QA Update: ✅Verified: With Primary AMP set up as per the QAB:
Note: for Secondary AMP I have discovered a few issues, but they are out of scope so will create new ticket. |
The latest
useExistingTagEffect()
implementation always looks at thecontainerID
module setting. However, in case of primary AMP, only theampContainerID
setting is set, and the hook should rely on that in such a case.Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Relying on the
feature/existing-tag-simplification
branch:modules/tagmanager
store should receive a new selectorgetPrimaryContainerID()
.core/site
isPrimaryAMP()
selector), the selector should return the value ofgetAMPContainerID()
.getContainerID()
.undefined
), the new selector should also returnundefined
.useExistingTagEffect()
hook should be fixed to also support AMP. Basically, instead of relying ongetContainerID()
, it should rely on the abovegetPrimaryContainerID()
so that it works for either case.Implementation Brief
Any PR for this must be based on and target the
feature/existing-tag-simplification
branch.assets/js/modules/tagmanager/datastore/containers.js
,getPrimaryContainerID
which should do the following:core/site
datastore via theisPrimaryAMP
selector.getAMPContainerID
selector of the module.getContainerID
selector of the module.undefined
if the calls to above selectors returnundefined
, i.e are still in a "loading" state.assets/js/modules/tagmanager/hooks/useExistingTagEffect.js
,getContainerID
selector call withgetPrimaryContainerID
selector to get the container ID.Test Coverage
QA Brief
AMP Container
is the same as the Existing AMP Tag (Selected via dropdown) the snippet toggle will be disabled and vise versa.Changelog entry
useExistingTagEffect
hook to use AMP container ID when in the primary AMP mode.The text was updated successfully, but these errors were encountered: