Skip to content
This repository has been archived by the owner on Dec 27, 2024. It is now read-only.

🚀 Feature: Tracking or stats of announcements #418

Closed
1 task done
skeletonz28 opened this issue Sep 4, 2024 · 2 comments
Closed
1 task done

🚀 Feature: Tracking or stats of announcements #418

skeletonz28 opened this issue Sep 4, 2024 · 2 comments
Labels
enhancement New feature or request help wanted Anyone is welcome to open a pull request to fix this issue

Comments

@skeletonz28
Copy link

🔖 Feature description

Possibility of being able to view how many times the announcement was viewed
If possible, able to see a percentage of active users who haven't/have read the announcement, as it is easy to click the X to close the banner vs clicking on the announcement to view the details

🎤 Context

We have started using this feature to broadcast when we have released updates and when we will be in maintenance mode. We would like to see if the news is being viewed as we now have a way of stating to the user that we have communicated this on the platform alongside our other forms of communications
Good stat to keep track of how valuable the data is being presented to the user. Able to point out how news is received within the deployed environment
Able to keep track of how often announcements are read, leading to users being kept aware of changes/releases within the environment

✌️ Possible Implementation

If using a database, maybe adding a view count table or column for each announcement.
If able to, similar to how Backstage Insights keeps track of how often a template was run, could use a similar method to keep track
Unsure if this would result in duplicate views if 1 users repeatedly views 1 announcement

👀 Have you spent some time to check if this feature request has been raised before?

  • I checked and didn't find similar issue

Are you willing to submit PR?

None

@skeletonz28 skeletonz28 added the enhancement New feature or request label Sep 4, 2024
@kurtaking
Copy link
Contributor

If using a database, maybe adding a view count table or column for each announcement.

We'd probably be fine with adding a new view_count column.

async incrementViewCount(id: string): Promise<void> {
  await this.db('announcements')
    .where('id', id)
    .increment('view_count', 1);
}

Unsure if this would result in duplicate views if 1 users repeatedly views 1 announcement

One option would be to introduce a new table that stores the announcementId and reference to the user (think we would want that to be userEntityRef).

async incrementUniqueViewCount(announcementId: string, userEntityRef: string): Promise<void> {
  const exists = await this.db('announcement_views')
    .where({ announcement_id: announcementId, user_ref: userEntityRef })
    .first();
  
  if (!exists) {
    await this.db('announcement_views').insert({ announcement_id: announcementId, user_ref: userEntityRef });
  }

  await this.incrementViewCount(announcementId);
}

Let me know if you are interested in contributing this feature.

@kurtaking kurtaking added the help wanted Anyone is welcome to open a pull request to fix this issue label Oct 2, 2024
@kurtaking
Copy link
Contributor

The announcement plugins have been migrated to backstage/community-plugins repo. Please recreate an issue there if there is value in doing so.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request help wanted Anyone is welcome to open a pull request to fix this issue
Projects
None yet
Development

No branches or pull requests

2 participants