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

Track visits to 'base_url', 'invalid_short_url' and 'regular_404' (orphan visits) #675

Closed
9 tasks done
the-hotmann opened this issue Mar 3, 2020 · 4 comments · Fixed by #1017
Closed
9 tasks done
Labels
Milestone

Comments

@the-hotmann
Copy link

the-hotmann commented Mar 3, 2020

I configured Shlink this way:

hostname: l.domain.tld
base_url: www.domain.tld (website)

So my Links look like this:
https://l.domain.tld/GPSI (for example)

If someone want to try to access the application (Shlink) directly he may want to call https://l.domain.tld but gets redirected by Shlink to the base_url.
This redirect does not get tracked by default as it does not exist in the DB.

I would love to see this redirect (if enabled) beeing added to Shlink by default. But not like the other Links. So you can not edit/delete it but analyse and track it.

I know its a bit strange request but would love to see how many people try to "bypass" Shlink this way, or how many are getting redirected by this setting.

Same would be cool for 404 errors as they get redirected to www.domain.tld/404.
Would be cool if they also would be tracked. Also what the "not existing" request was.

If I call https://l.domain.tld/not-existing-thing then this should be added to the 404 redirects but should contain the url so we know what was called but did not exist.


  • Create architectural decision record.
  • Update visits table to allow null short_url_id and save visited_url and type.
  • Track orphan visits.
  • Add amount of orphan visits to GET /visits endpoint.
  • Create new GET /visits/orphan endpoint for orphan visits. It should behave the same as the one for short URL visits or tag visits, supporting pagination, filtering etc.
  • Add location resolution via events as for short URL visits.
  • Ensure IP address is properly resolved for base_url and regular_404 visits.
  • Allow disabling orphan visits tracking via config (Add option to disable orphan visits tracking shlink-installer#103).
  • Add new mercure topic to publish orphan visits (https://shlink.io/new-orphan-visit).
@acelaya
Copy link
Member

acelaya commented Mar 3, 2020

This is something nice to have (in fact it was part of the things I had in mind when implementing the special redirects feature).

However there are many other things which have to be implemented first, so I cannot guarantee to have this done soon.

@acelaya acelaya added this to the 2.6.0 milestone Nov 27, 2020
@acelaya
Copy link
Member

acelaya commented Nov 27, 2020

Both visits to the base URL and to non-existing short URLs will be tracked.

@acelaya acelaya changed the title Also track the redirect from 'hostname' to 'base_url' and also to '404' Track visits to 'base_url', 'invalid_short_url' and 'regular_404' Feb 7, 2021
@acelaya acelaya changed the title Track visits to 'base_url', 'invalid_short_url' and 'regular_404' Track visits to 'base_url', 'invalid_short_url' and 'regular_404' (orphan visits) Feb 9, 2021
@acelaya
Copy link
Member

acelaya commented Feb 11, 2021

@MartinHotmann I have just merged the implementation for this, and it will be part of Shlink 2.6.0

Shlink will start tracking "orphan visits", meaning, visits to the base URL, invalid short URLs or any other kind of not found error. It will do it both if you configured a redirect for any of thos 3 cases or not.

You will be able to opt-out via config, if you want, but it will be enabled by default.

After v2.6.0 is released, I will start working on shlink-web-client 3.1.0, which will add support to see orphan visits.

It took almost a year to get this implemented, but the result is going to worth it 🙂

@acelaya
Copy link
Member

acelaya commented Feb 11, 2021

I already published some docs https://shlink.io/documentation/tracking-visits/#orphan-visits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants