Skip to content

4. Constants to use on the website

Johann Buscail edited this page Oct 21, 2021 · 4 revisions

Your website has to detect the webview for analytics reasons or other ?
You need to disable analytics if user enables App Tracking Transparency ?

A simple way to do that, is to use our constants:

  • is_webview
  • wantsPrivacy

Those constants are injected when the webview is loading.
On your website, you can directly access them like any other variable:

console.log(is_webview, wantsPrivacy);

is_webview

It's always set to true if the website loads inside a webview.
Thanks to that, you can add a tag (or whatever) to your analytic system to differentiate users using the app and the website.

wantsPrivacy

If the user enables ATT, this constant will be equal to true otherwise, it's equal to false.
With that, you can disable analytics and tracking on your website, to respect user’s privacy.

If you don't, Apple might not accept your app on the store

Clone this wiki locally