TryGhost / Ghost

Independent technology for modern publishing, memberships, subscriptions and newsletters.
https://ghost.org
MIT License
47.63k stars 10.39k forks source link

Outbound link tracking breaks special links with # #21702

Open Zeit08 opened 4 days ago

Zeit08 commented 4 days ago

Issue Summary

Same as the the closed issue 20492

I have a few links that directly open a chat with me on Signal and SimpleX apps. Ghost puts ?ref=mydomain.com there, breaking the functionality.

Example of correct link, as seen in the Editor page: Screenshot From 2024-11-23 16-22-41

The same link in the published page (notice the ref somewhere at the beginning): Screenshot From 2024-11-23 16-23-07-obfuscated

Simple solution: disable outbound links tracking in specified single pages (a toggle on the right sidebar) Complete solution: find a way to recognize this special links with #

Steps to Reproduce

  1. Enable Outbound link analytics
  2. use Simplex, Signal or other special links with #

Ghost Version

5.101.1

Node.js Version

not sure

How did you install Ghost?

PikaPods

Database type

MySQL 5.7

Browser & OS version

Firefox on Fedora 41

Relevant log / error output

No response

Code of Conduct

vikaspotluri123 commented 4 days ago

Assuming the ref is still added, what URL are you expecting? The behavior seems correct:

var demo = new URL('https://example.com')
demo.searchParams.set('query', 'ghost')
demo.hash = '/?key=value'
demo.toString()
// 'https://example.com/?query=ghost#/?key=value'
new URL('https://example.com/?query=ghost#/?key=value').hash
// '#/?key=value'
Zeit08 commented 3 days ago

I am expecting that these special links are being ignored by the ref mechanism, otherwise they simply do not work. I am unsure it is possible to implement a ref mechanism to these kind of links.

vikaspotluri123 commented 2 days ago

Can you clarify what doesn't work, and where? From my example, it looks like it's behaving correctly.

Zeit08 commented 2 days ago

As stated in my first post, Signal and Simplex contact links do not work if the outbound link tagging is active. To check by yourself you would have to use Signal or Simplex app and see that these links work:

https://signal.me/#eu/m5jaUkG5pJ9MkzGKKV60KKzUClgIVvL27dO5g_MDiHN9-Uj5N-lO8JwScTG1x2CF

https://simplex.chat/contact#/?v=2-7&smp=smp%3A%2F%2FPtsqghzQKU83kYTlQ1VKg996dW4Cw4x_bvpKmiv8uns%3D%40smp18.simplex.im%2FP1j29POWtqdyCAgzR2hvtMfyUSYofcrc%23%2F%3Fv%3D1-3%26dh%3DMCowBQYDK2VuAyEAq83FFekNLYC1DnPmOyytP_QRj_vw_tOY8ZH2ZUfdmlU%253D%26srv%3Dlyqpnwbs2zqfr45jqkncwpywpbtq7jrhxnib5qddtr6npjyezuwd3nqd.onion

Whereas these one do not:

https://signal.me/?ref=digidati.art#eu/m5jaUkG5pJ9MkzGKKV60KKzUClgIVvL27dO5g_MDiHN9-Uj5N-lO8JwScTG1x2CF

https://simplex.chat/contact?ref=digidati.art#/?v=2-7&smp=smp%3A%2F%2FPtsqghzQKU83kYTlQ1VKg996dW4Cw4x_bvpKmiv8uns%3D%40smp18.simplex.im%2FP1j29POWtqdyCAgzR2hvtMfyUSYofcrc%23%2F%3Fv%3D1-3%26dh%3DMCowBQYDK2VuAyEAq83FFekNLYC1DnPmOyytP_QRj_vw_tOY8ZH2ZUfdmlU%253D%26srv%3Dlyqpnwbs2zqfr45jqkncwpywpbtq7jrhxnib5qddtr6npjyezuwd3nqd.onion

They are being opened anyway (so this is not a 404) but they do not work on Signal nor Simplex app, meaning they do not open a chat with the designated contact (me in this case).

vikaspotluri123 commented 1 day ago

Thanks for sharing the full links.

This looks to be an issue for URLs that directly open to an app.