Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Outbound link tracking breaks special links with # #21702

Open
1 task done
Zeit08 opened this issue Nov 23, 2024 · 6 comments
Open
1 task done

Outbound link tracking breaks special links with # #21702

Zeit08 opened this issue Nov 23, 2024 · 6 comments
Labels

Comments

@Zeit08
Copy link
Contributor

Zeit08 commented Nov 23, 2024

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

  • I agree to be friendly and polite to people in this repository
@github-actions github-actions bot added the needs:triage [triage] this needs to be triaged by the Ghost team label Nov 23, 2024
@vikaspotluri123
Copy link
Member

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
Copy link
Contributor Author

Zeit08 commented Nov 25, 2024

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
Copy link
Member

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

@Zeit08
Copy link
Contributor Author

Zeit08 commented Nov 26, 2024

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
Copy link
Member

Thanks for sharing the full links.

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

  • With Signal Desktop (click link in browser to open Signal Desktop), neither link works.
  • With Simplex Desktop, I get a QR code that points to the URL. This looks fine.
  • With Signal Mobile, both links work if I paste them into Safari and click the button to open the Signal app.
  • With Signal Mobile, if I open the link from an app (i.e. not through the browser), the unref'd link does not work, but the ref'd link does.
  • I don't use Simplex so I'm not planning on installing the app to test.

@mike182uk
Copy link
Member

I believe Ghost is doing the correct thing here (by appending ref to the searchParams here), but it is obviously not aware of the different routing schemes that apps may use the fragment for. In the case of the simplex.chat link, the fragment contains a query string, but this is considered part of the fragment and not the query (which would usually appear before the fragment as per RFC 3986 - scheme:[//authority]path[?query][#fragment]).

Im not sure if we could robustly handle this - We could put logic in to check if there is a fragment and either not append the ref, or append the ref to a querystring embedded in the fragment, but this would break functionality for users that do want the original behaviour because they are not using the fragment for any type of routing

@mike182uk mike182uk added P4 - Low and removed needs:triage [triage] this needs to be triaged by the Ghost team labels Dec 10, 2024
@ErisDS ErisDS closed this as not planned Won't fix, can't repro, duplicate, stale Dec 11, 2024
@ErisDS ErisDS added the 🧊 Icebox label Dec 11, 2024 — with Linear
@ErisDS ErisDS reopened this Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants