SDK docs 0.1.0 preview
ContentsConsent, age and privacy
0.1.0 preview. You install 0.1.0 from Maven Central and NGA's public repositories. Every 0.x version is a preview under the NGA SDK License, and the API can change until 1.0. Questions: hi@nga.network.

Guide

Consent, age and privacy

View as Markdown

Tell the SDK what each player agreed to and, if your game asks, how old they are. It reads only what that allows, asks for no permission, and never shows a prompt.

Consent is two answers, each UNKNOWN, GRANTED or DENIED:

Field Covers
analytics the SDK's collection for your game: device details, advertising and vendor ids, the install referrer
adsPersonalization NGA's own use of the player's data across games, and, on Android, the advertising id on NGA's ad requests

Sessions, purchases, ad revenue and NGA's own ad events are recorded in every state, without identifiers where consent does not allow them.

UNKNOWN depends on where the player is. Where the law requires consent (at 0.1.0: the EEA, the UK, Switzerland, South Korea and Quebec), UNKNOWN counts as DENIED. Everywhere else it counts as GRANTED. NGA decides the region on its server, so a new law is a server change, not an SDK release.

Pass the player's answer #

Pass it in two places:

  • At initialize: what your consent screen last stored. The builder's value is applied field by field: GRANTED or DENIED replaces a value an earlier builder stored, and UNKNOWN keeps the stored value. So NGAConsent.unknown() at launch means "not known yet", never a withdrawal.
  • With setConsent, whenever the player answers or changes their mind. It replaces both fields (UNKNOWN included), is saved immediately (on Android, while the device's storage is unavailable, it applies at once and is saved as soon as storage is available; see Calls before initialize), and is never replaced by a later launch's builder.
  • To withdraw: setConsent with DENIED.

Unity (C#)

Android (Kotlin)

iOS (Swift)

getConsent() returns the consent the SDK is using: your answer combined with the IAB TCF keys, the stricter one winning per field.

A platform that writes the IAB keys needs no code. The SDK reads the IAB TCF, GPP and US Privacy keys from the standard store (SharedPreferences on Android, UserDefaults on iOS) at initialize, and again whenever they change. With such a platform, pass NGAConsent.unknown(), or only your own analytics answer, and let the keys decide.

  • TCF is applied on the device. Where it says GDPR applies, analytics follows your own purposes in the TC string, and adsPersonalization is DENIED.
  • GPP and US Privacy strings are sent to NGA as read. NGA honors a sale, sharing or targeted-ads opt-out, and Global Privacy Control.
  • A game that treats "no answer yet" as denied passes DENIED in both fields, not unknown(), while the platform has written nothing (an offline first launch, say), with the builder or with setConsent before initialize. The stricter of your answer and the keys wins per field, so the keys cannot widen it. Call setConsent with the platform's answer once it arrives.

A platform that writes no IAB keys (some setups of Usercentrics and TrustArc, for example, and the consent screens used in South Korea and Quebec) needs setConsent with the player's answer.

Google Consent Mode v2 maps directly: analytics_storage to analytics, ad_personalization to adsPersonalization.

Age and audience #

Each game has an audience per platform: General, Mixed or Children, the answer you give each store.

Audience Who gets child treatment
General players you set to CHILD with setAge
Mixed players you set to CHILD, and players whose age you have not set
Children every player

NGA's server applies the same rule to every request, from the audience as it is set in the portal and the age your game reported, so a change of audience does not wait for each device's next configuration.

Only a Mixed game needs setAge:

  • Call it from your age gate: CHILD for a player under the child age of their local law and your store declarations (under 13 in the US; 13 to 16 in the EEA, by country), otherwise ADULT.
  • With no age gate, every player is treated as a child, and the SDK logs one warning at init.
  • AdMob's child-directed or under-age-of-consent tags map to setAge(CHILD) for that player, or to the Children audience for the whole game.

Under child treatment:

  • The SDK reads no advertising or vendor id, and no device details beyond the coarse ones any ad needs.
  • NGA ads are chosen from context only.
  • On iOS the banner and full-screen ads still show, but their installs are not measured.
  • On Android, every ad request gets no fill until NGA completes Google Play's Families self-certification.
  • Consent can never widen child treatment.

iOS games in the App Store's Kids Category are not supported in 0.1.0. Games with a Children or Mixed audience outside that category, and every Android game, are.

App Tracking Transparency #

The SDK never shows the ATT prompt; showing it is your game's choice.

  • Without the prompt, or when the player declines, the SDK reads no IDFA. Everything else works the same; NGA's ads on iOS use no IDFA in 0.1.0.
  • When the player allows tracking and analytics is not denied, the SDK reads the IDFA and sends it to optin.nga.io (the tracking domain in its privacy manifest) once, and again only if it changes.

The SDK reads the ATT status when your game becomes active, and again 1 s, 2.5 s and 5 s later while it is not determined, so an answer given in your prompt or in Settings applies within seconds.

What each library declares #

Unity (C#)

A Unity build declares the same as the native libraries for its target: see the Android or iOS tab. On iOS, Xcode merges both frameworks' privacy manifests into your app's privacy report, as for a native app.

Android (Kotlin)

Library Adds to your merged manifest
nga-sdk nothing of its own. Its two dependencies add: the Play Install Referrer library's normal install-time permission com.google.android.finsky.permission.BIND_GET_INSTALL_REFERRER_SERVICE, and from App Set, Google Play services' GoogleApiActivity (not exported) and its version meta-data
nga-sdk-render NGA's full-screen ad Activity, not exported

The SDK uses a permission only if your app already holds it:

Permission Used for Without it
INTERNET every request to NGA nothing is sent
ACCESS_NETWORK_STATE the network type, and sending queued events when the network returns network type is not reported
com.google.android.gms.permission.AD_ID the advertising id (API 33+); declared by Google's ads-identifier library no advertising id
READ_PHONE_STATE or READ_BASIC_PHONE_STATE the cellular network generation not reported
com.android.vending.BILLING seeing Play purchases; declared by Play Billing no purchase capture

The SDK adds no <queries> element and does not read which apps are installed.

iOS (Swift)

Each framework carries its own PrivacyInfo.xcprivacy, which Xcode merges into your app's privacy report.

NGASDK NGASDKRender
NSPrivacyTracking true, for the IDFA of players who allow tracking false
NSPrivacyTrackingDomains optin.nga.io none
Accessed APIs (reason) UserDefaults (CA92.1) disk space (E174.1), file timestamp (C617.1)
Collected data types Device ID (used for tracking), User ID, Product Interaction, Advertising Data, Purchase History, Other Diagnostic Data, Other Data Types, Coarse Location Advertising Data, Product Interaction

Every collected type is linked to the user, and only Device ID is used for tracking. The SDK declares no usage string and no entitlement.

Required-reason APIs the manifest does not declare. Besides UserDefaults, NGASDK reads the device's uptime (ProcessInfo.systemUptime, mach_continuous_time), its total and free disk space (volumeTotalCapacityKey, volumeAvailableCapacityForImportantUsage) and the list of enabled keyboards (UITextInputMode.activeInputModes), as device details sent to NGA under analytics consent. Apple lists these among its required-reason APIs, and none of its approved reasons covers sending the values to a server, so the manifest does not declare them: a declared reason would not be true. NGA has accepted this review risk for 0.1.0 rather than declare a reason it does not meet. If App Review asks your game about any of them, send Apple's message to hi@nga.network; NGA answers it with you.

Hosts the SDK contacts #

Host For
api.nga.io initialization, events, ad requests
optin.nga.io iOS only: the IDFA link, only for players who allow tracking
cdn.nga.io ads' files: icons, images and videos

All three are HTTPS on port 443, TLS 1.2 or later. Nothing goes to any other host. The SDK fetches ads' files on any connection; on cellular, NGA serves smaller video files.

Store privacy forms #

These tables are guidance for filling in Google Play's Data safety form and Apple's App Privacy details for the NGA SDK's part of your game. Confirm them against your own game and with your own counsel; they are not legal advice. Every row is linked to the user, since each travels with an install id, and all data is encrypted in transit.

What the SDK sends Google Play Data safety Purposes
Device identifiers: an install id, the advertising id, App Set ID and Android ID Device or other IDs app functionality (the App Set ID: test devices, and finding a player's data for a deletion request), analytics, advertising, fraud prevention
Your customer user id, when you set one User IDs analytics
Sessions and NGA ad events App interactions analytics, advertising
Ad revenue from your mediation App interactions analytics
Purchases Purchase history analytics
Device, network and performance details, and device settings such as language Diagnostics analytics, fraud prevention
Region, from the IP address, on NGA's server Approximate location analytics, advertising
What the SDK sends Apple App Privacy Purposes
Device identifiers: an install id, the IDFV, and the IDFA for players who allow tracking Device ID analytics, third-party advertising; used for tracking (the IDFA only)
Your customer user id, when you set one; the App Store's app transaction id User ID analytics
Sessions and NGA ad events Product Interaction, Advertising Data analytics, third-party advertising
Ad revenue from your mediation Advertising Data analytics
Purchases Purchase History analytics
Device, network and performance details Other Diagnostic Data analytics, app functionality
Device settings such as language Other Data Types analytics
Region, from the IP address, on NGA's server Coarse Location analytics, third-party advertising

If your iOS game never shows the ATT prompt, the SDK never reads the IDFA, but NGASDK's manifest still declares tracking. Ask NGA (hi@nga.network) for current guidance on answering App Privacy in that case.

Opting out and deletion #

To opt a player out, pass DENIED with setConsent. There is no per-signal opt-out and no switch that turns the SDK off in code.

0.1.0 has no deletion call. To have one player's data deleted, a member of your studio writes from their address to data-deletion-request@nga.network, naming the game and one id of the player that your game can read:

  • the customer user id your game passes with setCustomerUserId;
  • or the device's vendor id, the IDFV on iOS (identifierForVendor) or the App Set ID on Android (from Google Play services), which covers that device's installs of all your games that share it: on iOS, your games in one developer account; on Android, your games from one Google Play developer account, installed from Google Play.

The SDK's own install id is never shown to your game or the player, so a request cannot name it. NGA confirms the request and deletes that player's data from its servers within 30 days during the preview; its backups age out within about 35 days.

NGA finds a player only by an id it kept from them. It keeps none for a player who has only played under child treatment, or who never granted analytics consent (where the law requires consent, UNKNOWN counts as not granted), outside a debug build in test mode; a request for such a player finds nothing, and NGA's reply says so.