Apps Flyer

Integrate AppsFlyer analytics in your WebToNative app to track custom user IDs, log events, and retrieve the AppsFlyer device identifier.

circle-info

You'll need to import the javascript file in your website before starting from this link.

1

setCustomerUserId(userId)

To Set Custom User Id

const { appsflyer: AppsFlyer } = window.WTN

AppsFlyer.setCustomerUserId("CUSTOM_USER_ID")
2

logEvent(eventName, eventValues)

To Push Event

const { appsflyer: AppsFlyer } = window.WTN

AppsFlyer.logEvent("ADD_TO_CART", {
    name: "Cadburry",
    quantity: 1
})
3

getAppsFlyerAppId()

To retrieve the AppsFlyer unique device identifier (AppsFlyer ID) for the current app installation.

circle-check
const { appsflyer: AppsFlyer } = window.WTN

AppsFlyer.getAppsFlyerAppId({
    callback: function (response) {
        console.log(response.appsFlyerId) // AppsFlyer unique device ID
    }
})

Callback Response

Property
Type
Description

type

string

Always "getAppsFlyerAppId"

appsFlyerId

string

The AppsFlyer unique device identifier

Example Response

{
    "type": "getAppsFlyerAppId",
    "appsFlyerId": "1234567890123-1234567"
}

Last updated