The Firebase JS SDK is now in BETA!
This EAP site is no longer maintained. See the official Firebase Documentation site for the latest documentation and information about the Firebase JS SDK.

Home > @firebase/analytics > setAnalyticsCollectionEnabled

setAnalyticsCollectionEnabled() function

Sets whether analytics collection is enabled for this app on this device. window['ga-disable-analyticsId'] = true;

Signature:

export declare function setAnalyticsCollectionEnabled(analyticsInstance: Analytics, enabled: boolean): void;

Parameters

Parameter Type Description
analyticsInstance Analytics Firebase Analytics instance.
enabled boolean If true, enables collection, if false, disables it.

Returns:

void