قالب وردپرس درنا توس
Home / Tips and Tricks / How to Automatically Remove Annoying Tracking Codes in URLs You Share from Your iPhone to Get Cleaner Links «iOS & iPhone :: Gadget Hacks

How to Automatically Remove Annoying Tracking Codes in URLs You Share from Your iPhone to Get Cleaner Links «iOS & iPhone :: Gadget Hacks



URL Tracking Codes: You’ll see them on almost every link you copy online to share with friends and followers. It could be tens or hundreds of extra characters added to the end of a URL that websites and marketers use to tell you how you got to the link at all. These redundant tracking tokens not only make the links you share look sloppy and spammy, they can even violate your privacy.

The problem with URL tracking codes

Tracking codes can be unique to each website for their own internal purposes, or they can be Urchin Tracking Module (UTM) parameters. Many sites and marketers use the latter, which can include sensitive information such as which website or app referred you to the URL, what search terms you used to get there, and whether you landed on the page via an email, newsletter , social site, app, ad, etc.

From a privacy standpoint, you may not want your family, friends, and followers with whom you share a link to know how you found the webpage. I̵

7;m sure you don’t want anyone to know that you visit adult websites, dating apps, and other embarrassing places – all of this is data that can be tagged at the end of a shared URL in a sea of ​​confusing text and numbers that can easily be overlooked.

Clean up links to share

You can manually remove all extra letters, numbers, and special characters in the URL before sharing the link, but why bother when you can automate the removal? There is also always a chance that you could cut too many characters from the URL which would result in a broken link to a dead web page. Instead, use a simple shortcut to clean up the mess from these annoying links.

The “Cleanup URL” shortcut for iOS and iPadOS reduces bloat for you and removes most of the tracking codes pasted at the end of URLs you share.

Best of all, this shortcut also cleans Google AMP links, which are meant to speed up your experience on the web. These accelerated mobile pages are cached for faster loading and can be viewed directly in Google Search. You can even swipe through stories on the topic of other sites without ever leaving Google Search. With AMP links, the extra stuff added to the URL will come before, not after, so you’ll see all those links start with google.com/amp/s.

Obligated

  • iOS 14: The “Generate Password” shortcut has been created and optimized for iOS 14 and has not been tested on iOS 13.
  • Shortcuts: If you removed the Shortcuts app, reinstall it from the App Store.
  • Allow untrusted shortcuts: To add user-created shortcuts to your library, go to Settings -> Shortcuts and enable “Allow untrusted shortcuts”.

Add the ‘Cleanup URL’ shortcut

The “Cleanup URL” shortcut created by Redditor sharp-guru can be installed using the direct iCloud link below or from their Reddit post.

You should be redirected to Shortcuts to preview the workflow, but tap “Get Shortcut” if you are not. To add the shortcut to your library, scroll through the shortcut’s actions and tap the red “Add untrusted shortcut” button at the bottom.

Use ‘Cleanup URL’ to shorten URLs

Once the shortcut has been added to your “My Shortcuts” library, it is all ready to be used in Safari, third-party browsers, other types of apps, and other places with sharing options. As long as the content you are sharing is a URL it should work.

Example 1: Cleaning up links from Reddit

First, we’ll try cleaning up a link for a Reddit post copied from the official Reddit app. Normally, when you share or copy a Reddit post from this app, the tokens will say you did this from the iOS app using the Share button along with a campaign ID.

This time, when “sharing” a Reddit post or link, don’t use “Copy Link” or select an app to share it – scroll down and tap the “Clean URL” shortcut instead.

At the top of the screen, you’ll see a notification with the cleaned up URL, which will automatically go to your clipboard so you can easily paste it elsewhere. Hit “Done” and you are good to go. Below you can see the clear URL versus the original URL. Doesn’t that look much better?

Example 2: Clean AMP links from Google

Now let’s try converting a Google AMP link to the actual web page URL.

To find a Google AMP link, google anything newsworthy in a web browser like Microsoft Edge, but make sure Google is your search engine. Then tap one of the articles suggested to you at the top of the results, which are maps from popular websites like CNN, Fox News, People, TMZ, etc.

In the search bar, you will see that the URL for the web page starts with google.com. Now not all browsers work the same with regard to Google AMP links.

If you use the Share button from the toolbar or AMP bar in Safari, Chrome or Brave, the google.com section will be removed automatically. Browsers like Firefox load the real article from AMP cards, so it doesn’t even matter here. However, browsers like Edge will use the google.com link when using the toolbar’s Share button.

If that’s you, instead of clicking “Copy” or sharing with another app, scroll down and tap the “Clean up URL” shortcut.

A preview of the sanitized link will appear again and it will be copied to your clipboard. Below you can see the difference between the two links.

Remove the ‘Done’ notification

If you want to streamline this shortcut so that you don’t have to tap “Done” every time a URL is copied with the Clean URL, you can edit its workflow. On the “My Shortcuts” tab in Shortcuts, tap the ellipsis icon (•••) on the “Clean URL” card. Scroll to the end of the workflow and then delete the “Text” action with the notification text, as well as the “Preview” action with the “Show Text” text below it. Press “Done” and you no longer have to work with that extra step.

Improvement of the ‘URL for cleaning’ shortcut

If you feel that the Cleanup URL is not good enough as it only searches for UTM codes and Google AMP links, you can extend it to search after the main URL for any type of tracking information.

If you go back to the editor for the shortcut, go to the action “Documents” that starts with “Replace”. Then replace the regular expression there with the one below. This will delete the UTM parameters so that everything after one? or & or # or = symbol, as well as AMP content.

?[^?]*|#[^#]*|&[^&]*|=[^=]*|(www.google.*/amp/s/|/amp)

This can of course break links to websites that have used these four symbols in their base URL structure, but you can customize the expression to suit what works for you. A good tool for creating and testing expressions is Regex101.

Cleanup URL is not perfect

It is important to note that the Cleanup URL does not always work perfectly. For some URLs, the shortcut can only delete part of the tracking codes. The more you try it out, the better you can get a sense of how it works and whether it’s worth running the shortcut and removing only some of the tracking codes. Either way, “Cleanup URL” can at least shorten the URLs with tracking codes.

However, some tracking codes cannot be cleaned up.

For example, whenever I try to share a story in an email from the Los Angeles Public Library, the tracking link looks the same as the Cleanup URL link. That’s because the LAPL uses a marketing platform that completely hides the real URL, so nothing needs to be cleaned up. The real URL is completely unrecoverable unless you open the link as it is buried behind the Base64 code structure.

laplca.patronpoint.com/r/4c62d0c9606cfbeac86459d8e?ct=YTo1OntzOjY6InNvdXJjZSI7YToyOntpOjA7czo1OiJlbWFpbCI7aToxO2k6MzY7fXM6NToiZW1haWwiO2k6MzY7czo0OiJzdGF0IjtzOjIyOiI2MDNkN2E0MWYzMTYwMDQwOTg1MTg1IjtzOjQ6ImxlYWQiO3M6NjoiMjU0NDgzIjtzOjc6ImNoYW5uZWwiO2E6MTp7czo1OiJlbWFpbCI7aTozNjt9fQ%3D%3D&

After decoding the Base64 it will look like this, which is data that can only be read by the platform doing the redirection to the real URL of the story.

laplca.patronpoint.com/r/4c62d0c9606cfbeac86459d8e?ct=a:5: {s: 6: “source”; a: 2: {i: 0; s: 5: “email”; i: 1; i: 36; } s: 5: “email”; i: 36; s: 4: “stat”; s: 22: “603d7a41f3160040985185”; s: 4: “lead”; s: 6: “254483”; s: 7: “channel”; a: 1: {s: 5: “email”; i: 36;}}

The URL of the real story I tried to find looks like this:

lapl.org/womens-history

However, if you use the alternate regular expression above, everything after the? Mark. In this case, all Base64 has been deleted tracking information and is not needed; the link to the article itself is the random group of letters and numbers that came before it. So this basically creates a cleaner link, but you won’t get the real URL. Still, it is better than nothing.

laplca.patronpoint.com/r/4c62d0c9606cfbeac86459d8e

Clean URL cannot work magic, but it can remove most tracking codes when the original URL is actually in the URL you are trying to clean.

Keep your connection safe without a monthly billGet a lifetime subscription to VPN Unlimited for all your devices with a one-time purchase from the new Gadget Hacks Shop, and watch Hulu or Netflix with no regional restrictions, increase security when browsing public networks and more.

Buy now (80% discount)>

Other worthwhile deals to check out:

Cover photo and screenshots by Nelson Aguilar / Gadget Hacks

Source link