offspot / imager-service

Create Kiwix Hotspot microSD cards online
https://imager.kiwix.org/
GNU General Public License v3.0
11 stars 6 forks source link

Track number of downloads for free cardshop image #229

Open Popolechien opened 3 years ago

Popolechien commented 3 years ago

Just to have an idea of our impact, it would be useful to track how many people download the free 16Gb RPi image from the cardshop sales page.

rgaudin commented 3 years ago

Haven't we already had this discussion?

We could record the number of requests to https://api.cardshop.hotspot.kiwix.org/auto-images/demo/redirect/http and https://api.cardshop.hotspot.kiwix.org/auto-images/demo/redirect/torrent but I don't see the value:

@kelson42 what do you think? Is it valuable enough to record? Should it be viewable from the UI or should we just keep it in DB to look at it from time to time?

kelson42 commented 3 years ago

I think the request of @Popolechien is legitim and might be implemented. I would prefer that it goes through a HTML redireciton page (itself calling matomo).

rgaudin commented 3 years ago

OK ; you didn't answer the UI question.

I think the html redirect is poor UX but I understand the why.

If you're only interested in the number of downloads, a possibility is to trigger a matomo request from the backend code.

kelson42 commented 3 years ago

I think the html redirect is poor UX but I understand the why.

I agree, it is just the best compromise beetween multiple constraints I have in mind.

If we do so in Cardshop level, this will probably be needed in other use cases.

* What would be displayed on that page (that page will stay up after redirect as the content-type would trigger a download)

A simple message telling that a redirect will happen in 3 seconds.

* How long before the redirection? Matomo script is asyn

3 seconds should be enough.

kelson42 commented 3 years ago

@rgaudin An other solution is that the the python makes the matomo API call. That ways we could do with a "transparent HTTP redirection.

rgaudin commented 3 years ago

@rgaudin An other solution is that the the python makes the matomo API call. That ways we could do with a "transparent HTTP redirection.

That's exactly what I suggested… but in this case we loose the screen resolution and other metadata.

kelson42 commented 3 years ago

in this case we loose the screen resolution and other metadata.

This does not really matter here.