Conversion sources#

Manage conversion sources (HDYHAU surveys, UTM links, etc.) that attribute conversions to marketing activities.

Provider required

All hooks require a BrandwaveProvider ancestor in your component tree. See the React Hooks overview for setup instructions.

useListConversionSources#

List conversion sources with pagination, search, and sorting.

typescript
import { useListConversionSources } from '@brandwave/react';

const { data, isLoading } = useListConversionSources({
  pageIndex: 0,
  pageSize: 25,
  organizationId: 'org_123',
});

Parameters#

NameTypeRequiredDescription
pageIndexintegerRequiredZero-based page index for pagination.
pageSizeintegerRequiredNumber of items per page (1-100).
organizationIdstring (UUID)RequiredOrganization identifier.
searchTermstringFree-text search term to filter results (max 200 characters).
sortBystringColumn name to sort by.
sortDirection'asc' | 'desc'Sort direction: ascending or descending.

Response#

Returns { items, totalCount, facets } with paginated results.

Underlying SDK method: bw.conversionSources.list(params)

useConversionSource#

Retrieve a single conversion source by ID.

typescript
import { useConversionSource } from '@brandwave/react';

const { data, isLoading } = useConversionSource({
  id: 'abc-123',
});

Parameters#

NameTypeRequiredDescription
idstring (UUID)RequiredConversion source identifier.

Response#

Returns { data } with the result.

Underlying SDK method: bw.conversionSources({ id })

useCreateConversionSource#

Create a new conversion source with a marketing channel category for tracking attribution.

typescript
import { useCreateConversionSource } from '@brandwave/react';

const { mutate, isPending } = useCreateConversionSource();

mutate({
  organizationId: 'org_123',
  name: 'My Campaign',
  type: 'instagram_post',
  category: '...',
});

Parameters#

NameTypeRequiredDescription
organizationIdstring (UUID)RequiredOrganization identifier.
namestringRequiredConversion source name.
type'hdyhau' | 'promo_code' | 'tracking_link'RequiredAttribution method type.
category'organic_social' | 'podcast' | 'events' | 'paid' | 'referral' | 'other'RequiredMarketing channel category.
channel'instagram' | 'youtube' | 'tiktok' | 'twitter' | 'linkedin' | 'reddit' | nullSocial media platform for this conversion source.
creatorIdstring (UUID)Creator associated with this source.
campaignIdstring (UUID)Campaign associated with this source.
codestringPromo code or tracking code (max 255 characters).
urlstring (URL)Tracking URL for link-based attribution (max 2,048 characters).

Response#

Returns { data } with the result.

Underlying SDK method: bw.conversionSources.create(params)

useUpdateConversionSource#

Update a conversion source attribution type, category, social media channel, creator or campaign association, promo code, or tracking URL.

typescript
import { useUpdateConversionSource } from '@brandwave/react';

const { mutate, isPending } = useUpdateConversionSource();

mutate({
  id: 'abc-123',
});

Parameters#

NameTypeRequiredDescription
idstring (UUID)RequiredConversion source identifier to update.
namestringUpdated name (1-255 characters).
type'hdyhau' | 'promo_code' | 'tracking_link'Updated attribution type.
category'organic_social' | 'podcast' | 'events' | 'paid' | 'referral' | 'other'Updated category.
channel'instagram' | 'youtube' | 'tiktok' | 'twitter' | 'linkedin' | 'reddit' | nullUpdated social media platform.
creatorIdstring (UUID) | nullUpdated creator association.
campaignIdstring (UUID) | nullUpdated campaign association.
codestring | nullUpdated promo/tracking code (max 255 characters).
urlstring (URL) | nullUpdated tracking URL (max 2,048 characters).
isActivebooleanWhether this source is active.

Response#

Returns { data } with the result.

Underlying SDK method: bw.conversionSources.update(params)

useDeleteConversionSource#

Permanently delete a conversion source and disassociate its conversions.

typescript
import { useDeleteConversionSource } from '@brandwave/react';

const { mutate, isPending } = useDeleteConversionSource();

mutate({
  id: 'abc-123',
});

Parameters#

NameTypeRequiredDescription
idstring (UUID)RequiredConversion source identifier to delete.

Response#

Returns { data } with the result.

Underlying SDK method: bw.conversionSources.delete(params)

Cascading effect

Deleting a conversion source removes the source attribution from all linked conversions. The conversion records themselves are preserved.