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

# Install and verify website tracking

> Publish the tracking script, connect consent, and confirm the first received event.

Website setup is complete when ownership is verified, the script is published, and an event is received. You need website publishing access plus either DNS access or permission to serve a verification file. A website owner or editor can configure the installation.

## Add and verify the site

1. Open [Websites](https://app.autoady.io/web-analytics) and choose **Add website** when available.
2. Enter **Website name**, **Public HTTPS domain**, **Timezone**, and **Currency**. Save, then open **Install & settings**.
3. Copy **Add DNS record**, or **Or publish an HTTPS verification file**. Publish the exact TXT value or file contents for this site. If your DNS provider appends the domain, use `_autoady` in its Host field.
4. Choose **Check DNS**. Confirm **Domain verified**. This control checks the supported DNS or file proof; it does not install the script.

## Publish the script

Select the intended **Test** or **Production** environment in Websites. Copy **Install tracking** from this site's **Install & settings** panel. Its public website key belongs in the browser; your server ingestion key does not.

For an HTML website, paste the supplied script once, just before the closing `</head>` in the shared page template. Preserve its `src`, `data-endpoint`, `data-key`, and `data-environment`. For a site builder or CMS, use its supported site-wide head/custom-code field and publish the change using that platform's own controls. These are external website actions, not AutoAdy settings.

Illustrative placement; replace the comment with the complete snippet copied from your site:

```html theme={null}
<head>
  <!-- Existing page metadata -->
  <!-- Paste your AutoAdy Install tracking script here, once. -->
</head>
```

Include it on the pages you intend to measure. Check the deployed page source or browser's Network panel for the copied script, then connect consent below. Script presence proves installation, not event delivery. Avoid adding a second copy through another plugin or tag manager.

## Connect consent: Cookiebot example

The SDK starts with analytics and marketing off. Connect your site's actual consent manager; a copied script alone will not send page views. This example maps Cookiebot's **statistics** permission to analytics and **marketing** permission to marketing, including existing choices, later changes, and refusal.

Install and configure Cookiebot using its own instructions first. Place this adapter in your site's shared script/custom-code area so it runs on each measured page. It uses the SDK's queue if the asynchronous AutoAdy script has not loaded yet.

```javascript theme={null}
(function () {
  let lastConsent;

  function syncCookiebotConsent() {
    const consent = {
      analytics: window.Cookiebot?.consent?.statistics === true,
      marketing: window.Cookiebot?.consent?.marketing === true
    };
    const signature = JSON.stringify(consent);
    if (signature === lastConsent) return;
    lastConsent = signature;

    if (window.autoadyAnalytics?.consent) {
      window.autoadyAnalytics.consent(consent);
    } else {
      (window.autoadyAnalyticsQueue =
        window.autoadyAnalyticsQueue || []).push(["consent", consent]);
    }
  }

  ["CookiebotOnConsentReady", "CookiebotOnAccept", "CookiebotOnDecline"]
    .forEach(name => window.addEventListener(name, syncCookiebotConsent));
  syncCookiebotConsent();
})();
```

Cookiebot's events and consent properties are described in its [official developer API](https://www.cookiebot.com/en/developer/). The mapping and queue above are the AutoAdy integration example. Configure your consent manager's own blocking rules so the adapter can observe consent changes; do not replace the visitor's choices with hardcoded `true` values.

Granting analytics starts the initial page view automatically. Revoking it stops collection and clears analytics state. Marketing remains off under Global Privacy Control even if the consent manager allows it. For another consent manager, map its equivalent initial/change/revocation callbacks to the **Consent change handler** shown in AutoAdy.

## Prove the first event

1. Publish the website and consent adapter. Open the exact HTTPS domain and a measured page.
2. Make an analytics consent choice in the banner. In a separate test, refuse or revoke consent and confirm collection stops.
3. Return to **Install & settings**. Confirm the **Test first event** or **Production first event** timestamp for the environment installed.
4. Refresh the report in that same environment and check the page visit. Test events do not enter production reporting.

For a final production installation, copy the production snippet, publish it, and confirm **Production first event**. A successful test visit does not switch your website to production automatically.

## Optional: install in a GitHub HTML file

> **Review and apply a supported single-file installation**
>
> The **Install with agent** panel supports a connected GitHub HTML file with a closing head tag. It does not install arbitrary CMS plugins or deploy your website for you. Start with an active, verified site and owner/editor access.
>
> 1. Choose **Connect GitHub file**. Supply the owner/organization, repository, deployment branch, HTML path, and a fine-grained GitHub token with Contents read/write access for that repository. Choose **Connect file**.
> 2. Choose **Inspect and prepare installation**. Review the proposed insertion before the closing head tag, file path, branch, and script configuration.
> 3. Type the exact domain requested by the approval control, then choose **Apply reviewed change**. Confirm the returned GitHub commit before deploying your website.
> 4. If the request remains applying, use **Check installation request** to check that same request. After a failure or completed source installation, use **Start a fresh inspection** when preparing a new change.
> 5. Deploy through your website's usual workflow, enter the **Page path on \[your domain]** field, and choose **Check deployed page**. Then verify a consented production event as above.
>
> **Disconnect repository** removes the repository connection; it does not remove the already installed website script. HTML inspection can confirm the configured script or integration exists, but the first received event is the execution check.

## If the checks disagree

| State | Recovery |
| - | - |
| Ownership fails | Check the copied hostname/value or public file contents; allow DNS propagation, then repeat **Check DNS**. |
| No tracking snippet | Reload the site's setup. An owner/editor can view it; a missing tracking endpoint needs [support](/help/contact). |
| Verified, no event | Check the published script, environment, key, page coverage, and consent callback. Inspect script/network errors and browser blocking. |
| Only test events | Publish the production snippet and view Production before checking live reporting. |
| GitHub source changed after preview | Start a fresh inspection and review the new change before applying it. |

Next: [track actions and outcomes](/websites/events) or [configure event destinations](/websites/destinations).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.