<!--
{
  "availability" : [
    "iOS: 17.4.0 -",
    "iPadOS: 17.4.0 -",
    "macCatalyst: -"
  ],
  "documentType" : "symbol",
  "framework" : "AdAttributionKit",
  "identifier" : "/documentation/AdAttributionKit/AppImpression",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "AdAttributionKit"
    ],
    "preciseIdentifier" : "s:16AdAttributionKit13AppImpressionV"
  },
  "title" : "AppImpression"
}
-->

# AppImpression

A structure that represents an attributable impression you generate in response to a person’s interaction with an ad in an app.

```
struct AppImpression
```

## Discussion

To record a view-through impression, call [`beginView()`](/documentation/AdAttributionKit/AppImpression/beginView()) when the ad content corresponding to the impression becomes visible, and [`endView()`](/documentation/AdAttributionKit/AppImpression/endView()) when the ad content disappears. The advertisement needs to be visible for at least two seconds for AdAttributionKit to record a view through impression; otherwise, the framework throws an error.

> Important:
> Regenerate an `AppImpression` for each ad you show. Don’t reuse `AppImpression` structures across multiple ads.

To support click-through attribution, place a <doc://com.apple.documentation/documentation/UIKit/UIEventAttributionView> over the ad content and call  either [`handleTap(reengagementURL:)`](/documentation/AdAttributionKit/AppImpression/handleTap(reengagementURL:)) or [`handleTap()`](/documentation/AdAttributionKit/AppImpression/handleTap()) after a person taps the ad content. The framework then validates that a person taps a `UIEventAttributionView` before recording the impression, and throws an error if it can’t validate that a tap occurred in a `UIEventAttributionView`.

After the framework validates the tap, it records the impression and then attempts to launch one of the user’s installed marketplaces to show the product page for the advertised app. The system uses the advertised item ID from the JSON Web Signature (JWS) string you provide to initialize the `AppImpression`, in addition to the user’s preferred marketplaces, to help determine which marketplace the framework needs to launch. If the app is already installed, the framework launches into the app’s Home Screen instead.

In iOS 18 and later, `AppImpression` supports reengagement for click-through interactions when the advertised app is already installed on the device. The system can deep-link into the advertised app when using [`handleTap(reengagementURL:)`](/documentation/AdAttributionKit/AppImpression/handleTap(reengagementURL:)). Click-through impressions can also qualify for reengagement postbacks by opting in for reengagement in the impression JWS. For more information about opting in for re-engagement, see [Generating JWS impressions](/documentation/AdAttributionKit/generating-jws-impressions).

## Topics

### Creating an ad impression

[`init(compactJWS:)`](/documentation/AdAttributionKit/AppImpression/init(compactJWS:))

Creates a new app impression with the provided compact JSON Web Signature (JWS).

### Displaying view-through ads

[`beginView()`](/documentation/AdAttributionKit/AppImpression/beginView())

Begins recording a view-through impression when ad content corresponding to the impression becomes visible.

[`endView()`](/documentation/AdAttributionKit/AppImpression/endView())

Ends the view-through impression when the ad content corresponding to the impression disappears.

[`handleView()`](/documentation/AdAttributionKit/AppImpression/handleView())

Handles a view through ad impression.

### Processing interactions with click-through ads

[`handleTap()`](/documentation/AdAttributionKit/AppImpression/handleTap())

Processes click-through interactions on your custom rendered ad content.

[`handleTap(reengagementURL:)`](/documentation/AdAttributionKit/AppImpression/handleTap(reengagementURL:))

Processes click-through interactions on your custom rendered ad content, and delivers a URL to the advertised app if it’s
installed.

### Accessing ad impression properties

[`adNetworkID`](/documentation/AdAttributionKit/AppImpression/adNetworkID)

The advertising network ID.

[`advertisedItemID`](/documentation/AdAttributionKit/AppImpression/advertisedItemID)

The advertised item’s ID.

[`compactJWSRepresentation`](/documentation/AdAttributionKit/AppImpression/compactJWSRepresentation)

A string that presents the compact representation of the impression’s JSON Web Signature (JWS).

[`eligibleForReengagement`](/documentation/AdAttributionKit/AppImpression/eligibleForReengagement)

A Boolean value that indicates whether this impression is eligible for reengagement.

[`id`](/documentation/AdAttributionKit/AppImpression/id)

The impression’s unique ID.

[`keyID`](/documentation/AdAttributionKit/AppImpression/keyID)

The JSON Web Signature (JWS) key ID.

[`publisherItemID`](/documentation/AdAttributionKit/AppImpression/publisherItemID)

The publisher app’s item ID.

[`sourceID`](/documentation/AdAttributionKit/AppImpression/sourceID)

A four-digit integer that ad networks define to represent the ad campaign.

[`timestamp`](/documentation/AdAttributionKit/AppImpression/timestamp)

The impression’s timestamp, in milliseconds since 1970.

### Checking device support

[`isSupported`](/documentation/AdAttributionKit/AppImpression/isSupported)

A Boolean value that indicates whether the framework supports app impressions on a person’s device.

### Comparing and hashing ad impressions

[`==(_:_:)`](/documentation/AdAttributionKit/AppImpression/==(_:_:))

Returns a Boolean value that indicates whether two values are equal.

[`hash(into:)`](/documentation/AdAttributionKit/AppImpression/hash(into:))

A function that hashes the essential components of the value by passing them into the hasher.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)