community-plugins icon indicating copy to clipboard operation
community-plugins copied to clipboard

🚀 Announcements: Tracking or stats of announcements

Open skeletonz28 opened this issue 1 year ago • 4 comments

Plugin Name

announcements

🔖 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

Originally posted here: https://github.com/procore-oss/backstage-plugin-announcements/issues/418 (has a possible solution commented as well)

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?

  • [X] I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

Are you willing to submit PR?

No, I don't have time to work on this right now

skeletonz28 avatar Dec 30 '24 09:12 skeletonz28

cc @kurtaking

vinzscam avatar Jan 14 '25 16:01 vinzscam

possible backend implementation

Could we...

Add a new announcements_views table where we keep track of the announcement_id, user_id, and timestamp of when the view occurred?

knex.schema.createTable('announcement_views', table => {
  table.string('announcement_id').notNullable();
  table.string('user_id').notNullable();
  table.timestamp('viewed_at').notNullable();
    
  table.foreign('announcement_id').references('announcements.id').onDelete('CASCADE');
  table.unique(['announcement_id', 'user_id']);
  table.index(['announcement_id']);
})

Add a new recordView function to the AnnouncementsStore

await this.db(viewsTable).insert({
  announcement_id: announcementId,
  user_id: userId,
  viewed_at: DateTime.now().toSQL(),
});

Add a new post route -> /announcements/:id/views

const announcement = await persistenceContext.announcementsStore.announcementByID(
  req.params.id,
);
 
if (!announcement) {
  return res.status(404).end();
}

await persistenceContext.announcementsStore.recordView(req.params.id, userId); 

Then some effect that runs a hook on the frontend to hit the route.

kurtaking avatar Jan 15 '25 05:01 kurtaking

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Mar 24 '25 00:03 github-actions[bot]

Hello. Any feedback if this can be done? Unfortunately I cannot contribute this myself at this time

skeletonz28 avatar Mar 26 '25 11:03 skeletonz28

I strongly believe Backstage should first provide a telemetry service we could leverage to add tracking (tracing) or stats (metrics).

I have create https://github.com/backstage/backstage/issues/30328 to consolidate all conversation on this topic and would only be interested in working on this PR once the core framework provides support like this

kurtaking avatar Jun 24 '25 15:06 kurtaking

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Aug 23 '25 18:08 github-actions[bot]

Hi @kurtaking Can this be closed as I see the BEP was merged, but the proposed service is still open?

skeletonz28 avatar Aug 25 '25 06:08 skeletonz28

Hi @skeletonz28 as author of this issue and hi @kurtaking @gaelgoth as announcements maintainers,

isn't the Backstage Analytics API the right solution for this? At at least its an additional option...

https://backstage.io/docs/plugins/analytics/ https://backstage.io/blog/2022/09/08/fyi-plugin-analytics-api/

christoph-jerolimov avatar Aug 26 '25 14:08 christoph-jerolimov

Hi @skeletonz28 as author of this issue and hi @kurtaking @gaelgoth as announcements maintainers,

isn't the Backstage Analytics API the right solution for this? At at least its an additional option...

https://backstage.io/docs/plugins/analytics/ https://backstage.io/blog/2022/09/08/fyi-plugin-analytics-api/

Hey @christoph-jerolimov absolutely, that is definitely an option and something we likely should do.

kurtaking avatar Aug 28 '25 02:08 kurtaking

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Oct 27 '25 06:10 github-actions[bot]

Some analytics has been added in this PR #5970. I'm already using it on my end:

Image

But still, providing a dashboard view directly in Announcements would improve the UX

gaelgoth avatar Nov 21 '25 09:11 gaelgoth

Closing this issue for now that #5970 has landed

vinzscam avatar Dec 02 '25 22:12 vinzscam