Skip to content

Latest commit

 

History

History
23 lines (16 loc) · 569 Bytes

File metadata and controls

23 lines (16 loc) · 569 Bytes
title useSetConsentMutation

Set end-user consent state for Google Analytics across all gtag references on the page.

Usage

import { useSetConsentMutation } from "@tanstack-query-firebase/react/analytics";

const { mutate: setAnalyticsConsent } = useSetConsentMutation();

setAnalyticsConsent({
  analytics_storage: "granted",
  ad_storage: "denied",
});

Notes

  • Wraps Firebase setConsent.
  • This is a module-level API and does not require an Analytics instance.