The [Quickstart](/quickstart/) snippet has five parts when you load Google tags
yourself, and four when `bridges.google.tagId` is configured. Understanding each
means you can adapt it to any stack confidently.

## `preconnect`

```html
<link rel="preconnect" href="https://cmp.lightning-consent.io" />
```

Opens the TLS connection to the edge early so the first `GET /config` is fast.
Pure performance; optional but recommended.

## The Consent Mode default (when Google is site-hosted)

```js
gtag("consent", "default", {
  ad_storage: "denied",
  /* … */ wait_for_update: 500,
});
```

Tells every site-hosted Google tag _“assume denied until I say otherwise.”_
`wait_for_update: 500` gives the CMP up to 500&nbsp;ms to resolve the stored
decision before Google tags act. **This block must run before any site-hosted
Google tag.**

If you configure `bridges.google.tagId` for GTM, GA4, or Ads, leave this block
out. The Google bridge pushes the default itself immediately before it loads the
tag, so duplicating the default only adds config noise.

## The async queue stub

```js
!(function (c) {
  c.lightning =
    c.lightning ||
    function () {
      (c.lightning.q = c.lightning.q || []).push(arguments);
    };
})(window);
```

Defines a temporary `lightning()` that records calls into a queue; when `cmp.js`
loads it replays them in order. This is what lets you load the SDK `async` and
still call `lightning('init', …)` immediately, without race conditions.

## The SDK and `init`

```html
<script
  async
  src="https://cmp.lightning-consent.io/v1/cmp.js?k=YOUR_LICENSE_KEY"
></script>
<script>
  lightning("init", { theme: "light" });
</script>
```

The SDK (~12&nbsp;KB gzipped), `async`, never render-blocking. The `?k=` license
key authorises backend calls and carries your `siteId`, so you rarely set it in
[`init()`](/api/config-reference/).

:::caution[Cloudflare Rocket Loader and “defer all JS” optimisers]
Rocket Loader (and WP Rocket, LiteSpeed, NitroPack…) rewrite and re-order your
scripts, pushing the Consent Mode default so late that Google tags initialise
first — GTM Preview then reports _“a tag read consent state before a default was
set.”_ Add `data-cfasync="false"` to every Lightning `<script>`. See
[Troubleshooting](/guides/troubleshooting/).
:::

:::note[More detail coming]
The complete walkthrough is being migrated from `docs/INSTALL.md` § _“The
universal snippet, explained line by line.”_
:::