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

Add an aggregate stats to the plugin manager's view #39

Closed
akbargumbira opened this issue Sep 2, 2016 · 5 comments
Closed

Add an aggregate stats to the plugin manager's view #39

akbargumbira opened this issue Sep 2, 2016 · 5 comments
Assignees
Labels
🕔 Size 8 This is a full day job

Comments

@akbargumbira
Copy link
Contributor

This issue has been migrated from the old QGIS issue tracker.

Author

Matteo Gismondi

Description

Add an aggregate stats to the plugin manager's view that shows number of downloads per country per month. For companies like mine to have such tool is indispensable to understand which country to target for marketing and business development.
Therefore this feature would be greately appreciated.
Thank you
Regards,
Matteo

Comments

Akbar Gumbira (@akbargumbira)

If I look at the database, there is no fields to correlate between the plugin, and the number of download per country. This is good though, we can show a heatmap of the number of downloads for all countries.

@timlinux
Copy link
Member

@Xpirix let's start by you describing a design / approach here first before you start coding. Once we have reviewed, you can code it oK?

@Xpirix
Copy link
Collaborator

Xpirix commented Nov 16, 2023

@timlinux , Please find below a description of the design/approach for this ticket.

  1. Create a PluginDownloadByCountry Model:

    • Define a Django model named PluginDownloadByCountry with the following fields: plugin_id, country_code, country_name, city, coordinates, downloaded_at.
  2. Implement GeoIP2 Integration:

    • Integrate GeoIP2 into the application.
  3. Handle Download Requests:

    • When a download request is received:
      • Retrieve the country of the request from the IP address.
      • Instantiate a PluginDownloadByCountry instance with relevant details.
  4. Create GeoJSON Template:

    • Integrate a GeoJSON template that includes information about all countries (boundary, code, name).
  5. Aggregate Stats in Plugin Manager's View:

    • Create a new Django view that accepts parameters for month and year. If not set, use the current month, year.
    • Filter PluginDownloadByCountry based on the provided parameters and the current plugin.
    • Execute a query to group entries by country_code and include a download_count field.
    • Use the GeoJSON template to generate a GeoJSON with the download_count field.
  6. Enhance Plugin Page with Stats Tab:

    • Add a new tab named Stats to the plugin page.
    • Display a graduated map using the download_count from the GeoJSON.
    • Include a list of the top 10 countries based on download_count.
    • Enable hovering over the map to display the download count for each country.
  7. Add Form for Specific Month and Year:

    • On the Stats tab, include a form with fields for month and year to query statistics for a specific period.

According to these, I think this ticket should be split into smaller tickets.

Image

@timlinux
Copy link
Member

timlinux commented Dec 7, 2023

city, coordinates should not be stored to protect user privacy

Table could be more simply:

DownloadEvent

date / country / plugin version id

The rest can then be worked out by table joins and using metabase to assemble the stats

@Xpirix Xpirix added the 🕔 Size 8 This is a full day job label Dec 14, 2023
@Xpirix Xpirix moved this from To Be Estimated to Review in progress in QGIS Websites Maitenance Dec 14, 2023
@Xpirix Xpirix moved this from Review in progress to In Progress in QGIS Websites Maitenance Dec 14, 2023
@Xpirix
Copy link
Collaborator

Xpirix commented Dec 15, 2023

Thank you @timlinux . Using Metabase makes it much easier. Please find the proposed PR at #331

@Xpirix Xpirix moved this from In Progress to Review in progress in QGIS Websites Maitenance Dec 15, 2023
@Xpirix Xpirix moved this from Review in progress to This sprint in QGIS Websites Maitenance May 21, 2024
@Xpirix Xpirix moved this from This sprint to Review in progress in QGIS Websites Maitenance May 22, 2024
@Xpirix Xpirix moved this from Review in progress to Review approved in QGIS Websites Maitenance May 24, 2024
@Xpirix
Copy link
Collaborator

Xpirix commented May 31, 2024

This feature has been implemented.

@Xpirix Xpirix closed this as completed May 31, 2024
@github-project-automation github-project-automation bot moved this from Review approved to Done in QGIS Websites Maitenance May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🕔 Size 8 This is a full day job
Projects
Development

No branches or pull requests

3 participants