🚀 Announcements: Tracking or stats of announcements
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?
- [X] I have read the Code of Conduct
Are you willing to submit PR?
No, I don't have time to work on this right now
cc @kurtaking
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.
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.
Hello. Any feedback if this can be done? Unfortunately I cannot contribute this myself at this time
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
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.
Hi @kurtaking Can this be closed as I see the BEP was merged, but the proposed service is still open?
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/
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.
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.
Some analytics has been added in this PR #5970. I'm already using it on my end:
But still, providing a dashboard view directly in Announcements would improve the UX
Closing this issue for now that #5970 has landed