question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

GA4 settings persist after Analytics is deactivated

See original GitHub issue

Bug Description

When disconnecting a module, its settings are always deleted by the Module::on_deactivation method. However, due to some ga4-specific implementation details, this doesn’t happen for GA4.

Steps to reproduce

  1. Enable ga4setup
  2. Setup Analytics with a GA4 property
  3. Deactivate the Analytics module
  4. Go to /wp-admin/options.php
  5. See googlesitekit_analytics-4_settings is still present. Alternatively, with wp-cli you could use wp option get googlesitekit_analytics-4_settings

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

Acceptance criteria

  • When ga4setup is enabled, the GA4 module should be deactivated when Analytics is deactivated

Implementation Brief

Test Coverage

  • N/A

Visual Regression Changes

  • N/A

QA Brief

  • Activate the Analytics module and select an account with both UA and GA4 properties on the setup form.
  • Go to the Analytics settings and make sure that you see GA4 property in the settings view.
  • Disconnect the Analytics module.
  • Verify that the following commands return empty settings for analytics and analytics-4:
    wp option get googlesitekit_analytics_settings
    wp option get googlesitekit_analytics-4_settings
    

Changelog entry

  • Fix a bug where GA4 settings were not cleared when deactivating Analytics.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Hazlittecommented, Jun 24, 2021

@aaemnnosttv Oops, yes you are right. I meant the settings values in the options table. 🤦‍♂️

1reaction
eugene-manuilovcommented, Jun 23, 2021

Sounds good to me, @aaemnnosttv. Let’s go with your branch then. Could you please create a PR for your branch and update the IB?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Universal Analytics will be going away - Google Support
After July 1, 2023, you'll be able to access your previously processed data in your Universal Analytics property for at least six months....
Read more >
Google Analytics 4 (GA4) Data Retention Settings - Optizent
Click on admin and then go back to "Data Settings," data Retention, and change it to 14 months from 2 months. These are...
Read more >
GA4 Problems - 4 Challenges With Google Analytics 4
So, let's review 4 common GA4 problems and explore what options we have. Google made a big announcement on March 16, 2022. Universal...
Read more >
Change your Google Analytics data retention settings
In GA4, click Admin > Data Settings > Data Retention. In UA, click Admin > Tracking Info > Data Retention. The Google Analytics...
Read more >
Google Analytic GA4 does not disable default page_view ...
Try toggling the option to automatically track history events as page cries OFF from the Enhanced Measurement settings in GA4 admin (Web ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found