> ## 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.

# HTML and script tag

> Install Biqli on a website without a package manager.

Use the global script when your site uses plain HTML, a site builder, or a framework that can add one script to every tracked page.

## Add the script

Place this once inside `<head>`:

```html theme={null}
<script
  src="https://biq.li/sdk/dist/auto.global.js"
  data-publishable-key="biqli_pk_xxxxxxxxx"
  data-attribution-model="last-click"
></script>
```

The script creates `window.Biqli`, initializes one managed SDK instance, captures `bq_id`, and watches single-page navigation.

## Supported attributes

| Attribute                | Meaning                                         |
| :----------------------- | :---------------------------------------------- |
| `data-publishable-key`   | Required browser key beginning with `biqli_pk_` |
| `data-api-host`          | Optional API host or fixed reverse-proxy base   |
| `data-attribution-model` | `first-click` or `last-click`                   |
| `data-outbound-domains`  | Comma-separated exact or wildcard hostnames     |
| `data-query-parameters`  | Comma-separated click-ID query parameters       |
| `data-manual-start`      | Use `true` to delay lifecycle startup           |
| `data-consent`           | Use `false` when consent is not yet granted     |

## Track a lead

```html theme={null}
<script>
  async function recordSignup(customer) {
    await window.Biqli.trackLead({
      eventId: `signup:${customer.id}`,
      eventName: 'Signed up',
      customerExternalId: customer.id,
      customerName: customer.name,
      customerEmail: customer.email,
    });
  }
</script>
```

## Track a sale

```js theme={null}
await window.Biqli.trackSale({
  customerExternalId: 'customer_1842',
  amount: 4999,
  currency: 'usd',
  paymentProcessor: 'custom',
  invoiceId: 'order_9381',
});
```

## Useful global methods

```js theme={null}
Biqli.getClickId();
Biqli.setClickId('known_click_id');
Biqli.clearClickId();
Biqli.setConsent(true);
Biqli.decorateUrl('https://checkout.example.com/cart');
Biqli.teardown();
```

Do not add the script more than once. The verifier reports duplicate installations because multiple SDK instances can create competing lifecycle handlers.
