capacitor-community / firebase-analytics

Enable Firebase Analytics for Capacitor Apps
MIT License
162 stars 64 forks source link

Docs: What is meant by "clears all analytics data"? #90

Open ptmkenny opened 3 years ago

ptmkenny commented 3 years ago

Describe the bug

In the docs for .reset(), it states:

* Clears all analytics data for this app from the device and resets the app instance id.

What does "all analytics data" mean? I thought that this would clear the Google Analytics cookies from the web browser, but it does not.

To Reproduce

I'm using an Ionic React app with Capacitor 3 that automatically enables/disables Firebase Analytics when the user logs in (based on a value on the returned user object).

export const activateAnalytics = (status: boolean): void => {
  console.log('analytics setup based on status', status);
  FirebaseAnalytics.setCollectionEnabled({
    enabled: status,
  });
  if (!status) {
    FirebaseAnalytics.reset();
  }
};

However, when a user with analytics disabled logs in to the Ionic app from the web, tracking stops as expected (according to Firebase Analytics real-time dashboard), but the GA cookies remain in the browser.

Is this the expected behavior (cookies remain after calling FirebaseAnalytics.reset()? If so, I suggest updating the documentation to say something like, "This does not clear the GA cookies."

brownoxford commented 3 years ago

In looking at the code, the reset() does not even appear to be implemented for web. I think we should update the documentation to reflect that by removing the green checkbox.