WWDC Quick Look 💓 By SwiftGGTeam
What's new with SKAdNetwork

What's new with SKAdNetwork

Watch original video

Highlight

SKAdNetwork 4.0 extends Campaign ID to a hierarchical Source Identifier, introduces two-level conversion values, three rounds of postback, web ad attribution and StoreKitTest testing capabilities, allowing advertisers to obtain more install attribution signals under crowd anonymity constraints.


Core Content

There is a long-term contradiction in advertising attribution: advertisers need to know whether ads lead to installations and subsequent actions, and users do not want their actions to be tracked across apps or websites. This is where SKAdNetwork is located. It allows ad networks, publisher apps, and advertiser apps to complete install attribution through signed impressions, first launch signals, conversion value updates, and postbacks, while putting user privacy protection in the protocol (00:36).

The core change of SKAdNetwork 4.0 is to give advertisers more signals without breaking the boundaries of privacy. Apple uses crowd anonymity to describe this boundary: when the installation volume is low, postback returns fewer fields; when the installation volume increases, users mix into a larger group, and the system returns more details (03:38).

This set of rules affects every new field. The number of digits in the Source Identifier, the granularity of the conversion value, and the number of postbacks are all subject to crowd anonymity. What developers have to do has also changed: fields cannot be randomly encoded, the server cannot just parse the old format, and testing cannot wait for the online advertisement to run before discovering that there is a problem with the signature or postback.

From single Campaign ID to hierarchical Source Identifier

The campaign identifier for legacy SKAdNetwork was a 2-digit field. SKAdNetwork 4.0 extended it to 4 digits and renamed it Source Identifier. Apple recommends treating it as a 2-digit, 3-digit, and 4-digit three-level structure instead of an ordinary integer (04:41).

This design is suitable for attribution drilldown. The first 2 digits could represent the ad campaign, the 3rd digit could represent the bucketed user position, and the 4th digit could represent the ad position on the screen. It can also be designed as treatment, time period, and ad size. The key point is: low anonymity levels may return only 2 bits, high anonymity levels return the full 4 bits.

From one postback to three postbacks

The old model only had one postback. In the Food Truck example, after the user starts the app and picks up the first batch of donuts, the postback time is up; the user later completes the delivery, and this subsequent behavior cannot be attributed (10:18).

SKAdNetwork 4.0 is changed to three fixed time windows, corresponding to three postbacks. The first round can still carry fine conversion value; the last two rounds can carry coarse conversion value. In this way, developers can record short-term post-installation behavior separately from later re-engagement (11:21).

Web ads also enter the SKAdNetwork process

The typical process in the past occurred in publisher apps: clicking on the ad opens the App Store product page, and after installation, SKAdNetwork sends a postback. SKAdNetwork 4.0 extends the same privacy-preserving attribution to web ads. After the user clicks on the ad link in Safari, the App Store will obtain the signed impression from the ad network server and then go through the subsequent installation attribution process (12:53).

There are two key fields in a web link:attributionDestinationTell Apple where to go to get signed impressions,attributionSourceNonceHelps ad networks target which signed impression to return (13:47).


Detailed Content

1. Source Identifier should be designed according to the level of anonymity

(04:41) SKAdNetwork 4.0 extends the 2-digit campaign identifier to a 4-digit Source Identifier. The results returned vary with crowd anonymity: 2 digits are returned for low levels, 3 digits are returned for medium levels, and the full 4 digits are returned for high levels (07:04).

Source Identifier can be designed as nested information. in transcript5739For example, the return granularity increases as crowd anonymity increases:

Crowd anonymityPossible content returned in postbackDesign implications
Low2-digit componentMinimal details, only the most critical and lowest risk business categories
Medium3-digit componentAdds a layer of bucketing information based on 2 digits
Highfull 4-digit source identifierReturns the full 4-digit source identifier, which can contain the most granular experiment, location, or ad impression information

Key points:

  • Source Identifier is a new 4-digit field in SKAdNetwork 4.0, replacing the previous 2-digit campaign identifier. -5739It should be understood as the encoding result of nested business dimensions, and do not mislabel the full 4 digits as a single “advertising slot” or “location” field.
  • transcript descriptionSKAdImpressionThere are new onessourceIdentifierAttribute; if you use dictionary to configure impression, you must also fill in the Source Identifier field. The specific key is subject to Apple documentation and the current SDK.
  • The server and client must share the same encoding table, otherwise the numbers in postback cannot restore the business meaning.
  • The coding table should cover three return situations: 2 digits, 3 digits, and 4 digits; do not put the most important information only in the 4th digit, because it will not be returned at a low anonymity level.

2. Conversion value is divided into fine and coarse

(06:08) The old conversion value is 6 bit. SKAdNetwork 4.0 introduces two types of values: fine-grained conversion value is still the original fine-grained value; coarse-grained conversion value only has three levels: low, medium, and high.

The example given by Apple ishigh 42highis a coarse value,42It’s fine value. The coarse value requires less installation, so the App can get the coarse-grained results earlier; the same postback will only return one of the conversion values ​​(06:34).

// Concept example: describe one user action with fine + coarse value layers
let fineValue = 42
let coarseValue = "high"

SKAdNetwork.updatePostbackConversionValue(
    fineValue,
    coarseValue: coarseValue
) { error in
    // The transcript recommends performing follow-up work in the completion handler
}

Key points:

  • updatePostbackConversionValueis the new method name mentioned in transcript. -fineValueCorresponds to the old version 6 bit conversion value. -coarseValueCorresponds to three levels of low, medium and high values.
  • The completion handler should be used for subsequent tasks after the update is completed, which is the suggestion given explicitly in the session (08:33).
  • Real projects should use the official types and signatures of the current SDK and cannot directly copy this concept fragment into production code.

When designing a coarse value, don’t think of it as a simple truncation of the fine value. The third level value has only a small amount of information and is suitable for expressing rough classifications such as “not yet activated/completed core actions/high-value users”.

3. Three rounds of postback to serve different time windows

(09:57) A single postback can only cover one time window. SKAdNetwork 4.0’s three postbacks allow developers to record different stages after installation: startup, first core behavior, and subsequent re-engagement.

// Concept example: map different stages to different postback windows
func userDidLaunchApp() {
    updateConversion(window: 1, coarse: "low", fine: 5)
}

func userDidCompleteFirstDelivery() {
    updateConversion(window: 2, coarse: "medium", fine: nil)
}

func userDidCreateNewRecipe() {
    updateConversion(window: 3, coarse: "high", fine: nil)
}

Key points:

  • window: 1Corresponding to the first round of postback, it can obtain fine conversion value. -window: 2andwindow: 3Corresponding to additional postback, session indicates that they can carry coarse conversion value. -fine: nilIndicates that the latter two rounds do not rely on fine-grained values.
  • This fragment expresses the business mapping method,updateConversionNot an Apple API.

The server also needs to perform three rounds of postback to store data. Don’t just keep “last attributed result.” The first round is suitable for measuring early quality after installation, and the second and third rounds are suitable for measuring value behaviors that occur later.

4. Web advertising attribution needs to be able to return signature impressions

(13:47) Web advertising linkhrefPoint to the App Store product page.attributionDestinationTell Apple which domain name to go to for signed impressions.attributionSourceNonceHelp advertising networks find corresponding impressions.

<!-- Concept example: a web ad link includes the App Store destination and attribution fields -->
<a
  href="https://apps.apple.com/app/id123456789"
  attributionDestination="https://ad-network.example"
  attributionSourceNonce="nonce-from-ad-network">
  Download the app
</a>

Key points:

  • hrefis an App Store link being promoted. -attributionDestinationThis is where Apple gets its signature impression. -attributionSourceNonceUsed to allow ad networks to target raw ad impressions.
  • session indicates that this type of link can be used for first-party site or embedded cross-site iframe (14:11).

Apple will start withattributionDestinationExtract eTLD+1, add fixed protocol, well-known qualifier, and fixed path components to construct an HTTP POST URL. The POST body is JSON and contains the original linksource_nonce14:22)。

{
  "source_nonce": "nonce-from-ad-network"
}

Key points:

  • source_nonceCorresponds to the nonce in the ad link.
  • Used by ad networks to find and return signature impressions.
  • The returned signed impression will include source domain, which is the field corresponding to the source app ID in the web attribution process.
  • The postback server must be able to parse the new optional source domain field (15:43).

5. StoreKitTest can verify impression and postback

(16:28) Apple provides SKAdNetwork testability changes in Xcode 13.3, placed in the unit testing framework of StoreKitTest. It solves two common friction points: the signing and configuration of impressions, and the reception and verification of postbacks.

The process of verifying impression is: create and configureSKAdImpression, provide the public key corresponding to the private key used to generate the signature, and then callSKAdTestSessionofvalidatemethod. Configuration errors or invalid signatures will throw errors (17:19).

// Concept example: validate SKAdImpression configuration and signature
let impression = SKAdImpression()
let publicKey = loadPublicKeyForTesting()

try skAdTestSession.validate(impression, publicKey: publicKey)

Key points:

  • SKAdImpressionis the ad impression being tested. -publicKeyCorresponding to the signing private key, the session explicitly requires it. -validatefromSKAdTestSession.
  • This test can fail prematurely if signature or impression configuration is wrong.

Testing postback is a two-step process. Create firstSKAdTestPostback, configure the value to be sent and the postback URL, and then passsetPostbacksAdd toSKAdTestSession. subsequently calledflushPostbacks, the test postback will be sent to the specified local or remote server (17:49).

// Concept example: send a test postback to the specified server
let postback = SKAdTestPostback()
postback.url = URL(string: "https://example.test/skadnetwork/postback")!

skAdTestSession.setPostbacks([postback])
skAdTestSession.flushPostbacks()

Key points:

  • SKAdTestPostbackIndicates that the postback is to be simulated. -postback.urlIt is the receiving server address, which can be a remote server or a local server. -setPostbacksAdd the test postback to the session. -flushPostbacksTrigger sending, session indicates that it will be sent to the specified server via the network.

Core Takeaways

1. Make a Source Identifier code list checker

  • What to do: Split the 4-digit Source Identifier into three-digit meanings of 2-digit, 3-digit, and 4-digit, and check whether key business information can still be returned under a low anonymity level.
  • Why it’s worth it: SKAdNetwork 4.0 returns different number of digits by crowd anonymity; incorrect encoding can make low-volume ads completely lose analyzable signal.
  • How ​​to start: Create a table from the three dimensions of campaign, location bucketing, and advertising space, and then write inverse solution logic for each dimension.

2. Make a set of coarse conversion value mapping background

  • What to do: Define independent meanings for low, medium, and high, and map them to key post-installation behavioral stages.
  • Why it’s worth doing: coarse value is returned earlier than fine value, suitable for new advertising campaigns or scenarios with low installation volume.
  • How ​​to start: Divide the events into three categories: “Startup”, “Complete core action”, and “High-value behavior”, and then write them into the conversion update strategy.

3. Make three rounds of postback attribution boards

  • What to do: Display installation quality, follow-up behavior and re-engagement by first, second and third rounds respectively.
  • Why it’s worth doing: SKAdNetwork 4.0 no longer only gives one postback, the latter two rounds can make up for the long-term behavior lost by the old model.
  • How ​​to start: Add a postback sequence or window field to the server table structure, and the query layer aggregates conversion events by window.

4. Web advertising signature impression service

  • What to do: Based onsource_nonceReturn the corresponding signed impression and record the source domain.
  • Why it’s worth it: After web ads enter SKAdNetwork, the ad network needs to be able to respond to HTTP POSTs on Apple-constructed URLs.
  • How ​​to start: First implement the search interface from nonce to impression, and then make the postback parsing logic compatible with the optional source domain.

5. Create a local postback verification environment

  • What to do: UseSKAdTestSessionandSKAdTestPostbackSend the test postback to the local server to verify reception, parsing and storage.
  • Why it’s worth doing: Signature configuration and postback reception are friction points explicitly mentioned in the session, and unit testing can expose problems in advance.
  • How ​​to start: Configure the postback URL in the test to point to the local service and callsetPostbacksandflushPostbacks, asserts that the server received the expected fields.

Comments

GitHub Issues · utterances