adzerk / adzerk-ios-sdk

Access Adzerk's ad serving APIs via iOS
https://www.adzerk.com
Other
9 stars 5 forks source link

Add general pixel firing support #45

Closed karnowski closed 3 years ago

karnowski commented 3 years ago

Background

We need to make it easy to fire Kevel pixels from the iOS and Android SDKs.

In adtech jargon, a "pixel" is a URL that records an event. They're called "pixels" because historically they were added in an <img> HTML tag, and the URL itself returns an invisible 1x1 gif image, hence a "pixel".

Kevel supports four key pixel groups -- impressions, clicks, conversions, and custom events. These each mean very different things in the business world, but in the nuts & bolts HTTP world there are really only two kinds -- pixels that will have an important redirect response (i.e. clicks) and those that don't (i.e. everything else).

Note that the key business reason for recording these pixels is because they measure ad viewer engagement and are thus the basis for tracking the performance of an ad campaign. In other words, they track how much the advertiser should pay to the publisher. As such these are key events.

Further, because most pixels record events with associated revenue, it is often desirable to modify the revenue. Our Kevel pixels support an additional and override query parameter that each take a float. We'll need mobile developers to be able to set those values as well.

To handle clicks, it is important that the redirected location is exposed. This is especially true for mobile app, because the location is likely not a typical URL. If it is, it might have meaning inside the app. In any case, it's important that there be a version of this pixel firing method that exposes the status and location of the HTTP response.

See Also

Acceptance Criteria

iOS Tech Note

Note the iOS SDK already has a recordImpression method, and we have a few customers actively using it. We'll need to support this for backwards compatibility, but it's up to the developer fixing this issue to decide if should be an alias or a separate implementation. It already supports the SDK header, but it doesn't support modifying revenue.

Note that we'll want to support both the old and new methods in iOS, as we don't want to break existing customers' implementations.