site-kit-wp icon indicating copy to clipboard operation
site-kit-wp copied to clipboard

Tagmanager error:"Not found or permission denied." console error showing when user selects different tag manager a/c.

Open mohitwp opened this issue 1 year ago • 1 comments

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

  1. Set up tag manger.
  2. Open console and during set up change tag manager a/c.
  3. See error.

OR

  1. Set up tag manger.
  2. After set up open tag manager settings in edit mode.
  3. Select different tag manager a/c from drop down.
  4. See error.
  5. Clear console while switching a/c.

Screenshots

image

image

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 selectAccount to set the accountID and reset other IDs all at once using setSettings instead 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

mohitwp avatar Feb 26 '24 15:02 mohitwp

IB ✔️

eugene-manuilov avatar Feb 27 '24 13:02 eugene-manuilov

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

kelvinballoo avatar Apr 02 '24 11:04 kelvinballoo