Skip to main content

Web layer (Web SDK)

After you complete Getting started with the TWA SDK, the web portion of your TWA app uses the Adtrace Web SDK for install (on first open), sessions, events, callbacks, and attribution.

There is no separate TWA event or callback API. The only TWA-specific step is passing device IDs from the native launch URL into initSdk (see Initialize the Web SDK). After that, follow the Web SDK documentation.

What is different in TWA vs a browser PWA?

TopicBrowser PWATWA
Device IDsRead by Web SDK in the browserPassed from native Android via launch URL query parameters
Install test IDweb_uuid in Testing Consolegps_adid in Testing Console
Test deviceBrowser on mobile recommendedPhysical mobile phone or Google Play emulator required
Native Android SDK initNot used for attributionUsed only to read gps_adid before launch

Everything else ( trackEvent, attributionCallback, partner parameters, revenue, deduplication, and so on) is identical to the Web SDK.

Before events and callbacks

Install first

Before you send events or rely on attribution callbacks, verify install was recorded for the device. If no install is recorded, Adtrace may store events but they will not appear in panel statistics.

  1. Finish TWA integration including Web SDK initSdk.
  2. Test on a physical mobile phone or Google Play emulator.
  3. Confirm install in the Testing Console using gps_adid.

If gps_adid is missing on the web side, see FAQ.

Web SDK guides

Use these docs for implementation details. API names, parameters, and examples are the same in TWA.

Quick reference

// Same as Web SDK after TWA initSdk (with gps_adid from launch URL)
Adtrace.trackEvent({
eventToken: 'YOUR_EVENT_TOKEN',
});
Adtrace.initSdk({
appToken: 'YOUR_APP_TOKEN',
environment: 'sandbox',
gps_adid: gpsAdidFromLaunchUrl,
attributionCallback: function (e, attribution) {
// Same Web SDK callback
},
});