Analytics
Databuddy
Configure Databuddy
Copy the client ID from your Databuddy project. The helper passes it to the
script as data-client-id. Remove any existing Databuddy script and any code
that sets window.databuddyConfig. The helper seeds that global only when it
is absent, so an existing value overrides your initial state.
Register the scripts
Complete your framework quickstart first. Keep its Inth endpoint, policy, styles and consent UI. Remove the vendor's original script, SDK initializer or tag-manager entry, so the vendor loads only through c15t.
The vendor pages put the helper in src/consent-scripts.ts. If your framework
quickstart already has a scripts array, such as the one in c15t.config.ts
in the Next.js guide, add the helper to that array instead of creating a
second file.
The scripts export is a configuration, not an initializer. Add it to the c15t provider you already have, at the registration
point for your framework below. These are edits to that provider, not a second
provider.
Add the configuration to scripts in c15t.config.ts, next to
next.config.ts:
Keep the rest of your config, such as mode and routePrefix, in the
same call. ConsentRoot reads the config in the browser, so the layout
keeps passing only state. App Router, Pages Router and static export all
read the same file. See
Next.js scripts and embeds.
Options
| Option | Default | Behavior |
|---|---|---|
clientId | Required | Set as data-client-id. The helper trims it. Empty or whitespace-only values log an error and the script does not load. |
configWhenGranted | Required | Object set as window.databuddyConfig while measurement is allowed. |
configWhenDenied | Required | Object set as window.databuddyConfig while measurement is denied. |
apiUrl | https://basket.databuddy.cc | Collection endpoint, set as data-api-url. |
scriptUrl | https://cdn.databuddy.cc/databuddy.js | Loader URL override. A blank value falls back to the default. |
Loading and revocation
databuddy uses the measurement category with alwaysLoad, so the
Databuddy script loads on every page, before the visitor chooses. Before the
script loads, the helper sets window.databuddyConfig to configWhenDenied or
configWhenGranted, unless that global already exists. After the script
loads, the helper sets window.databuddy.options.disabled to true without
measurement permission and to false with it. On each later consent change,
the helper replaces window.databuddyConfig with the matching object and
updates disabled again. c15t never removes the script.
The Databuddy SDK decides what disabled stops. The helper cannot prevent the
script request before consent. If Databuddy must receive no request before
consent, write a
custom gated integration instead.
Verify Databuddy
- In a private window with an opt-in policy, load the page.
databuddy.jsloads fromcdn.databuddy.ccwith yourdata-client-id. In the console,window.databuddyConfigmatchesconfigWhenDeniedandwindow.databuddy.options.disabledistrue. - Click Reject, then reload.
disabledis stilltrue, and DevTools Network shows no event request to yourapiUrl. - Open Privacy settings and allow measurement. Without a reload,
disabledbecomesfalse,window.databuddyConfigmatchesconfigWhenGranted, and event requests reach yourapiUrl. - Turn measurement off again and save. c15t reloads the page, and the new
page starts with
disabledset totrue.
See the consent verification guide for navigation and hosting checks.