site-kit-wp
site-kit-wp copied to clipboard
Tagmanager error:"Not found or permission denied." console error showing when user selects different tag manager a/c.
Bug Description
On selecting different tag manager a/c from drop down during Tag manager set up or after set up under settings throw console error.
googlesitekit-api-6b06a5c9b165bf7e28a4.js:3 Google Site Kit API Error method:GET datapoint:live-container-version type:modules identifier:tagmanager error:"Not found or permission denied."
It is confusing because when I selected one a/c as you can see in below screenshots. No console error appear. After selecting another a/c when I selected that a/c again then console error appeared for the same a/c.
Steps to reproduce
- Set up tag manger.
- Open console and during set up change tag manager a/c.
- See error.
OR
- Set up tag manger.
- After set up open tag manager settings in edit mode.
- Select different tag manager a/c from drop down.
- See error.
- Clear console while switching a/c.
Screenshots
https://github.com/google/site-kit-wp/assets/94359491/0734bba9-edd1-4b8c-8b26-28f87c403c6d
Additional Context
- PHP Version:
- OS: [e.g. iOS]
- Browser: [e.g. chrome, safari]
- Plugin Version: [e.g. 22]
- Device: [e.g. iPhone6]
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
- No console errors should be raised when switching selected accounts in the setup or settings screens for Tag Manager
Implementation Brief
The problem seems to be that the request for the live container version is triggered as soon as the new accountID is set, but the old internalContainerID is still set.
See
- https://github.com/google/site-kit-wp/issues/6818
- https://github.com/google/site-kit-wp/blob/6ea9e6935ab149a576e9ee4c90414e0aa5fc3b4b/assets/js/modules/analytics-4/datastore/properties.js#L500-L505
- [ ] Update
selectAccountto set theaccountIDand reset other IDs all at once usingsetSettingsinstead of individual setters - [ ] Finish (if necessary) and merge https://github.com/google/site-kit-wp/pull/8318
Test Coverage
- No changes expected
QA Brief
Changelog entry
IB ✔️
QA Update ✅
This is verified good as follows:
- Tested on MacOS Ventura Chrome on WP 6.4.3 and both PHP 8.0 and PHP 7.4
- Tested on MacOS Ventura Firefox, Safari
- Results are as expected with no console errors when updating the different Gtags
- Saving a new tag also doesn't result in any error.
- Video is attached for reference
Moving this ticket to 'Approval' column.
Video Reference
https://github.com/google/site-kit-wp/assets/125576926/ceee3fc3-c14b-4ee2-9649-ac92fd020723