Study of the link tracking methods and the protection
Scenario
- Visitor clicks a link to the “destination URL”
- The browser connects to the “tracking URL”
- The browser redirects to the destination “destination URL”
In demo, I use “http://www.example.com/” for the destination URL and “https://bit.ly/1h0ceQI” for tracking URL, where “https://bit.ly/1h0ceQI” redirects to “http://www.example.com/”.
Classical method
The link with tracking url:
Demo:
- pros
- Static, javascript no use.
- cons
- Mouse overing displays the tracking url, not destination url.
Protection technique to this tracking method:
- Replace the tracking link
href
with the destination link.
Classical method with status bar replacement
The link with tracking url:
Demo:
- pros
- The destination link is displayed on the status bar.
- cons
- The
window.status
is no longer used today!
- The
Protection technique to this tracking method:
- Replace the tracking link
href
with the destination link.
Google-search method
The link with tracking url:
Demo:
- pros
- The tracking url is intentionally hidden since the destination link is displayed on the status bar.
- cons
- Once the user click the link, the tracking link is displayed on the status bar.
- The tracking is disabled when the user disables javascript.
Protection technique to this tracking method:
-
Disable the event handler
-
Discard
href
attribute change -
… or disable javascript.
Replace-location-on-click method
The link with tracking url:
Demo:
- pros
- The tracking url is intentionally hidden since the destination link is displayed on the status bar.
- cons
- The tracking is disabled when the user disables javascript.
Protection technique to this tracking method:
-
Disable the event handler
-
Discard
location
field modification usingObject.watch()
-
… or disable javascript.
Google-Analytics method
The link with tracking url:
Demo:
- pros
- The tracking url is intentionally hidden since the destination link is displayed on the status bar.
- No redirection.
- cons
- The tracking is disabled when the user disables javascript.
Protection technique to this tracking method:
-
Disable the event handler
-
… or disable javascript.
HTML ping attribute (Note)
The link with tracking url:
Demo:
- pros
- The tracking url is hidden.
- No redirection.
- Static, javascript no use.
- cons
- Almost all browser disable this ping feature.
Protection technique to this tracking method:
- Remove ping attribute
- Disable ping feature
References
- Google search result pages
- Google Analytics
- “Track outbound links with Google Universal Analytics.js”, Axllent.org, 27 Feb 2015.
- “MutationObserver - Web API Interfaces”, MDN.
- “Object.prototype.watch() - JavaScript”, MDN.
- Google Search Link Fix for Mobile and Desktop :: Add-ons for Firefox – Output of this study.