> ## Documentation Index
> Fetch the complete documentation index at: https://learn.biq.li/llms.txt
> Use this file to discover all available pages before exploring further.

# Cross-domain attribution

> Carry a Biqli click ID between trusted websites and checkout domains.

First-party cookies do not automatically move between unrelated domains. Cross-domain attribution adds the current `bq_id` to links that lead to a trusted receiving hostname.

Use it when a visitor moves from `www.example.com` to `checkout.example-payments.com`.

## Configure destinations

```ts theme={null}
const biqli = new BiqliAnalytics({
  publishableKey: 'biqli_pk_xxxxxxxxx',
  outboundDomains: [
    'checkout.example.com',
    '*.accounts.example.org',
  ],
});
```

The SDK decorates matching links when a visitor interacts with them. It also handles links inserted after the page loads.

For a URL created in code:

```ts theme={null}
const checkoutUrl = biqli.decorateUrl(
  'https://checkout.example.com/cart',
);
```

## Matching rules

* `checkout.example.com` matches only that exact hostname.
* `*.example.org` matches a subdomain such as `pay.example.org`.
* A wildcard does not match the apex `example.org`.
* Existing `bq_id` values are preserved.
* Relative, invalid, and unlisted destinations are not decorated.
* No URL is decorated while consent is disabled.

## Configure the receiving site

1. Add the receiving hostname under **Allowed hostnames** if it will send browser events.
2. Install the browser SDK on the receiving page.
3. Let the SDK capture `bq_id` from the URL.
4. Confirm `getClickId()` returns the forwarded value.

<Warning>
  Configure only domains you control or trust. The decorated URL exposes the click ID to the receiving site. It never exposes a publishable or secret API key.
</Warning>
