Data Fetching Guide for Web SDK

Cookie ID

Use airbridge.client.clientId to get the browser cookie ID.

airbridge.fetchResource(function(res) {
    console.log(res.browser.clientId) // ex : "2bd08152-0fce-4d5e-8449-f4783b49a2c8"
})



User Agent

Use airbridge.client.ua.ua to get the browser user agent.

airbridge.fetchResource(function(res) {
    console.log(res.browser.userAgent) // ex : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36"
})



Attribution Short ID

Use airbridge.simplelink.shortId to get the "Attribution short ID". This is used for web event attribution.

airbridge.fetchResource(function(res) {
    console.log(res.attributionData.shortID)
})



Default Attribution Channel

Use airbridge.config.defaultChannel to get the default attribution channel. This is used as default when a "campaign short ID" does not exist.

airbridge.fetchResource(function(res) { 
    console.log(res.attributionData.channel) // ex : "website"
})



Default Attribution Parameters

Use airbridge.config.defaultParams to get the default attribution channel. This is used as default when a "campaign short ID" does not exist.

airbridge.fetchResource(function(res) {
    console.log(res.attributionData.params)  // ex : {medium: "posting", campaign: "blog", term: "airbridge", content: "martech-solution"}
})



Event Timestamp

Unix timestamp in milliseconds.

Date.now()  // ex : 1580887691831