Google oauth#
Google OAuth integration for connecting Google Analytics.
Provider required
All hooks require a
BrandwaveProvider ancestor in your component tree. See the React Hooks overview for setup instructions.useConnectGoogleAnalytics#
Generate a Google OAuth authorization URL for connecting Google Analytics.
Owner only
typescript
import { useConnectGoogleAnalytics } from '@brandwave/react';
const { mutate, isPending } = useConnectGoogleAnalytics();
mutate({
organizationId: 'org_123',
});Parameters#
| Name | Type | Required | Description |
|---|---|---|---|
| organizationId | string (UUID) | Required | Organization identifier. |
| redirectPath | string | — | Path to redirect to after OAuth (max 500 characters). |
Response#
Returns { data } with the result.
Underlying SDK method: bw.google.connect(params)
useSelectGoogleAnalyticsProperty#
Select a Google Analytics property for the organization.
Owner only
typescript
import { useSelectGoogleAnalyticsProperty } from '@brandwave/react';
const { mutate, isPending } = useSelectGoogleAnalyticsProperty();
mutate({
organizationId: 'org_123',
propertyId: '...',
});Parameters#
| Name | Type | Required | Description |
|---|---|---|---|
| organizationId | string (UUID) | Required | Organization identifier. |
| propertyId | string | Required | GA4 property identifier to connect (max 64 characters). |
Response#
Returns { data } with the result.
Underlying SDK method: bw.google.selectProperty(params)
useDisconnectGoogleAnalytics#
Disconnect Google OAuth and remove stored tokens.
Owner only
typescript
import { useDisconnectGoogleAnalytics } from '@brandwave/react';
const { mutate, isPending } = useDisconnectGoogleAnalytics();
mutate({
organizationId: 'org_123',
});Parameters#
| Name | Type | Required | Description |
|---|---|---|---|
| organizationId | string (UUID) | Required | Organization identifier. |
Response#
Returns { data } with the result.
Underlying SDK method: bw.google.disconnect(params)