StoreKit Ad Network (SKAdNetwork) is Apple’s attribution framework for app install and reinstall attribution. The SKAdNetwork workflow is as follows:
- Apple gathers attribution information and notifies the relevant ad network.
- The ad network sends a postback with this information to Adjust.
- Adjust displays SKAdNetwork data in Datascape.
Disable SKAdNetwork communication
The Adjust SDK communicates with SKAdNetwork by default. Upon initialization, it registers for SKAdNetwork attribution.
You can disable this behavior by setting the isSkanAttributionEnabled
key in your configuration table to false
.
local adjust = require "plugin.adjust"
adjust.initSdk({ appToken = "YourAppToken", environment = "SANDBOX", logLevel = "VERBOSE", isSkanAttributionEnabled = false})
Update conversion values
Conversion values are a mechanism used to measure user behavior in SKAdNetwork. You can map 64 conditions to values from 0
through 63
and send this integer value to SKAdNetwork on user install. This gives you insight into how your users interact with your app in the first few days.
If you manage your conversion values with Adjust, the servers update this value in the SDK. You can also update this value by using the updateSkanConversionValue
method. It accepts the following arguments:
Argument | Data type | Description |
---|---|---|
conversionValue | number | Your conversion value. Must be between 0 and 63 . |
coarseValue | string (SKAdNetwork.CoarseConversionValue ) | The coarse conversion value. This value is used if your app doesn’t have sufficient installs to reach the privacy threshold.
|
lockWindow | boolean | Whether to send the postback before the conversion window ends. Use true to tell the system to send the postback without waiting for the end of the conversion window. Defaults to false . |
callback | function | An optional callback you provide to catch and handle any errors this method encounters when you update a conversion value. |
adjust.updateSkanConversionValue(conversionValue, coarseValue, lockWindow, function(event) if event.message ~= nil then print("SKAN update error: " .. event.message) else -- successfully updated endend)
Listen for changes to conversion values
If you use Adjust to manage conversion values, the servers send updates to the SDK automatically. You can set up a delegate function to listen for these changes using the setSkanUpdatedCallback
method. Pass your function as an argument.
local adjust = require "plugin.adjust"local json = require "json"
-- callback needs to be set before calling initSdk methodadjust.setSkanUpdatedCallback(function(event) local json_skan_updated = json.decode(event.message) print("SKAN conversion value updated!") print("Conversion value: " .. (json_skan_updated.conversionValue or "N/A")) print("Coarse value: " .. (json_skan_updated.coarseValue or "N/A")) print("Lock window: " .. (json_skan_updated.lockWindow or "N/A")) print("Error: " .. (json_skan_updated.error or "N/A"))end)
-- ...
adjust.initSdk({ appToken = "YourAppToken", environment = "SANDBOX", logLevel = "VERBOSE"})
Set up direct install postbacks
You can configure your app to send a copy of winning SKAdNetwork callbacks to Adjust. This enables you to use SKAdNetwork information in your analytics.
To set up direct install postbacks, you need to add the Adjust callback URL to your Info.plist
file:
- Select Info.plist in the Project navigator in Xcode.
- Select the Add button beside a key in the property list editor and press
Return
. - Enter
NSAdvertisingAttributionReportEndpoint
as the key name. - Set the Type to String in the pop up menu.
- Enter the address
https://adjust-skadnetwork.com
.