UX: `useSnippet` setting requires manual save after programmatic toggle
Bug Description
When GA snippet is manually inserted and Analytics is connected in Site KIt. In Site Kit -> Analytics settings the "Let Site Kit place code on your site" switch is disabled but the confirm changes button is active even though the user has not made a change.
Steps to reproduce
- Check that the tester plugin is not manually inserting the GA snippet
- Connect Analytics in Site Kit
- Edit Analytics settings. Site Kit -> Settings -> Connected Services -> Analytics -> Edit
- Enable
Let Site Kit place code on your siteand save the settings - Manually insert GA snippet
- Edit Analytics settings. Site Kit -> Settings -> Connected Services -> Analytics -> Edit
- "Let Site Kit place code on your site" is disabled but the confirm changes button is active
Screenshots

Additional Context
This started occurring after implementing a fix for https://github.com/google/site-kit-wp/issues/2909
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
- When an existing tag is detected while in the Analytics settings panel, the "Confirm Changes" button should not be enabled until the user has actually changed a setting. It should not be enabled just because Site Kit automatically set
useSnippettofalseon the client-side. - If Site Kit automatically changes the
useSnippetsetting due to an existing tag being found (i.e. deactivates the toggle when it was previously activated), the change should be saved immediately (without saving any other changes the user potentially made on the page in the meantime).
Implementation Brief
Test Coverage
Visual Regression Changes
QA Brief
Changelog entry
This is more of a UX enhancement than a bug I think 🤔
I've probably misinterpreted the documentation. I think I read that if an issue occurs as a result of resolving a bug the subsequent issue is also deemed to be a bug.
@felixarntz should we not also inform the user when this happens? It seems like not doing so would be another UX bug where viewing a module's settings could have the side effect of changing this setting without the user knowing.
@aaemnnosttv Good point. Actually, this leads to another question too, what if the existing snippet is for a different property than what was previously selected? In that case, that would need to be automatically updated too.
I guess it makes most sense to keep this as is for now and move it back in the queue. There's some UX improvements to unpack here, but where this currently is, it doesn't feel ready for any meaningful improvements.
The behavior isn't a bug as you mentioned, rather a UX flaw, so I think we should revisit that.
Closing as we no longer change the toggled states of snippet controls based on the presence of existing tags.