Channel

The last API that you will need to call is for adding a channel. We support a wide range of channels. We suggest starting with one that suits you the most and then adding the others later on.

Each channel has a configuration that you should check on the channel integration page. Use that as a reference for each channel. In our example, we will use Segment as it only has one secret.

On our secret page, you can see how you can encrypt your values, which will be passed in the API.

For consentCategory you can provide the following values:

  • necessary

  • advertising

  • analytics

  • functional

  • share_pii

shouldDeploy Indicates if, when the channel is added, infrastructure should be deployed/updated, or if you will be adding more channels and deploy it at the end. Until you deploy, your changes will not be visible.

POST /script

fetch('https://api-sandbox.edgetag.io/script', {
  method: 'POST',
  headers: {
    'Accept': 'application/json',
    'Authorization': 'Bearer your-token',
    'Team-Id': '{your-team-id}'
  },
  body: JSON.stringify({
    name: 'Pixel',
    providerId: 'segment',
    tagId: '{tagId}',
    shouldDeploy: true,
    consentCategory: 'advertising',
    secrets: [
      {
        variable: 'SEGMENT_TOKEN',
        type: 'PASSWORD',
        optional: false,
        data: 'kZi3giHyCnT5WAAhdZ6X8Q==',
        key: 'uNLgTIjNI8fICSt7bT7XmFlNgUVLXIk0JKNk51DOaLI3qis097XzgX5HxwG3yOX488YC4EMQRqU9GU8591R/zHN8DEpSgp5Zqu1YR4mTh4wfYVEsffRZIdo97F8dVjP/9nHiBiuf0bb+arxNDgl1PRXdvWu/N3eliOWa6dyoriY=',
        iv: '2c3eaaed73fe85c1dc5f97f724230adc',
        salt: 'd676d4b53c06585e',
      },
    ]
  })
})

You are now good to go. Your first website is live with channel integration. 🎉

Now that the infrastructure is set up, you will need to add our small JavaScript snippet to the website.

Overviewchevron-right

Last updated

Was this helpful?