{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"required","settings":"","results":{"codes":[]},"params":[]},"next":{"description":"","pages":[]},"title":"- iOS 14 and SKAdNetwork","type":"basic","slug":"ios14-and-skadnetwork","excerpt":"","body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"SKAdNetwork is an attribution solution introduced by Apple. It validates advertiser-driven app installations without disclosing user-level data. With the iOS 14 update, the utilization of SKAdNetwork framework will become more important since IDFA (Apple’s Identifier for Advertiser) is going to be opted-out by default.\\n\\nThe 'opted-out by default' setup was originally planned to happen with the release of iOS 14, but has been delayed to early next year. To prepare the change in time, we suggest our partners to already start adding support for SKAdNetwork.\\n\\nFor more information, please check the official documentation:\\n[https://developer.apple.com/documentation/storekit/skadnetwork](https://developer.apple.com/documentation/storekit/skadnetwork)\",\n  \"title\": \"About SKAdNetwork\"\n}\n[/block]\n## If you're a Supply Partner (Publisher)\nAdd SKAdNetwork ID of all network partners you work with in the app's info.plist file.\nVGI is a registered network with Apple and if you need the SKAdNetwork ID, please contact one of our account managers.\n\n\n## If you're a Demand Partner (DSP)\nRegister your Ad Network with Apple ([link](https://developer.apple.com/documentation/storekit/skadnetwork/registering_an_ad_network))\n\n## Flow of SKAdNetwork framework\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/8898250-SKAdNetwork_flow_chart-01_2.png\",\n        \"SKAdNetwork flow chart-01 (2).png\",\n        2134,\n        1211,\n        \"#ebebeb\"\n      ]\n    }\n  ]\n}\n[/block]\n---\n\n# Bid Request\nIn case app's info.plist file has at least one item of PubNative inside SKAdNetworkItems array, Publisher can send `BidRequest.imp.ext.skadn` object in Bid Request. This provides the information required to create a signature from the DSP side.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Attribute\",\n    \"h-1\": \"Description\",\n    \"h-2\": \"Type\",\n    \"h-3\": \"Example\",\n    \"0-0\": \"version\",\n    \"1-0\": \"sourceapp\",\n    \"2-0\": \"skadnetids\",\n    \"0-1\": \"Version of SKAdNetwork supported. Should be always \\\"2.0\\\" or higher.\",\n    \"1-1\": \"ID of the publisher app in the Apple app store. Should match `BidRequest.app.bundle`\",\n    \"2-1\": \"A list of SKAdNetwork ID entries in the publisher app's info.plist\",\n    \"0-2\": \"string\",\n    \"1-2\": \"string\",\n    \"2-2\": \"string\",\n    \"0-3\": \"\\\"version\\\": \\\"2.0\\\"\",\n    \"1-3\": \"\\\"sourceapp\\\": \\\"589250002\\\"\",\n    \"2-3\": \"\\\"skadnetids\\\": [\\\"TL55SBB4FM.skadnetwork\\\", \\\"6xzpu9s2p8.skadnetwork\\\"]\"\n  },\n  \"cols\": 4,\n  \"rows\": 3\n}\n[/block]\n# Bid Response\nFor the Bid Request that includes `BidRequest.imp.ext.skadn`, DSP can respond with `BidResponse.seatbid.bid.ext.skadn` object included. If present, Publisher can use the signature of this object for attribution.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Attribute\",\n    \"h-1\": \"Description\",\n    \"h-2\": \"Type\",\n    \"h-3\": \"Example\",\n    \"0-0\": \"version\",\n    \"1-0\": \"network\",\n    \"2-0\": \"campaign\",\n    \"3-0\": \"itunesitem\",\n    \"5-0\": \"sourceapp\",\n    \"6-0\": \"timestamp\",\n    \"7-0\": \"signature\",\n    \"0-1\": \"Version of the SKAdNetwork, must be 2.0 or higher\",\n    \"0-2\": \"string\",\n    \"1-2\": \"string\",\n    \"2-2\": \"string\",\n    \"3-2\": \"string\",\n    \"5-2\": \"string\",\n    \"6-2\": \"string\",\n    \"7-2\": \"string\",\n    \"1-1\": \"Ad network identifier used in the signature\",\n    \"2-1\": \"A campaign ID integer between 1 and 100\",\n    \"3-1\": \"ID of the advertiser app in the Apple's App Store\",\n    \"7-1\": \"SKAdNetwork signature specified by Apple\",\n    \"6-1\": \"Unix time in mills at the time of signature was generated\",\n    \"5-1\": \"ID of publisher app in Apple's App Store. Should match `BidRequest.imp.ext.skadn.sourceapp`\",\n    \"0-3\": \"\\\"version\\\": \\\"2.0\\\"\",\n    \"1-3\": \"\\\"network\\\": \\\"TL55SBB4FM.skadnetwork\\\"\",\n    \"2-3\": \"\\\"campaign\\\": \\\"20\\\"\",\n    \"3-3\": \"\\\"itunesitem\\\": \\\"1382171002\\\"\",\n    \"5-3\": \"\\\"sourceapp\\\": \\\"589250002\\\"\",\n    \"6-3\": \"“timestamp\\\": \\\"1596789650173\\\"\",\n    \"7-3\": \"\\\"signature\\\": \\\"MDYCGQCsQ4y8d4BlYU9b8Qb...\\\"\",\n    \"4-0\": \"nonce\",\n    \"4-1\": \"An id unique to each ad response\",\n    \"4-2\": \"string\",\n    \"4-3\": \"\\\"nonce\\\": \\\"abcde12f-a1bc-00078956\\\"\"\n  },\n  \"cols\": 4,\n  \"rows\": 8\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"skadn\\\": {\\n        \\\"version\\\": \\\"2.0\\\",\\n        \\\"network\\\": \\\"TL55SBB4FM\\\",\\n        \\\"campaign\\\": \\\"20\\\",\\n        \\\"itunesitem\\\": \\\"1382171002\\\",\\n        \\\"nonce\\\": \\\"abcde12f-a1bc-00078956\\\",\\n        \\\"sourceapp\\\": \\\"589250002\\\",\\n        \\\"timestamp\\\": \\\"1596789650173\\\",\\n        \\\"signature\\\": \\\"MDYCGQCsQ4y8d4BlYU9b8Qb9BPWPi+ixk\\\\/OiRysCGQDZZ8fpJnuqs9my8iSQVbJO\\\\/oU1AXUROYU=\\\",\\n    }\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Example\"\n    }\n  ]\n}\n[/block]\nSome of these parameters can be generated directly from the publisher app instead of the server (e.g. timestamp and sourceapp).\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"#import <StoreKit/SKAdNetwork.h>\\n\\n- (NSDictionary*) buildProductParameters {\\n\\tNSMutableDictionary* productParams = [[NSMutableDictionary alloc] init];\\n    \\n\\tif (:::at:::available(iOS 11.3, *)) {\\n    \\t[productParams setObject:@\\\"MEUCIDyADtEnrijaSao0Es9NIzpcXNQmQYpsUTL34/Fe4EC3AiEAjn5IuL6L55OPESYC7mB07S3tXHGnMxhK7rwG55vrQcQ=\\\" forKey:SKStoreProductParameterAdNetworkAttributionSignature];\\n    \\t[productParams setObject:@\\\"1382171002\\\" forKey:SKStoreProductParameterITunesItemIdentifier];\\n    \\t[productParams setObject:@\\\"TL55SBB4FM\\\" forKey:SKStoreProductParameterAdNetworkIdentifier];\\n   \\t \\n    \\t// These product params should be of NSNumber* type.\\n    \\t[productParams setObject: [NSNumber numberWithInt: 20] forKey:SKStoreProductParameterAdNetworkCampaignIdentifier];\\n    \\t[productParams setObject: [NSNumber numberWithLong: 1596186876730] forKey:SKStoreProductParameterAdNetworkTimestamp];\\n   \\t \\n    \\tif (@available(iOS 14, *)) {\\n        \\t[productParams setObject:@\\\"2.0\\\" forKey:SKStoreProductParameterAdNetworkVersion];\\n        \\t[productParams setObject:@\\\"589250002\\\" forKey:SKStoreProductParameterAdNetworkSourceAppStoreIdentifier];\\n    \\t}\\n   \\t \\n    \\t// This param has to be of NSUUID type, an exception is thrown if it is passed in NSString* type.\\n    \\t[productParams setObject:[[NSUUID alloc] initWithUUIDString:@\\\"c3428a78-a8f2-4cdc-a5a5-5ec82d0b2d73\\\"] forKey:SKStoreProductParameterAdNetworkNonce];\\n\\t}\\n    \\n\\treturn productParams;\\n}\\n\\n    \\t// This is how to load the App Store app using StoreKit\\n\\nNSDictionary* productParams = [self buildProductParameters];\\n        \\tdispatch_async(dispatch_get_main_queue(), ^ {\\n            \\tHyBidStoreAdController* adController = [[HyBidStoreAdController alloc] initWithProductParameters:productParams];\\n            \\t[viewController presentViewController:adController animated:YES completion:nil];\\n        \\t});\\n\\n    \\t// The HyBidStoreAdController needs to be created as a subclass of SKStoreProductViewController\\n\\[email protected] HyBidStoreAdController : SKStoreProductViewController {\\n\\tNSDictionary* productParameters;\\n}\\n\\n- (id)initWithProductParameters:(NSDictionary*)productParameters;\\n\\[email protected]\\n\",\n      \"language\": \"objectivec\",\n      \"name\": \"Sample of how to use the params and handle the click on the ad using them\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"success\",\n  \"title\": \"Finished with the integration?\",\n  \"body\": \"We provide a list of Contextual Parameters which can be sent in the bid stream.\\nSending the parameters plays a critical role in keeping the granularity of user targeting without IDFA.\\nYou can find more information here: **[Contextual App Targeting](https://developers.pubnative.net/v3.0/docs/contextual-app-targeting)**\"\n}\n[/block]","updates":[],"order":19,"isReference":true,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"5f44ff15a124c20012d14a7a","createdAt":"2020-08-25T12:07:49.373Z","user":"59aebb87fde5ab002740a01c","category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"[PUBLISHER] API Documentation","slug":"api-documentation","order":1,"from_sync":false,"reference":true,"_id":"5774fe18605b770e0037be8a","__v":0,"project":"574ff4bd3fa1870e00889ba6","version":"574ff4bd3fa1870e00889ba9","createdAt":"2016-06-30T11:10:16.206Z"},"version":{"version":"3.0","version_clean":"3.0.0","codename":"","is_stable":true,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["574ff4bd3fa1870e00889baa","577278ecdceb570e003a9001","577279865617b117009e643f","577279985617b117009e6440","577279bc8c48e00e00503504","5774fe18605b770e0037be8a","577ce3ad87acf617003c4187","577f8476a77c700e006a6c52","57b486ae0d2b640e00e9d3f5","57b722133d3e620e004ec74b","57bd95f00fe3a00e003e2cc5","57c8349359cd4b0e00b888ef","57c8349b5754fa1700b12242","57cedb0bad483e0e00890239","57cedbe807d7ea0e00e438cc","57d82967156ef72b007ffcd8","58ee353ad1ee2f0f0034a13d","596623221738df00298622a5","59a51730192dba000fc9ca38","59a8129f1e7b26000fa0fb1a","5a0322bf044b6f001c236e36","5a79897c5b6e430030746df6","5a79898c2b2d5f0012cbab63","5ab3b5e3d2d1e2006252a8f2","5b1a43bd678eab0003aa54a4","5b6d95e29d346300038baff3","5c77d3a1e0794000451bced2","5e902519bb65b200466e7957","5f228f5bd6a1cc0024afda30"],"_id":"574ff4bd3fa1870e00889ba9","createdAt":"2016-06-02T08:56:29.492Z","project":"574ff4bd3fa1870e00889ba6","releaseDate":"2016-06-02T08:56:29.492Z","__v":29},"project":"574ff4bd3fa1870e00889ba6","__v":0,"parentDoc":null}

- iOS 14 and SKAdNetwork


[block:callout] { "type": "info", "body": "SKAdNetwork is an attribution solution introduced by Apple. It validates advertiser-driven app installations without disclosing user-level data. With the iOS 14 update, the utilization of SKAdNetwork framework will become more important since IDFA (Apple’s Identifier for Advertiser) is going to be opted-out by default.\n\nThe 'opted-out by default' setup was originally planned to happen with the release of iOS 14, but has been delayed to early next year. To prepare the change in time, we suggest our partners to already start adding support for SKAdNetwork.\n\nFor more information, please check the official documentation:\n[https://developer.apple.com/documentation/storekit/skadnetwork](https://developer.apple.com/documentation/storekit/skadnetwork)", "title": "About SKAdNetwork" } [/block] ## If you're a Supply Partner (Publisher) Add SKAdNetwork ID of all network partners you work with in the app's info.plist file. VGI is a registered network with Apple and if you need the SKAdNetwork ID, please contact one of our account managers. ## If you're a Demand Partner (DSP) Register your Ad Network with Apple ([link](https://developer.apple.com/documentation/storekit/skadnetwork/registering_an_ad_network)) ## Flow of SKAdNetwork framework [block:image] { "images": [ { "image": [ "https://files.readme.io/8898250-SKAdNetwork_flow_chart-01_2.png", "SKAdNetwork flow chart-01 (2).png", 2134, 1211, "#ebebeb" ] } ] } [/block] --- # Bid Request In case app's info.plist file has at least one item of PubNative inside SKAdNetworkItems array, Publisher can send `BidRequest.imp.ext.skadn` object in Bid Request. This provides the information required to create a signature from the DSP side. [block:parameters] { "data": { "h-0": "Attribute", "h-1": "Description", "h-2": "Type", "h-3": "Example", "0-0": "version", "1-0": "sourceapp", "2-0": "skadnetids", "0-1": "Version of SKAdNetwork supported. Should be always \"2.0\" or higher.", "1-1": "ID of the publisher app in the Apple app store. Should match `BidRequest.app.bundle`", "2-1": "A list of SKAdNetwork ID entries in the publisher app's info.plist", "0-2": "string", "1-2": "string", "2-2": "string", "0-3": "\"version\": \"2.0\"", "1-3": "\"sourceapp\": \"589250002\"", "2-3": "\"skadnetids\": [\"TL55SBB4FM.skadnetwork\", \"6xzpu9s2p8.skadnetwork\"]" }, "cols": 4, "rows": 3 } [/block] # Bid Response For the Bid Request that includes `BidRequest.imp.ext.skadn`, DSP can respond with `BidResponse.seatbid.bid.ext.skadn` object included. If present, Publisher can use the signature of this object for attribution. [block:parameters] { "data": { "h-0": "Attribute", "h-1": "Description", "h-2": "Type", "h-3": "Example", "0-0": "version", "1-0": "network", "2-0": "campaign", "3-0": "itunesitem", "5-0": "sourceapp", "6-0": "timestamp", "7-0": "signature", "0-1": "Version of the SKAdNetwork, must be 2.0 or higher", "0-2": "string", "1-2": "string", "2-2": "string", "3-2": "string", "5-2": "string", "6-2": "string", "7-2": "string", "1-1": "Ad network identifier used in the signature", "2-1": "A campaign ID integer between 1 and 100", "3-1": "ID of the advertiser app in the Apple's App Store", "7-1": "SKAdNetwork signature specified by Apple", "6-1": "Unix time in mills at the time of signature was generated", "5-1": "ID of publisher app in Apple's App Store. Should match `BidRequest.imp.ext.skadn.sourceapp`", "0-3": "\"version\": \"2.0\"", "1-3": "\"network\": \"TL55SBB4FM.skadnetwork\"", "2-3": "\"campaign\": \"20\"", "3-3": "\"itunesitem\": \"1382171002\"", "5-3": "\"sourceapp\": \"589250002\"", "6-3": "“timestamp\": \"1596789650173\"", "7-3": "\"signature\": \"MDYCGQCsQ4y8d4BlYU9b8Qb...\"", "4-0": "nonce", "4-1": "An id unique to each ad response", "4-2": "string", "4-3": "\"nonce\": \"abcde12f-a1bc-00078956\"" }, "cols": 4, "rows": 8 } [/block] [block:code] { "codes": [ { "code": "{\n \"skadn\": {\n \"version\": \"2.0\",\n \"network\": \"TL55SBB4FM\",\n \"campaign\": \"20\",\n \"itunesitem\": \"1382171002\",\n \"nonce\": \"abcde12f-a1bc-00078956\",\n \"sourceapp\": \"589250002\",\n \"timestamp\": \"1596789650173\",\n \"signature\": \"MDYCGQCsQ4y8d4BlYU9b8Qb9BPWPi+ixk\\/OiRysCGQDZZ8fpJnuqs9my8iSQVbJO\\/oU1AXUROYU=\",\n }\n}", "language": "json", "name": "Example" } ] } [/block] Some of these parameters can be generated directly from the publisher app instead of the server (e.g. timestamp and sourceapp). [block:code] { "codes": [ { "code": "#import <StoreKit/SKAdNetwork.h>\n\n- (NSDictionary*) buildProductParameters {\n\tNSMutableDictionary* productParams = [[NSMutableDictionary alloc] init];\n \n\tif (@available(iOS 11.3, *)) {\n \t[productParams setObject:@\"MEUCIDyADtEnrijaSao0Es9NIzpcXNQmQYpsUTL34/Fe4EC3AiEAjn5IuL6L55OPESYC7mB07S3tXHGnMxhK7rwG55vrQcQ=\" forKey:SKStoreProductParameterAdNetworkAttributionSignature];\n \t[productParams setObject:@\"1382171002\" forKey:SKStoreProductParameterITunesItemIdentifier];\n \t[productParams setObject:@\"TL55SBB4FM\" forKey:SKStoreProductParameterAdNetworkIdentifier];\n \t \n \t// These product params should be of NSNumber* type.\n \t[productParams setObject: [NSNumber numberWithInt: 20] forKey:SKStoreProductParameterAdNetworkCampaignIdentifier];\n \t[productParams setObject: [NSNumber numberWithLong: 1596186876730] forKey:SKStoreProductParameterAdNetworkTimestamp];\n \t \n \tif (@available(iOS 14, *)) {\n \t[productParams setObject:@\"2.0\" forKey:SKStoreProductParameterAdNetworkVersion];\n \t[productParams setObject:@\"589250002\" forKey:SKStoreProductParameterAdNetworkSourceAppStoreIdentifier];\n \t}\n \t \n \t// This param has to be of NSUUID type, an exception is thrown if it is passed in NSString* type.\n \t[productParams setObject:[[NSUUID alloc] initWithUUIDString:@\"c3428a78-a8f2-4cdc-a5a5-5ec82d0b2d73\"] forKey:SKStoreProductParameterAdNetworkNonce];\n\t}\n \n\treturn productParams;\n}\n\n \t// This is how to load the App Store app using StoreKit\n\nNSDictionary* productParams = [self buildProductParameters];\n \tdispatch_async(dispatch_get_main_queue(), ^ {\n \tHyBidStoreAdController* adController = [[HyBidStoreAdController alloc] initWithProductParameters:productParams];\n \t[viewController presentViewController:adController animated:YES completion:nil];\n \t});\n\n \t// The HyBidStoreAdController needs to be created as a subclass of SKStoreProductViewController\n\[email protected] HyBidStoreAdController : SKStoreProductViewController {\n\tNSDictionary* productParameters;\n}\n\n- (id)initWithProductParameters:(NSDictionary*)productParameters;\n\[email protected]\n", "language": "objectivec", "name": "Sample of how to use the params and handle the click on the ad using them" } ] } [/block] [block:callout] { "type": "success", "title": "Finished with the integration?", "body": "We provide a list of Contextual Parameters which can be sent in the bid stream.\nSending the parameters plays a critical role in keeping the granularity of user targeting without IDFA.\nYou can find more information here: **[Contextual App Targeting](https://developers.pubnative.net/v3.0/docs/contextual-app-targeting)**" } [/block]