Skip to content

Add option to remove tracking parameters from URLs - #1413

Open
E0lee wants to merge 1 commit into
p0deje:masterfrom
E0lee:feature/remove-tracking-parameters
Open

Add option to remove tracking parameters from URLs#1413
E0lee wants to merge 1 commit into
p0deje:masterfrom
E0lee:feature/remove-tracking-parameters

Conversation

@E0lee

@E0lee E0lee commented Jun 5, 2026

Copy link
Copy Markdown

Summary

  • Adds a new "Remove tracking parameters from URLs" toggle in General → Behavior (default: off)
  • When enabled, strips known tracking query parameters from copied URLs at capture time — so the clean URL is what gets stored and pasted
  • Parameters are loaded from a bundled TrackingParameters.plist, making the list easy to extend without recompiling

What's included

File Change
Maccy/TrackingParameters.plist New bundle resource listing 80+ tracking params grouped by vendor (UTM, Google Ads, Meta/Facebook, Microsoft, Twitter/X, HubSpot, Mailchimp, Marketo, Amazon, Adobe Analytics, and others)
Maccy/URLCleaner.swift New struct — loads the plist once at launch, exposes isURL(_:) and clean(_:) using URLComponents
Defaults.Keys+Names.swift Adds removeTrackingParameters Bool key (default false)
Clipboard.swift In the pasteboard capture loop, when the setting is on and the copied string is an http/https URL, replaces the stored value with the cleaned URL
GeneralSettingsPane.swift Toggle added in the Behavior section, below "Paste without formatting"
en.lproj/GeneralSettings.strings Localization string added

Example

Copying https://example.com/page?utm_source=newsletter&utm_campaign=summer&id=42 stores https://example.com/page?id=42.

Introduces a new setting "Remove tracking parameters from URLs" (default off)
in the General preferences pane. When enabled, Maccy strips known tracking
query parameters (UTM, Google Ads, Meta, Microsoft, HubSpot, Mailchimp,
Marketo, Amazon, and others) from URLs at copy time using URLComponents,
so the cleaned URL is what gets stored and pasted.

Implementation:
- TrackingParameters.plist: bundle resource listing 80+ known tracking params,
  grouped by vendor for easy future maintenance
- URLCleaner.swift: loads the plist at launch and exposes clean(_:) / isURL(_:)
- Defaults.Keys+Names.swift: adds removeTrackingParameters Bool key (default false)
- Clipboard.swift: applies URLCleaner in the pasteboard capture loop when the
  setting is enabled and the copied string is an http/https URL
- GeneralSettingsPane.swift: adds the toggle in the Behavior section
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant