Select platform: [HTML5](https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side/pps.md.txt "View this page for the HTML5 platform docs.") [Android](https://developers.google.com/interactive-media-ads/docs/sdks/android/client-side/pps.md.txt "View this page for the Android platform docs.") [iOS](https://developers.google.com/interactive-media-ads/docs/sdks/ios/client-side/pps.md.txt "View this page for the iOS platform docs.") [tvOS](https://developers.google.com/interactive-media-ads/docs/sdks/tvos/client-side/pps.md.txt "View this page for the tvOS platform docs.")

<br />

You can send audience and contextual data as
[publisher provided signals](https://support.google.com/admanager/answer/12451124)
(PPS) in ad requests. With PPS, you can use your user data to improve
programmatic monetization by communicating your audience characteristics to
bidders in all
[transaction types](https://support.google.com/admanager/answer/2805834), using
standard taxonomies, without the need to share user identifiers. Your audience
characteristics can include behavioral and interest-based data (
[IAB Audience Taxonomy 1.1](https://iabtechlab.com/standards/audience-taxonomy/)), and
contextual data (
[IAB Content Taxonomy 2.2](https://iabtechlab.com/standards/content-taxonomy/)).
You can also send publisher provided structured signals, which are defined by
Google, and allow for additional signals to be sent.

## Construct the user signals JSON

At the top level, create a JSON object with a single key-value pair. The key
should be `PublisherProvidedTaxonomySignals`, and its value should be an array
of objects. Each object in the array should have 2 key-value pairs:

- The `taxonomy` key, which accepts the following values that are mapped to
  following IAB public specifications:

  - `IAB_AUDIENCE_1_1` for Audience Taxonomy 1.1
  - `IAB_CONTENT_2_2` for Content Taxonomy 2.2
- The `values` key with a corresponding array of string taxonomy values.

### Construct the structured signals array

For structured signals, add the `PublisherProvidedStructuredSignals` key with a
value of an array of objects. Construct the object based on the following list
of signal key-values:

#### Toggle view of structured signals table

| Signal | "type" Value | Possible `"single_value"` Values | Possible `"values"` Values |
|---|---|---|---|
| Audio Feed Type | `"audio_feed"` | - `"af_1"`: Music - `"af_2"`: Broadcast - `"af_3"`: Podcast | n/a |
| Content Rating | `"content_rating"` | - `"cr_1"`: G - `"cr_2"`: PG - `"cr_3"`: T - `"cr_4"`: MA | n/a |
| Content Delivery | `"delivery"` | n/a | - `"cd_1"`: Streaming - `"cd_2"`: Progressive - `"cd_3"`: Download |
| Production Quality | `"prodq"` | - `"pq_1"`: Professionally Produced - `"pq_2"`: Prosumer - `"pq_3"`: User Generated (UGC) | n/a |

See the following example that uses the `IAB_AUDIENCE_1_1` and `IAB_CONTENT_2_2`
for taxonomy signals and includes structured signals.

```javascript
const userSignals = {
  "PublisherProvidedTaxonomySignals": [{
     "taxonomy": "IAB_AUDIENCE_1_1",
     "values": ["6", "284"]
     // '6' = 'Demographic | Age Range | 30-34'
     // '284' = 'Interest | Business and Finance |  Mergers and Acquisitions'
  },
  {
     "taxonomy": "IAB_CONTENT_2_2",
     "values": ["49", "138"]
     // '49' = 'Books and Literature | Poetry'
     // '138' = 'Education | College Education | College Planning'
  }],
  "PublisherProvidedStructuredSignals": [{
      "type": "audio_feed",
      "single_value": "af_1",
    },
    {
      "type": "delivery",
      "values": ["cd_1", "cd_3"],
    },
  ],
};
```

## Configure your ad request

Follow these steps to send PPS with your
[`IMAAdsRequest`](https://developers.google.com/interactive-media-ads/docs/sdks/ios/client-side/reference/Classes/IMAAdsRequest.md.txt):

- Create a JSON string with the user's interest, behavior, or contextual data.
- Create a Base64-encoded ASCII string from the JSON string above.
- Append the encoded string to your ad tag URL with the `&ppsj=` parameter.

```swift
let userSignals = """
{
   "PublisherProvidedTaxonomySignals": [
    {
      "taxonomy": "IAB_AUDIENCE_1_1",
      "values": [
        "1",
        "284"
      ]
    }
  ],
}
"""
let base64Signals = Data(userSignals.utf8).base64EncodedString()
var encodedSignals = base64Signals.replacingOccurrences(of: "+", with: "%2B")
encodedSignals = encodedSignals.replacingOccurrences(of: "/", with: "%2F")
encodedSignals = encodedSignals.replacingOccurrences(of: "=", with: "%3D")


let finalAdTag = sampleAdTag + "&ppsj=" + encodedSignals
```