For the complete documentation index, see llms.txt. This page is also available as Markdown.

Apps Flyer API

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

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")
import { setCustomerUserId } from "webtonative/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
})
import { logEvent } from "webtonative/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.

const { appsflyer: AppsFlyer } = window.WTN

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

getAppsFlyerAppId({
    callback: (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