# iOS 14+ & SKAdNetwork Attribution

## Overview

With the recent Apple announcement of the IDFA change on iOS 14+, Chartboost Exchange is planning to support SKAdNetwork attribution for DSP partners and also pass additional parameters in OpenRTB bid requests to help our partners augment modeling and targeting when IDFA is absent. 

## SKAdNetwork Support

* Chartboost has added SKAdNetwork version 2.0 support in our iOS SDK 8.3.0+, version 2.2 & 3.0 support in iOS SDK 8.4.2+, and version 4.0 support in iOS SDK 9.2.0+.  If you plan to use SKAdNetwork attribution on Chartboost Exchange, please remember to share your SKAdNetwork ID(s) with the Chartboost Exchange team. 
  * For SKAdNetwork 4.0+ in the Bid Response, use `sourceidentifier` as `campaign` is deprecated.
* Chartboost provides integration instructions for publishers to include the related SKAdNetwork IDs in their Info.plist file.
* Chartboost Exchange will include SKAdNetwork related parameters in the bid requests, so DSPs can identify which bid requests support SKAdNetwork and submit bid responses accordingly (see the detailed specs for bid request and bid response below).
  * If the publisher app's Info.plist includes at least one SKAdNetworkItem matching a given DSP's id(s), Chartboost Exchange will add <code>imp.ext.skadn</code> object in the bid request to the DSP. This object will only be present if the bid request is from iOS 14+ and an SKAN v2.0+ compatible SDK.
* The Chartboost Monetization SDK will show a [StoreKit Rendered Ad](https://developer.apple.com/documentation/storekit/skadnetwork/receiving_ad_attributions_and_postbacks) if the bid response indicates that one is required in `bidresponse.seatbid.bid.ext.skadn`.

**Note**: If the response is <code>"version":"2.2"</code> or <code>"version":"3.0"</code>, <code>fidelities</code> field is **required** (refer to the [2.2 example](#bidresponseseatbidbidextskadn-version-22--30-object) below). If the response is `"version":"2.2"` and there is only one object in the `fidelities` array, `fidelity` must be set to `1`. If the response is <code>"version":"2.0"</code>, <code>fidelities</code> should _not_ be used (refer to the [2.0 example](#bidresponseseatbidbidextskadn-version-20-object) below).


## BidRequest.imp.ext.skadn (Object) 

| Field       | Type |  Description | Example |
|-------------|------|--------------|---------|
| <span style="font-family:Courier New">version</span> | String | The version of SkAdNetwork supported (deprecated in favor of "versions" and not present in any SKAN 2.1+ bid requests). Always "2.0". | `"2.0"` |
| <span style="font-family:Courier New">versions</span> | String Array | A list of supported SkAdNetwork versions. | `["2.0","2.2","3.0","4.0"]` |
| <span style="font-family:Courier New">sourceapp</span> | String | The publisher app’s App Store ID. Should match `BidRequest.app.bundle` | `"1499118002"` |
| <span style="font-family:Courier New">skadnetids</span> | String Array | A subset of SKAdNetworkItems included in the publisher app's Info.plist, associated with the DSP. | `["dsp1.skadnetwork", "dsp2.skadnetwork"]` |
| <span style="font-family:Courier New">productpage</span> | Integer | Custom Product Page support. See Apple's [Custom Product Page](https://developer.apple.com/app-store/custom-product-pages/){:target="_blank"} doc for details. Value must be `1`. | `1` |
| <span style="font-family:Courier New">ext.skoverlay</span> | Integer | Indicates if SKOverlay is supported (available as of iOS SDK 9.1). Value is <code>1</code> if eligible, otherwise omitted from the bid request. Refer to the [SKOverlay Support](/en/partners/exchange/skoverlay-support/) section below. | See [SKOverlay bid request](/en/partners/exchange/skoverlay-support/#bidrequestimpextskadnextskoverlay-attribute) example. |


**Example**

```json
{
  "imp": [
    {
      "ext": {
        "skadn": {
          "versions": ["2.0","2.2","3.0","4.0"],
          "sourceapp": "1499118002",
          "skadnetids": [
            "dsp1.skadnetwork",
            "dsp2.skadnetwork"
          ],
          "productpage": 1
        }
      }
    }
  ]
}
```


## BidResponse.seatbid.bid.ext.skadn (version 4.0) (Object)

| Field                                                      | Type | Description                                                                                                                                                                                                                      | Example                                                                            |
|------------------------------------------------------------|------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------|
| <span style="font-family:Courier New">version</span>       | String | Version of SKAdNetwork desired. Must match a value from `BidRequest.imp.ext.skadn.versions`.                                                                                                                                     | `"4.0"`                                                                            |
| <span style="font-family:Courier New">network</span>       | String | Ad Network Identifier used in the signature. Must match one of the ids in `BidRequest.imp.ext.skadn.skadnetids`.                                                                                                                 | `"dsp1.skadnetwork"`                                                               |
| <span style="font-family:Courier New">sourceidentifier</span>      | String | A four-digit integer that ad networks define to represent the ad campaign. Used in SKAdNetwork 4.0+, replaces Campaign ID `campaign`. DSPs must generate signatures in 4.0+ using the Source Identifier. Should be a four-digit integer expressed as a string between 0000 and 9999.                                                                                                              | `"4321"`                                                                             |
| <span style="font-family:Courier New">itunesitem</span>    | String | The advertiser app's App Store ID. Must match `BidResponse.bid.bundle`.                                                                                                                                                          | `"487847188"`                                                                      |
| <span style="font-family:Courier New">sourceapp</span>     | String | The publisher app's App Store ID. Must match `BidRequest.imp.ext.skadn.sourceapp`.                                                                                                                                               | `"1499118002"`                                                                     |
| <span style="font-family:Courier New">productpageid</span> | String | Custom Product Page ID (UUID) (support available as of iOS SDK 9.2). | `"45812c9b-c296-43d3-c6a0-c5a02f74bf6d"` |
| <span style="font-family:Courier New">fidelities</span>    | Object Array | Array of [fidelity](#bidresponseseatbidbidextskadnfidelities-22-30--40-object-array) types supported, introduced in SKAdNetwork v2.2. Note for SKADN 2.2: if there is only one object in the fidelities object, `fidelity` must have a value of `1`. | See [Fidelities Object Array](#bidresponseseatbidbidextskadnfidelities-22-30--40-object-array) below. |
| <span style="font-family:Courier New">ext.skoverlay</span> | Object | Parameters to control a potential SKOverlay (available as of iOS SDK 9.1). Refer to the [SKOverlay Support](/en/partners/exchange/skoverlay-support/) section below.                                                                                | See [SKOverlay bid response](/en/partners/exchange/skoverlay-support/#bidresponseseatbidbidextskadnextskoverlay-object) example.           |

**Example**

```json

{
  "seatbid": [
    {
      "bid": [
        {
          "ext": {
            "skadn": {
              "version": "4.0",
              "network": "dsp1.skadnetwork",
              "sourceidentifier": "4321",
              "itunesitem": "487847188",
              "sourceapp": "1499118002",
              "productpageid": "45812c9b-c296-43d3-c6a0-c5a02f74bf6d",
              "fidelities": [
                {
                  "fidelity": 0,
                  "signature": "MEQCIEQlmZRNfYzKBSE8QnhLTIHZZZWCFgZpRqRxHss65KoFAiAJgJKjdrWdkLUOCCjuEx2RmFS7daRzSVZRVZ8RyMyUX1==",
                  "nonce": "68753a44-4d6f-1226-9c60-0050e4c00067",
                  "timestamp": "1600214400"
                },{
                  "fidelity": 1,
                  "signature": "MEQCIEQlmZRNfYzKBSE8QnhLTIHZZZWCFgZpRqRxHss65KoFAiAJgJKjdrWdkLUOCCjuEx2RmFS7daRzSVZRVZ8RyMyUX2==",
                  "nonce": "68753a44-4d6f-1226-9c60-0050e4c00068",
                  "timestamp": "1600214401"
                }
              ]
            }
          }
        }
      ]
    }
  ]
}
```

## BidResponse.seatbid.bid.ext.skadn (version 2.2 & 3.0) (Object)

| Field                                                      | Type | Description                                                                                                                                                                                                                      | Example                                                                            |
|------------------------------------------------------------|------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------|
| <span style="font-family:Courier New">version</span>       | String | Version of SKAdNetwork desired. Must match a value from `BidRequest.imp.ext.skadn.versions`.                                                                                                                                     | `"2.2"`                                                                            |
| <span style="font-family:Courier New">network</span>       | String | Ad Network Identifier used in the signature. Must match one of the ids in `BidRequest.imp.ext.skadn.skadnetids`.                                                                                                                 | `"dsp1.skadnetwork"`                                                               |
| <span style="font-family:Courier New">campaign</span>      | String | Ad Network Campaign Identifier used in the signature. Should be an integer expressed as a string between 1 and 100.                                                                                                              | `"18"`                                                                             |
| <span style="font-family:Courier New">itunesitem</span>    | String | The advertiser app's App Store ID. Must match `BidResponse.bid.bundle`.                                                                                                                                                          | `"487847188"`                                                                      |
| <span style="font-family:Courier New">sourceapp</span>     | String | The publisher app's App Store ID. Must match `BidRequest.imp.ext.skadn.sourceapp`.                                                                                                                                               | `"1499118002"`                                                                     |
| <span style="font-family:Courier New">productpageid</span> | String | Custom Product Page ID (UUID) (support available as of iOS SDK 9.2). | `"45812c9b-c296-43d3-c6a0-c5a02f74bf6d"` |
| <span style="font-family:Courier New">fidelities</span>    | Object Array | Array of [fidelity](#bidresponseseatbidbidextskadnfidelities-22-30--40-object-array) types supported, introduced in SKAdNetwork v2.2. Note for SKADN 2.2: if there is only one object in the fidelities object, `fidelity` must have a value of `1`. | See [Fidelities Object Array](#bidresponseseatbidbidextskadnfidelities-22-30--40-object-array) below. |
| <span style="font-family:Courier New">ext.skoverlay</span> | Object | Parameters to control a potential SKOverlay (available as of iOS SDK 9.1). Refer to the [SKOverlay Support](/en/partners/exchange/skoverlay-support/) section below.                                                                                | See [SKOverlay bid response](/en/partners/exchange/skoverlay-support/#bidresponseseatbidbidextskadnextskoverlay-object) example.           |

**Example**

```json
{
  "seatbid": [
    {
      "bid": [
        {
          "ext": {
            "skadn": {
              "version": "2.2",
              "network": "dsp1.skadnetwork",
              "campaign": "18",
              "itunesitem": "487847188",
              "sourceapp": "1499118002",
              "productpageid": "45812c9b-c296-43d3-c6a0-c5a02f74bf6d",
              "fidelities": [
                {
                  "fidelity": 0,
                  "signature": "MEQCIEQlmZRNfYzKBSE8QnhLTIHZZZWCFgZpRqRxHss65KoFAiAJgJKjdrWdkLUOCCjuEx2RmFS7daRzSVZRVZ8RyMyUX1==",
                  "nonce": "68753a44-4d6f-1226-9c60-0050e4c00067",
                  "timestamp": "1600214400"
                },{
                  "fidelity": 1,
                  "signature": "MEQCIEQlmZRNfYzKBSE8QnhLTIHZZZWCFgZpRqRxHss65KoFAiAJgJKjdrWdkLUOCCjuEx2RmFS7daRzSVZRVZ8RyMyUX2==",
                  "nonce": "68753a44-4d6f-1226-9c60-0050e4c00068",
                  "timestamp": "1600214401"
                }
              ]
            }
          }
        }
      ]
    }
  ]
}
```


## BidResponse.seatbid.bid.ext.skadn (version 2.0) (Object)

| Field       | Type |  Description | Example |
|-------------|------|--------------|---------|
| <span style="font-family:Courier New">version</span> | String | Version of SKAdNetwork desired. Must match `BidRequest.imp.ext.skadn.version` (2.0 only). | `"2.0"` |
| <span style="font-family:Courier New">network</span> | String | Ad Network Identifier used in the signature. Must match one of the IDs in `BidRequest.imp.ext.skadn.skadnetids`. | `"dsp1.skadnetwork"` |
| <span style="font-family:Courier New">campaign</span> | String | Ad Network Campaign Identifier used in the signature. As of SkAdNetwork v2.0, should be an integer between 1 and 100, expressed as a string. | `"18"` |
| <span style="font-family:Courier New">itunesitem</span> | String | The advertiser app's App Store ID. Must match `BidResponse.bid.bundle`. | `"487847188"` |
| <span style="font-family:Courier New">sourceapp</span> | String | The publisher app's App Store ID. Must match `BidRequest.imp.ext.skadn.sourceapp`. | `"1499118002"` |
| <span style="font-family:Courier New">signature</span> | String | SKAdNetwork signature. | `"MEQCIEQlmZRNfYzK..."` |
| <span style="font-family:Courier New">nonce</span> | String | A unique UUID value for each bid response. The string representation of this nonce used in the signature must be in lowercase. | `"68753a44-4d6f-1226-9c60-0050e4c00067"` |
| <span style="font-family:Courier New">timestamp</span> | String | UNIX time in milliseconds used at the time of signature generation. | `"1600214400"` |

**Example**

```json
{
  "seatbid": [
    {
      "bid": [
        {
          "ext": {
            "skadn": {
              "version": "2.0",
              "network": "dsp1.skadnetwork",
              "campaign": "18",
              "itunesitem": "487847188",
              "nonce": "68753a44-4d6f-1226-9c60-0050e4c00067",
              "sourceapp": "1499118002",
              "timestamp": "1600214400",
              "signature": "MEQCIEQlmZRNfYzKBSE8QnhLTIHZZZWCFgZpRqRxHss65KoFAiAJgJKjdrWdkLUOCCjuEx2RmFS7daRzSVZRVZ8RyMyUXg=="
            }
          }
        }
      ]
    }
  ]
}

```

## BidResponse.seatbid.bid.ext.skadn.fidelities (2.2, 3.0, & 4.0) (Object Array)

| Field       | Type | Description                                                                                                                                                                                  | Example |
|-------------|------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|
| <span style="font-family:Courier New">fidelity</span> | Integer | The fidelity-type of the attribution to track, introduced in SKAdNetwork v2.2. Note for SKADN 2.2: if there is only one object in the fidelities object, `fidelity` must have a value of `1`. | `1` |
| <span style="font-family:Courier New">nonce</span> | String | A unique UUID value for each fidelity object. The string representation of this nonce used in the signature must be lowercase.                                                               | `"68753a44-4d6f-1226-9c60-0050e4c00067"` |
| <span style="font-family:Courier New">signature</span> | String | SKAdNetwork signature.                                                                                                                                                                       | `"MEQCIEQlmZRNfYzK..."` |
| <span style="font-family:Courier New">timestamp</span> | String | UNIX time in milliseconds used at the time of signature generation.                                                                                                                          | `"1600214400"` |


## OpenRTB Bid Request Parameters for Contextual Advertising 

* Chartboost Exchange will start passing additional parameters in bid requests to help partners enhance contextual advertising targeting. These parameters will be included in bid requests coming from Chartboost iOS SDK 8.2.1 and above. They will be available across all iOS OS versions.  See [Bid Request](#bidrequestimpextskadn-object) for specifications.  
* Updated fields include `user.id`, `user.ext.sessionduration`, `user.ext.impdepth`, `device.ext.ifv`, and `device.ext.atts`.

## iOS 14+ SKAdNetwork Attribution - Changes to click-through behavior

When an ad response contains SKAdNetwork parameters and a user clicks through the ad, click-through URLs (via VAST `ClickThrough` or `CompanionClickThrough`, `mraid.open()`, or standard HTML `<a href="..."></a>` links) will trigger HTTP GET requests by the SDK immediately & *asynchronously in the background*, following all HTTP 302 redirects to a final destination, while the SDK calls the iOS `loadProduct` API to open the itunesitem in the App Store.  Note: VAST `ClickTracking` and `CompanionClickTracking` will continue to operate without change.
