firebase-analytics icon indicating copy to clipboard operation
firebase-analytics copied to clipboard

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

Open ptmkenny opened this issue 4 years ago • 1 comments

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."

ptmkenny avatar May 26 '21 04:05 ptmkenny

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.

brownoxford avatar May 26 '21 13:05 brownoxford