Initialization

circle-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

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.

circle-exclamation
<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>

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.

Last updated

Was this helpful?