Skip to main content

Disable personalized advertisements and identifier tracking

Overview

About this script

This script improves your privacy on macOS.

These changes use Mac system commands to update your settings.

This script enhances your privacy by deactivating Personalized Ads and disabling the collection of identifiers related to your device. The process involves modifying certain key configurations, which prevents Apple's advertising platform from using your personal information to deliver targeted ads 1.

When Personalized Ads is enabled, your information may be used to provide ads that closely align with your interests 1. You might occasionally encounter such targeted ads in Apple News, Stocks, and the Mac App Store 2. Disabling Personalized Ads will prevent Apple from using your data for ad targeting 2. Although this does not necessarily decrease the quantity of ads you receive, it may result in the ads being less relevant to your interests 2.

The primary keys to deactivating personalized ads are:

  • allowApplePersonalizedAdvertising: If set to false, this restricts Apple's personalized advertising 3. This is applicable on macOS 12 and subsequent versions 3.
  • allowIdentifierForAdvertising: The advertisingIdentifier is a unique string assigned to each device 5. Apple uses this identifier and recommends its use in third-party applications for tasks like frequency capping, attribution, conversion events, estimating the number of unique users, detecting advertising fraud, and debugging 5. Although there is no official documentation on it, a discussion on JAMF.com corroborates its existence 6.

My tests show that disabling any of the keys mentioned above results in the "System Preferences > Apple Advertising > Personalized ads" option being deactivated in the GUI, starting from macOS Monterey.

Please note: The forceLimitAdTracking key limits ad tracking 3 4 and is found in CIS benchmarks for macOS 4. However, the official macOS documentation specifies that it is applicable only to iOS 7 and newer versions, not to macOS 3. The key does not exist on the OS by default.

This script uses Bash (Shell script) scripting language.

Safe for General Use

This script is recommended for all users. It helps to improve privacy without affecting stability.

Implementation Details
  • Language: bash

  • Required Privileges: Administrative (sudo) access

  • Compatibility: macOS only

  • Reversibility: Can be undone using provided revert script

Explore Categories

This action belongs to Configure OS category. This category configures macOS using 16 scripts. These scripts are organized in 4 categories. The category includes 7 subscripts and 2 subcategories that include more scripts and categories. Read more on category page ▶

Apply now

Choose one of three ways to apply:

  1. Automatically via privacy.sexy: The easiest and safest option.
  2. Manually by downloading: Requires downloading a file.
  3. Manually by copying: Advanced flexibility.

Alternative 1. Apply with Privacy.sexy

privacy.sexy is free and open-source application that lets securely apply this action easily.

Open privacy.sexy

You can fully restore this action (revert back to the original behavior) using the application.

privacy.sexy instructions
  1. Open or download the desktop application
  2. Search for the script name: Disable personalized advertisements and identifier tracking.
  3. Check the script by clicking on the checkbox.
  4. Click on Run button at the bottom of the page.

Alternative 2. Download

Irreversible Changes

This script is irreversible, meaning there is no straightforward method to restore changes once applied. Exercise caution before running, restoring it may not be possible.

  1. Download the script file by clicking on the button below:

    Download script

  2. Run the script file by clicking on it.

Download revert script

This file restores your system to its original state, before this script is applied.

Download restore script

Alternative 3. Copy

This is for advanced users. Consider automatically applying or downloading the script for simpler way.

  1. Open Terminal app

  2. Copy the following code:

Code to apply changes
defaults write com.apple.AdLib allowIdentifierForAdvertising -bool false
defaults write com.apple.AdLib allowApplePersonalizedAdvertising -bool false
defaults write com.apple.AdLib forceLimitAdTracking -bool true
  1. Paste the code into terminal.
  2. Press Enter to apply the code.

Some scripts requires restarting your computer to take affect.

Copy restore code

Copy and run the following code to restore changes:

Revert code
defaults write com.apple.AdLib allowIdentifierForAdvertising -bool true
defaults write com.apple.AdLib allowApplePersonalizedAdvertising -bool true
sudo defaults delete com.apple.AdLib forceLimitAdTracking

Support

This website relies on your support.

Support now

Your donation helps keep the project alive and improves its content ❤️.

Share this page: