# Attribution How NGA knows a promotion brought an install, why both games carry the SDK, and how your own MMP sees those installs too. *NGA SDK 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. This page: https://nga.io/docs/sdk/attribution/* ## Both games carry the SDK Put the SDK in the game that shows the ad and in every game it promotes. The core library alone is enough in a game that shows no NGA ads. Nothing else is needed: the two SDKs and NGA's server do the measuring. - **A tap opens the store directly**, with NGA's own click id. - **The promoted game reports its install** when it first starts, and NGA's server joins it to the tap. On Android the join is the click id, which Google Play hands to the promoted game's SDK; on iOS it is the IDFV (vendor id) the two games share. - **An install counts** when the promoted game first starts within 7 days of the tap. If the player tapped more than once, the last tap wins. Two limits: - **On iOS, both games must be in one Apple developer account.** The IDFV is shared only by one account's apps on a device. For a pair in different accounts NGA matches no iOS installs, and the report marks the pair *iOS installs not matchable* rather than showing 0. Android is unaffected. - **Only players with analytics consent, and not under child treatment,** have their installs matched. NGA's install numbers are a floor. ## When a game is promoted A game is promoted to players on a platform only after a store-installed release build has run with the SDK there. NGA cannot see installs of a game without the SDK, so such a game is never promoted. A sideloaded build, a TestFlight build or a test device's build does not count. On Google Play, a build from a testing track (internal, closed or open) counts only once its version is at or below the one your public store listing serves, as NGA last read it: a testing track ahead of production keeps the game *Pending*. The portal shows the state per platform, on the game's *Promotion*: | *State* | Means | | --- | --- | | *Waiting for the SDK* | no store build of the game has started with the SDK yet | | *Pending* | a store build has started with the SDK. On iOS, the game is promoted from its first live events. On Google Play, from the first live events of a release build installed from the store at or below the version its public listing serves | | *Promotable* | your other games can show it while its *Promoted* switch is on | You set nothing: the state follows your store builds. A host game promotes only games whose *Promoted* switch is on and that are *Promotable* on its platform. Your registered test devices do not wait; see [Test mode](https://nga.io/docs/sdk/testing/#test-mode). **A game that stays *Pending* on Google Play** while you test on a testing track is waiting for a production release that carries the SDK. Release a build with the SDK to production; NGA reads a pending game's listing again about once a day, so its state follows within about a day of the listing showing that version. ## Your MMP By default, your MMP (AppsFlyer, Adjust) counts installs from NGA as organic, because the tap opens the store directly. To see them as NGA's, give NGA your MMP's click and impression URLs for each promoted game and platform. NGA's server, not the SDK, calls the impression URL once per impression and the click URL once per tap. > **In the portal (portal.nga.io).** > The promoted game's *Promotion* > *Your MMP (optional)*, per platform: *MMP click URL* and *MMP impression URL*, then *Save the URLs*. Both are optional and `https`; the portal checks them when you save. In your MMP, create the two URLs for the promoted game, as for any ad network that reports server-to-server. Put NGA's macros where your MMP takes each value: | Macro | NGA fills in | | --- | --- | | `{click_id}` | NGA's id for the tap, the same for a click and its impression | | `{opportunity_id}` | NGA's id for the ad, the `opportunityId` your game sees | | `{host}` | the store id of the game that showed the ad | | `{platform}` | `android` or `ios` | | `{timestamp}` | when the impression or tap happened, in milliseconds since 1970 | | `{gaid}`, `{idfa}`, `{ip}` | the player's advertising id and IP address, only where consent allows (below) | | | AppsFlyer | Adjust | | --- | --- | --- | | Hosts the portal accepts | `appsflyer.com`, `onelink.me` | `adjust.com`, `adjust.io` | | URL form | `pid` is your media source for this traffic (AppsFlyer's own cross-promotion source is `af_cross_promotion`). The click URL ends in `redirect=false`, AppsFlyer's mark of a click sent from a server | the server-to-server form: host `s2s.adjust.com`, the token of a link you created for NGA's traffic, and `s2s=1` | | `{click_id}` | `clickid`, as in the example | Adjust has no click id parameter: pass it as a parameter of your choice, which Adjust's callbacks can read back | | `{gaid}` (Android) | `advertising_id` | `gps_adid` | | `{idfa}` (iOS, in place of `{gaid}`) | `idfa` | `idfa` | | `{ip}` | `af_ip` | `ip_address`, IPv4 only | | iOS app id | the App Store id with `id` before it (`id1234567890`) | — | | Limits | AppsFlyer keeps 24 characters of `af_siteid`; for longer store ids, put `{host}` in `af_sub_siteid` instead | Adjust refuses a server-to-server click without an advertising id | | Full parameter list | [link parameters](https://support.appsflyer.com/hc/en-us/articles/207447163-About-link-structure-and-parameters), [cross-promotion attribution](https://support.appsflyer.com/hc/en-us/articles/4410480466065-Cross-promotion-attribution-for-developers) | [server-to-server setup](https://help.adjust.com/en/article/set-up-server-to-server-s2s-measurement) | The portal checks that `{gaid}`, `{idfa}` and `{ip}` sit in the parameters above. The parameters beyond NGA's macros are your MMP's. `AppsFlyer, Android` ```text https://app.appsflyer.com/com.example.puzzle?pid=af_cross_promotion&c=nga&af_siteid={host}&clickid={click_id}&advertising_id={gaid}&af_ip={ip}&redirect=false https://impression.appsflyer.com/com.example.puzzle?pid=af_cross_promotion&c=nga&af_siteid={host}&clickid={click_id}&advertising_id={gaid}&af_ip={ip} ``` `Adjust, Android` ```text https://s2s.adjust.com/abc123?s2s=1&campaign=nga&adgroup={host}&gps_adid={gaid}&ip_address={ip}&nga_click_id={click_id} https://s2s.adjust.com/impression/abc123?s2s=1&campaign=nga&adgroup={host}&gps_adid={gaid}&ip_address={ip}&nga_click_id={click_id} ``` **What NGA sends, and when:** | Player | NGA calls your MMP | `{gaid}`, `{idfa}`, `{ip}` | | --- | --- | --- | | Under child treatment | no | — | | Ads personalization `DENIED`, or `UNKNOWN` where the law requires consent, when the event was recorded or when it was sent; or opted out of sale or sharing in the US | yes | empty. AppsFlyer counts the impression or click but cannot attribute it to a device; Adjust refuses it | | Everyone else: ads personalization `GRANTED`, or `UNKNOWN` where no consent is required ([Consent](https://nga.io/docs/sdk/privacy/#consent)) | yes | filled; `{idfa}` only for players who allowed tracking | - **Test traffic never reaches your MMP**: test builds, registered test devices and debug builds. - **Delivery.** Each impression and each tap is sent at least once. A call that fails is retried for up to 24 hours, so in rare cases your MMP may count one twice. The report shows each URL's sent and failed counts. **In your MMP** you see NGA's media source: its impressions, its clicks, and the installs your MMP attributes to them by its own rules. **NGA's report is the attribution of record.** The two can differ, for example when your MMP cannot attribute a call that has no device id. ## What you see in the report The portal's *Report*, per host game, per promoted game, per placement, per format and per day (UTC): - requests and fills; - impressions, clicks and click-through rate; - matched installs, and installs per thousand impressions; - installs without a click (Android): installs of a promoted game that NGA saw but could match to no tap within the window, a first start more than 7 days after the tap, say; the report lists them under no host game; - day-1 and day-7 retention of matched installs; - the share of impressions drawn in the host game's own style, rather than in NGA's standard banner with its colors; - your MMP calls, sent and failed, per URL. An event that arrives late, from a device that was offline, is counted on the day it happened, so the most recent days still change; the report marks them *still updating*. Everything from test devices and test builds is in the report's test view, never in the report itself.