Skip to content
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

Update Default Value of isEnabled Setting to false for First-Party Mode #9828

Closed
hussain-t opened this issue Dec 6, 2024 · 2 comments
Closed
Labels
P0 High priority Team M Issues for Squad 2 Type: Enhancement Improvement of an existing feature

Comments

@hussain-t
Copy link
Collaborator

hussain-t commented Dec 6, 2024

Feature Description

Currently, the default value for the isEnabled setting of First-Party Mode is set to null. When toggling the switch for the first time, if the user turns it "on" and "off" again, the submit CTA text in the Analytics and Ads settings forms remain as "Confirm changes" instead of reverting back to "Save" due to the change being tracked from null to `false'.

To resolve this issue and improve the user experience, we need to update the default value of the isEnabled setting to false.


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

  • The default value for the isEnabled setting in First-Party Mode should be updated from null to false.
  • When toggling the First-Party Mode switch for the first time in the Analytics and Ads settings forms:
    • If the user toggles the switch "on" and "off" again, the submit CTA text should revert back to "Save" instead of remaining as "Confirm changes".
  • This change should be applied consistently across both the Analytics and Ads settings forms.
  • Note: The First-Party Mode toggle switch component is being integrated into Analytics and Ads settings forms in Integrate First-Party Mode Toggle into Analytics Settings Form #9654 and Integrate First-Party Mode Toggle into Ads Settings Form #9655, respectively.

Implementation Brief

In includes/Core/Tags/First_Party_Mode/First_Party_Mode_Settings.php:

  • Locate the First_Party_Mode_Settings::get_default method.
  • Update the default value for the isEnabled setting from null to false.

In assets/js/googlesitekit/datastore/site/first-party-mode.js:

  • Review and update JSDoc @return directives in selectors to reflect the above change.

Test Coverage

  • Update the First_Party_Mode_SettingsTest PHP unit test to assert that the default value for the isEnabled setting is false.
  • Fix any failing tests related to the change in the default value.

QA Brief

  • There are no user-facing changes introduced for this update.
  • Verify that the default value for the isEnabled setting in First-Party Mode is updated to false. This can be done during the code review process.
  • Perform a smoke test to ensure that all First-Party Mode functionality continues to work as expected, based on the feature's current implementation.

Changelog entry

  • Update the default value of the First-party mode isEnabled setting to false.
@hussain-t hussain-t added P0 High priority Type: Enhancement Improvement of an existing feature Team M Issues for Squad 2 labels Dec 6, 2024
@hussain-t hussain-t assigned hussain-t and unassigned hussain-t Dec 6, 2024
@techanvil techanvil self-assigned this Dec 6, 2024
@techanvil
Copy link
Collaborator

IB ✅

@techanvil techanvil removed their assignment Dec 6, 2024
@hussain-t hussain-t self-assigned this Dec 6, 2024
@hussain-t hussain-t removed their assignment Dec 9, 2024
@techanvil techanvil self-assigned this Dec 9, 2024
techanvil added a commit that referenced this issue Dec 9, 2024
…ault-value

Enhancement/#9828 - Update Default Value of `isEnabled` Setting to `false` for First-Party Mode
@techanvil techanvil removed their assignment Dec 9, 2024
@wpdarren wpdarren self-assigned this Dec 9, 2024
@wpdarren
Copy link
Collaborator

wpdarren commented Dec 9, 2024

QA Update: ✅

Verified:

  • Performed a smoke test to ensure that all First-Party Mode functionality continues to work as expected.
    • Set up the feature via the CTA banner, made sure that the Ads and Analytics module settings reflected that the FPM is enabled.
    • Checked the source code to make sure measurement.php is appearing in the code when the feature is enabled.
    • Checked the source code to make sure googletag is appearing in the code when the feature is disabled.
    • Checked to make sure that the feature can be enabled and disabled within the settings
    • Checked Google Analytics to make sure that visits are getting tracked when FPM is enabled and disabled.
Screenshots

Image
Image
Image
Image

@wpdarren wpdarren removed their assignment Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P0 High priority Team M Issues for Squad 2 Type: Enhancement Improvement of an existing feature
Projects
None yet
Development

No branches or pull requests

4 participants