Contents

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):

  1. Add the NSPrivacyTracking key and set its value to true.

  2. Add the NSPrivacyTrackingDomains key 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:

  1. Select PrivacyInfo.xcprivacy in the Project navigator.

  2. Click the Add button (+) beside the App Privacy Configuration key in the property list editor.

  3. In the pop-up menu that appears, choose NSPrivacyTracking.

  4. Confirm the value is Boolean in the Type column.

  5. Select YES from 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:

  1. Select PrivacyInfo.xcprivacy in the Project navigator.

  2. Find the NSPrivacyTrackingDomains key in the property list editor.

  3. Confirm the value is Array in the Type column.

  4. Click the disclosure triangle to the left of NSPrivacyTrackingDomains to reveal it.

  5. Click the Add button (+) beside NSPrivacyTrackingDomains to insert a tracking domain such as mywebsite.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:

  1. Select PrivacyInfo.xcprivacy in the Project navigator.

  2. Click the Add button (+) beside the App Privacy Configuration key in the property list editor.

  3. In the pop-up menu that appears, choose NSPrivacyTrackingDomains.

  4. Confirm the value is Array in the Type column.

  5. 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