# Initialization

{% hint style="info" %}
For optimal performance, it is recommended that you insert the code directly into your site, rather than using tag managers like Google Tag Manager. Otherwise, you may experience data losses or discrepancies. It's also recommended to put it in the header of the site
{% endhint %}

To begin using EdgeTag, you need to load our script and initialize it. The script will be loaded from our `/load` endpoint. This script is dynamically generated based on your channel configurations, ensuring that only the necessary components are included to maintain your website's optimal performance. We will **automatically include all browser pixels** that you configured.

{% hint style="warning" %}
Ensure you replace the example URL `https://d.mysite.com` with the one generated for you in the app.
{% endhint %}

{% code overflow="wrap" %}

```html
<script>
  window.edgetag=window.edgetag||function(){(edgetag.stubs=edgetag.stubs||[]).push(arguments)};

  edgetag('init', {
    edgeURL: 'https://d.mysite.com',
    disableConsentCheck: true
  })
</script>
<script async type="text/javascript" src="https://d.mysite.com/load"></script>
```

{% endcode %}

The second part of the snippet is the initialization, specifically the call to the init function. Available parameters for the init function are:

| Name                | Type    | Required | Description                                                                                     |
| ------------------- | ------- | -------- | ----------------------------------------------------------------------------------------------- |
| edgeURL             | String  | Yes      | EdgeTag URL that you received as part of onboarding.                                            |
| disableConsentCheck | Boolean | No       | If you don't have consent on your site, you can disable it with this flag.                      |
| userId              | String  | No       | If you would like to set custom id for your first party cookie, you can pass unique identifier. |

Now that we have a snippet on the site and have initialized it, let's discuss multiple instances, as you can have multiple EdgeTag instances on the same site.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.edgetag.io/implementation/browser/initialization.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
