Initialization
To begin using EdgeTag, you need to add our NPM package and initialize it. You can add our package to your project by running the following command:
npm i @blotoutio/edgetag-sdk-jsNow 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).
Ensure you replace the example URL https://d.mysite.com with the one generated for you in the app.
import { init } from '@blotoutio/edgetag-sdk-js'
init({
edgeURL: 'https://d.mysite.com',
disableConsentCheck: true
})Available parameters for the init function are:
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
If you would like to add any browser pixels/scripts (such as a Meta pixel), you need to install the corresponding npm packages for that specific channel. See Browser packages docs for more info!
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?

