c15t 3.1: one event call for your analytics integrations
Send an event once to PostHog, Google Analytics, and other supported integrations. Version 3.1 exposes the shared dispatcher in every framework, with consent checks built in.
Founder
- 4 min
- Engineering
Send each event once. The dispatcher sends it to your configured analytics integrations, such as PostHog and Google Analytics, when the visitor’s consent permits it.
With useEventDispatcher(), your app uses one call across supported integrations. c15t maps that call to each vendor’s event method.
c15t 3.1 exposes the shared dispatcher through each framework’s hook or runtime helper. The release also adds Google Additional Consent and support for TanStack Start 1.0.
If you self-host the backend, run the database migrations before you deploy 3.1. Migration 9 adds a column that every consent save needs.
One call to PostHog, Google Analytics, and more
Your component no longer needs a separate event call for each analytics tool. Register your integrations with c15t, then send the event through the dispatcher.
In React, get the dispatcher with useEventDispatcher() from c15t/react. Render this example inside your configured ConsentProvider:
With both integrations configured, the dispatcher sends the event to each destination that consent permits. It calls PostHog’s capture method and Google’s event method for you.
Add or remove a supported integration in your c15t setup. The event call in your component stays the same. Each destination receives the event data that its integration supports.
The dispatcher checks consent before it sends the event. If the visitor withdraws consent before the event, the dispatcher drops it. Calls that bypass c15t still need their own consent checks.
Each framework exposes the dispatcher through its own hook or runtime helper. The release notes list the import for each framework.
Dispatchers from the same c15t provider share pageview history. A consent change or component remount no longer causes those dispatchers to drop or repeat a pageview.
Keep choices through a page change
A visitor can choose a consent option, then leave the page before the backend answers. Earlier versions kept the choice in the browser but could miss the backend record.
c15t 3.1 queues the choice before it sends the save. The next page load retries an interrupted save with the original decision time.
This release also fixes a PostHog race. With loadMode: 'after-consent', a refusal could arrive before the browser finished the script download. PostHog then started when the download finished.
The refusal now clears the queued start. PostHog stays off when that download completes.
Show the vendor choices you need
Your visitors get category switches unless you declare vendors. A script helper alone no longer adds a separate switch for its vendor.
If a visitor previously turned off a helper’s vendor, that vendor stays visible. Their saved refusal still blocks it. They can change that choice in the preference dialog.
Sites that use the IAB Transparency and Consent Framework (IAB TCF) can now add Google Additional Consent. It covers Google ad tech providers outside the IAB Global Vendor List.
Each configured provider appears with its privacy policy and a consent switch. c15t saves those choices with the visitor’s TCF consent.
A provider counts as consented only when its switch is on and the visitor consents to TCF purposes 1, 3, and 4.
The release also fixes dialog scroll problems on phones. Visitors can reach categories and vendors when app styles previously blocked the list.
Use TanStack Start 1.0
You can use c15t with TanStack Start 1.0. The adapter now builds and tests against it.
If you move to TanStack Start 1.0, upgrade to Vite 8 first. Upgrade TanStack Start and its router together, because Start depends on an exact router version.
Check these details before you upgrade
- Self-hosted backend: Run migration 9 before deployment, even if the site does not use Google Additional Consent.
- Custom IAB translations: Add
adTechProvidersHeadingandadTechProvidersNoticetoIABPreferenceCenterTranslations.vendorList. Built-in translations include both. - Typed
__tcfapicallbacks: CheckgdprAppliesbefore use oftcString. Callbacks now acceptTCData | TCDataOutsideTCF. - Vendor switches: Declare at least 1 vendor if you want switches for the vendors from your integration helpers. Script load rules stay the same.
- Svelte: Use Svelte 5.20.0 or a later Svelte 5 release.
Read the complete 3.1.0 release notes for package versions, configuration, and the full list of fixes.