> For the complete documentation index, see [llms.txt](https://docs.digitalturbine.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.digitalturbine.com/dt-exchange/sdk-configuration/integrating-the-android-sdk/impression-level-data.md).

# Impression Level Data

DT Exchange enables you to access detailed information for each impression through the impressions callback APIs. The information includes, for example, which demand source served the ad and its expected or exact revenue.

The following table describes Impression Level Data attributes.

| Property Name      | Description                                                                                                                                                                                                                                                                                                                |
| ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `advertiserDomain` | A unique identifier for a set of campaigns for the same advertiser.                                                                                                                                                                                                                                                        |
| `campaignId`       | A unique identifier that represents a Campaign.                                                                                                                                                                                                                                                                            |
| `creativeId`       | <p>A unique identifier that represents the creative in the bid response.<br>This can be useful when a particular creative causes user experience issues.</p>                                                                                                                                                               |
| `country`          | Identifier of the country of the ad impression (in ISO country code).                                                                                                                                                                                                                                                      |
| `impressionId`     | A unique identifier for a specific impression.                                                                                                                                                                                                                                                                             |
| `demandSource`     | <p>Identifies the demand source name of the buy-side/demand-side entity that purchased the impression:<br></p><ul><li>When mediated networks win an impression, the mediated network's name appears.</li><li>When a DSP buying through the programmatic marketplace wins the impression, the DSP's name appears.</li></ul> |
| `pricing`          | Object includes two properties about the impression's pricing, net payout value, and currency type.                                                                                                                                                                                                                        |
| `Pricing.value`    | The impression's net payout value.                                                                                                                                                                                                                                                                                         |
| `Pricing.currency` | The impression's currency type.                                                                                                                                                                                                                                                                                            |
| `video`            | <p>Object includes two properties about the video: duration and skippable.<br>The object is null for non-video impressions.</p>                                                                                                                                                                                            |
| `Video.skippable`  | An indication of whether the video is skippable or not. Possible values: `true`, `false`.                                                                                                                                                                                                                                  |
| `Video.duration`   | The duration of the video in seconds, for example, 15 seconds.                                                                                                                                                                                                                                                             |

## Receiving Per-Ad Impression Data <a href="#h_01jydrqmq277e0sctsz1x24rkh" id="h_01jydrqmq277e0sctsz1x24rkh"></a>

All unit controllers allow you to access the `ImpressionData` object through their callback APIs, using an `Event Listener` subclass with a suffix of `WithImpressionData`.

The example below showcases how you can access these data on a full screen placement integration

### InneractiveAdViewUnitController <a href="#h_01jye40q7mgyzfzb1c3fjv1sz5" id="h_01jye40q7mgyzfzb1c3fjv1sz5"></a>

{% code title="Java" %}

```java
InneractiveAdViewUnitController controller = 
    (InneractiveAdViewUnitController) bannerSpot.getSelectedUnitController();

controller.setEventsListener(
    new InneractiveAdViewEventsListenerWithImpressionData() {
        @Override
        public void onAdImpression(InneractiveAdSpot adSpot, ImpressionData impressionData) {
            Log.v("ImpressionData", impressionData.toString());
        }

        // … all other callbacks and methods
    }
);
```

{% endcode %}

### InneractiveFullscreenUnitController <a href="#h_01jye445d5kmwpsv7vhh6vjbh9" id="h_01jye445d5kmwpsv7vhh6vjbh9"></a>

{% code title="Java" %}

```java
InneractiveFullscreenUnitController fullscreenUnitController = 
    (InneractiveFullscreenUnitController) fullScreenSpot.getSelectedUnitController();

fullscreenUnitController.setEventsListener(
    new InneractiveFullscreenAdEventsListenerWithImpressionData() {
        
        @Override
        public void onAdImpression(InneractiveAdSpot adSpot, ImpressionData impressionData) {    
            Log.v("ImpressionData", impressionData.toString());
        }
        
        // … all other callbacks and methods

    }
);
```

{% endcode %}

## Receiving Impression Data Globally <a href="#h_01jydrqmq2he82mchdd1mhr25w" id="h_01jydrqmq2he82mchdd1mhr25w"></a>

In addition to the per-ad callback, this listener also contains details about the relevant Placement ID (spot ID) and Unit ID.

{% code title="Java" %}

```java
void OnGlobalImpressionDataListener.onImpression(
    String spotId, 
    String unitId, 
    ImpressionData impressionData
);
```

{% endcode %}

How you register a global listener depends on the SDK version you are running:

* [SDK 8.5.1 and later](#sdk-8.5.1-and-later): Register multiple listeners at the same time, for example, one for your app and one for your mediation platform. Each listener receives every global impression callback.
* [SDK 8.5.0 and earlier](#sdk-8.5.0-and-earlier): Register only one listener. Each new listener replaces the previous one.

{% tabs %}
{% tab title="SDK 8.5.1 and Later" %}
Create one or more listeners and register each with `InneractiveAdManager.addImpressionDataListener()`. The following example registers two listeners, for example, one for your app and one for your mediation platform:

{% code title="Java" %}

```java
OnGlobalImpressionDataListener appListener = new OnGlobalImpressionDataListener() {
    @Override
    public void onImpression(String spotId, String unitId, ImpressionData impressionData) {
        Log.v("impressionStaticData", 
              "app listener - spotId: " + spotId + 
              ", unitId: " + unitId + 
              ", impressionData: " + impressionData);
    }
};

OnGlobalImpressionDataListener mediationListener = new OnGlobalImpressionDataListener() {
    @Override
    public void onImpression(String spotId, String unitId, ImpressionData impressionData) {
        Log.v("impressionStaticData", 
              "mediation listener - spotId: " + spotId + 
              ", unitId: " + unitId + 
              ", impressionData: " + impressionData);
    }
};

// Both listeners receive every global impression callback.
// Adding the second listener does not replace the first.
InneractiveAdManager.addImpressionDataListener(appListener);
InneractiveAdManager.addImpressionDataListener(mediationListener);
```

{% endcode %}

To stop receiving global impression data on a listener, pass the same listener instance to `InneractiveAdManager.removeImpressionDataListener()`:

{% code title="Java" %}

```java
// Only appListener is removed. mediationListener keeps receiving impression callbacks.
InneractiveAdManager.removeImpressionDataListener(appListener);
```

{% endcode %}

{% hint style="warning" %}
The SDK holds a hard reference to each registered listener, which might cause memory leaks if you use it incorrectly. Keep a reference to every listener you add, and remove it when global ad impression data is no longer required.

Adding the same listener instance more than once has no effect. The listener is registered only once.
{% endhint %}
{% endtab %}

{% tab title="SDK 8.5.0 and Earlier" %}
Create a listener and register it with `InneractiveAdManager.setImpressionDataListener()`:

{% code title="Java" %}

```java
// Replaces any listener set earlier, including one set by a mediation platform.
InneractiveAdManager.setImpressionDataListener(new OnGlobalImpressionDataListener() {
    @Override
    public void onImpression(String spotId, String unitId, ImpressionData impressionData) {
        Log.v("impressionStaticData", 
              "spotId: " + spotId + 
              ", unitId: " + unitId + 
              ", impressionData: " + impressionData);
    }
});
```

{% endcode %}

To stop receiving global impression data, call `InneractiveAdManager.clearImpressionDataListener()`:

{% code title="Java" %}

```java
InneractiveAdManager.clearImpressionDataListener();
```

{% endcode %}

{% hint style="warning" %}
The static impression data listener holds a hard reference, which might cause memory leaks if you use it incorrectly.

DT recommends using the relevant `InneractiveAdManager.clearImpressionDataListener()` method when global ad impression data is no longer required.
{% endhint %}
{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.digitalturbine.com/dt-exchange/sdk-configuration/integrating-the-android-sdk/impression-level-data.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
