TN3182: Adding privacy tracking keys to your privacy manifest
Declare the tracking domains you use in your app or third-party SDK in a privacy manifest.
Overview
When you build an app or third-party SDK that contacts domains engaged in tracking, perform these steps in your privacy manifest (PrivacyInfo.xcprivacy):
Add the
NSPrivacyTrackingkey and set its value totrue.Add the
NSPrivacyTrackingDomainskey and set its value to a list of tracking domains.
For more information about these keys and the privacy manifest, see Privacy manifest files.
This document describes how to add the NSPrivacyTracking and NSPrivacyTrackingDomains keys to your privacy manifest in Xcode. If you work outside of Xcode, review this document to learn about the expected structure of each key.
Add the privacy tracking key
The NSPrivacyTracking key uses the following format:
<key>NSPrivacyTracking</key>
<!-- Use <true/> if your app or third-party SDK contacts domains engaged in tracking; otherwise use
<false/>. -->
<true/>To add the NSPrivacyTracking key to your privacy manifest:
Select
PrivacyInfo.xcprivacyin the Project navigator.Click the Add button (+) beside the
App Privacy Configurationkey in the property list editor.In the pop-up menu that appears, choose
NSPrivacyTracking.Confirm the value is
Booleanin the Type column.Select
YESfrom the pop-up menu in the Value column.
Add a tracking domain to the privacy tracking domains key
Set the value of the NSPrivacyTrackingDomains key to a list of tracking domains in your privacy manifest. For more information about tracking domains, see “Configure a tracking domain” in TN3181: Debugging an invalid privacy manifest.
To add a tracking domain to the NSPrivacyTrackingDomains key in your privacy manifest:
Select
PrivacyInfo.xcprivacyin the Project navigator.Find the
NSPrivacyTrackingDomainskey in the property list editor.Confirm the value is
Arrayin the Type column.Click the disclosure triangle to the left of
NSPrivacyTrackingDomainsto reveal it.Click the Add button (+) beside
NSPrivacyTrackingDomainsto insert a tracking domain such asmywebsite.example.com.
Add the privacy tracking domains key
The NSPrivacyTrackingDomains key uses the following format:
<key>NSPrivacyTrackingDomains</key>
<array>
<string>mywebsite.example.com</string>
...
</array>Each string value in the array identifies an internet domain your app or third-party SDK connects to that engages in tracking. For more information, see Add a tracking domain to the privacy tracking domains key.
To add the NSPrivacyTrackingDomains key to your privacy manifest:
Select
PrivacyInfo.xcprivacyin the Project navigator.Click the Add button (+) beside the
App Privacy Configurationkey in the property list editor.In the pop-up menu that appears, choose
NSPrivacyTrackingDomains.Confirm the value is
Arrayin the Type column.To add a tracking domain to the array, see Add a tracking domain to the privacy tracking domains key.
The following example declares one tracking domain for an app called Sample:
Repeat step 5 for each additional tracking domain your app or third-party SDK contacts. The example below declares an additional tracking domain for Sample:
Revision History
2024-12-17 First published.
See Also
Latest
TN3205: Low-latency communication with RDMA over ThunderboltTN3206: Updating Apple Pay certificatesTN3179: Understanding local network privacyTN3190: USB audio device design considerationsTN3194: Handling account deletions and revoking tokens for Sign in with AppleTN3193: Managing the on-device foundation model’s context windowTN3115: Bluetooth State Restoration app relaunch rulesTN3192: Migrating your iPad app from the deprecated UIRequiresFullScreen keyTN3151: Choosing the right networking APITN3111: iOS Wi-Fi API overviewTN3191: IMAP extensions supported by Mail for iOS, iPadOS, and visionOSTN3134: Network Extension provider deploymentTN3189: Managing Mail background traffic loadTN3187: Migrating to the UIKit scene-based life cycleTN3188: Troubleshooting In-App Purchases availability in the App Store