Initialization

To begin using EdgeTag, you need to add our NPM packagearrow-up-right and initialize it. You can add our package to your project by running the following command:

npm i @blotoutio/edgetag-sdk-js

Now that our package is installed we need to initialize it. Our package should be initialized only once per full reload (do not initialize it when doing navigation with JS router).

circle-exclamation
import { init } from '@blotoutio/edgetag-sdk-js'

init({
  edgeURL: 'https://d.mysite.com',
  disableConsentCheck: true
})

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.

providers

Provider[]

No

Browser pixels that need to be added for specific channels

circle-exclamation
Initialization with browser pixel added
import { init } from '@blotoutio/edgetag-sdk-js'
import facebook from '@blotoutio/providers-facebook-sdk'

init({
  edgeURL: 'https://d.mysite.com',
  disableConsentCheck: true,
  providers: [facebook]
})

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?