Skip to content

Simple impression counter? #11229

Open
Open

Description

@0wwafa

📋 Description

A badge with just the number of times the badge has been displayed by unique users would be nice.
I searched the website but perhaps I am blind and I did not find it.

🔗 Data

just an impression counter.

🎤 Motivation

Lack thereof.

Activity

  1. jNullj commented on Jul 26, 2025

    @jNullj
    Member

    While an interesting idea, I'm not sure it best aligns with project goals.
    As stated in our contribution guideline badges should present information useful to developers from a documented API.

    While some developers might be interested in such counters, there are a few problems here:

    1. Information is not directly related to developers work.
    2. Shields depends on an API to provide said info.
    3. Shields is not built to hold information over time, like the number of requests of an image.

    Could you provide info regarding benefits of the badge and API source that it might use?

  2. 0wwafa commented on Jul 27, 2025

    @0wwafa
    Author

    Could you provide info regarding benefits of the badge and API source that it might use?

    Benefits: let's assume I have a badge that tells me how many downloads I had.
    It would be useful to know how many people visited the "repository main page" (where the readme is displayed.
    To have a comparison.
    About the data source, github should have an api for that..

    Source: https://github.com/[USER]/[REPO]/graphs/traffic?partial=top_lists

    https://github.com/badges/shields/graphs/traffic?partial=top_lists

    or:

    https://docs.github.com/en/rest/orgs/api-insights?apiVersion=2022-11-28#get-summary-stats

  3. jNullj commented on Jul 27, 2025

    @jNullj
    Member

    Thank you for the data sources, but there are some limitations here that might render them not suitable for this use case.

    Let me start by saying api-insights is not relevant here, as it tracks api usage and not user page views.

    regarding the traffic endpoint:

    • This view (and API) shows repository page views and unique visitors, as well as referrers and popular content.
    • These metrics reflect how many times the GitHub repo itself was visited in a browser, potentially including times when a badge in the README was visible.
    • Limitation: It does not count badge impressions outside the GitHub repository (e.g., when badges are embedded on blogs or other sites). It also only covers the last 14 days and requires repo admin permissions to access.

    So in short:

    • api-insights is not relevant here
    • traffic endpoint requires permissions and is very limited in what it provides.
  4. heliocarlitos commented on Feb 15, 2026

    @heliocarlitos
  5. PyvesB commented on Jun 20, 2026

    @PyvesB
    Member

    @heliocarlitos feel free to add a reference to your project on https://github.com/badges/awesome-badges :)

  6. heliocarlitos commented on Jun 21, 2026

    @heliocarlitos

    @PyvesB
    Great. Liked it! I'm going to take a closer look to see how to add these tools to the project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    service-badgeNew or updated service badge

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions