FAQ
Common questions about TWA integration, device ID handoff, and install attribution.
Why is gps_adid empty on the web side?
| Cause | Fix |
|---|---|
| TWA launched before Ad ID returned | Wait for getGoogleAdId callback, then call launchTwa(). Keep shouldLaunchImmediately() as false. |
| Key mismatch native vs web | Use the same key (for example gps_adid) in appendQueryParameter and getQueryParam. |
initSdk runs after URL changed | Read query params on the first document load, before login redirects or client-side routing. |
| Login redirect on launch | If unauthenticated users redirect to /login, query params on the launch URL are lost. Persist gps_adid (sessionStorage / localStorage) on first load, or delay redirect until params are saved and passed to initSdk. |
| Opted out of ads | User may receive a zero ID; this is expected Google behavior. |
| Non-mobile test device | Use a physical mobile phone or an emulator with Google Play support. |
Why does a login redirect drop gps_adid?
A frequent pattern that breaks TWA:
- Native opens
https://app.example.com/?gps_adid=UUID. - Web app immediately redirects unauthenticated users to
https://app.example.com/loginwithout preserving query params. gps_adidis lost;initSdkgetsnull.
Fix: On the landing URL, save device IDs to sessionStorage before any redirect:
const gpsAdid = getQueryParam('gps_adid');
if (gpsAdid) {
sessionStorage.setItem('gps_adid', gpsAdid);
}
const stored = sessionStorage.getItem('gps_adid') || gpsAdid;
Adtrace.initSdk({ /* ... */, gps_adid: stored });
Apply the same pattern on /login if that is where initSdk runs.
Why is install not appearing in the panel?
- Confirm testing on a physical mobile phone or Google Play emulator.
- Confirm install was sent before events (Web SDK sends install on first open).
- Use sandbox + verbose logs and search for errors.
- Clear storage and retest with a fresh install.
- Follow Test the integration for Testing Console steps.
Why do events work but install does not?
Install must succeed first. Events are stored but not shown in panel statistics until install is recorded. See Web layer (Web SDK).