Google oauth#

Google OAuth integration for connecting Google Analytics.

Connect google analytics#

Generate a Google OAuth authorization URL for connecting Google Analytics.

Owner only
typescript
const { data } = await bw.google.connect({
  organizationId: 'org_123',
});

Parameters#

NameTypeRequiredDescription
organizationIdstring (UUID)RequiredOrganization identifier.
redirectPathstringPath to redirect to after OAuth (max 500 characters).

Response#

Returns { data } with the result.

Select google analytics property#

Select a Google Analytics property for the organization.

Owner only
typescript
const { data } = await bw.google.selectProperty({
  organizationId: 'org_123',
  propertyId: '...',
});

Parameters#

NameTypeRequiredDescription
organizationIdstring (UUID)RequiredOrganization identifier.
propertyIdstringRequiredGA4 property identifier to connect (max 64 characters).

Response#

Returns { data } with the result.

Disconnect google analytics#

Disconnect Google OAuth and remove stored tokens.

Owner only
typescript
const { data } = await bw.google.disconnect({
  organizationId: 'org_123',
});

Parameters#

NameTypeRequiredDescription
organizationIdstring (UUID)RequiredOrganization identifier.

Response#

Returns { data } with the result.