Events

Sending events to different channels is easy with EdgeTag. Events can be anything really: clicking on a button, submitting a form, typing in input, page load, text hover, etc.

To ensure we can support multiple channels without requiring you to worry about the payloads and the specific needs of each channel, we have created standard events. This approach enables us to precisely identify the data we receive on the platform and how to transform it in real-time before sending it to its final destinations.

Parameters

Name
Type
Required
Description

name

String

Yes

Name of the event that you are capturing.

data

Record<string, any>

No

Additional data that you would like to send as part of the event.

providers

Record<string, boolean>

No

Define for which providers you would like to send this event. By default, we send to all of them.

options

{ method?: 'beacon', sync?: true, destination?: string }

No

See below

Options

Method: If you provide the method with a value beacon, we will send this event through a beaconarrow-up-right delivery mechanism instead of a regular fetch.

Sync: Setting sync to true will cause the request to wait for all channels to complete their actions before responding. This may lead to more canceled events in browsers, as some channels might need more time to respond.

Destination: We recommend specifying the destination, especially if multiple EdgeTag instances exist on the website. If you do not, we will trigger the same event to multiple destinations. The destination value should be the EdgeTag URL.

Examples

simple PageView
edgetag('tag', 'PageView')
AddToCart with a payload
edgetag('tag', 'AddToCart', { value: 10.0, currency: 'USD' })
PageView which we only want to send to Meta channel
edgetag('tag', 'PageView', {}, { facebook: true })
PageView where you define to which destination it should be send
edgetag('tag', 'PageView', {}, {}, { destination: 'https://d.domain.com' })

Last updated

Was this helpful?