Forem Creators and Builders 🌱

Cover image for Changelog: Analytics for All!
Vaidehi Joshi for Forem Core Team

Posted on

Changelog: Analytics for All!

We’re happy to share that all Forem users now have access to the Analytics Dashboard!

Screenshot of an example Analytics Dashboard

This is a feature that has been around for some time, but has always been limited to a specific subset of our users with a specific role. But as of today, it is available to everyone!

Accessing the Analytics Dashboard

To access your Analytics Dashboard, head over to your Dashboard and click on the Analytics tab on the sidebar.

Screenshot of the Analytics in sidebar of dashboard

Within your Analytics Dashboard, you’ll be able to view some in-depth user metrics, including some high level data around comments, reactions, readership, and new followers. You can also filter this data by week, month, or all time.

Screenshot of the Analytics Dashboard

You’ll also be able to look at specific statistics for individual posts. On every post that you author, you’ll see a Stats button.

Screenshot of a post with the Stats button

That button will take you to a post-specific Analytics Dashboard, where you can view statistics for an individual post.

Screenshot of a post-specific Analytics Dashboard

Analytics for Organizations

If you are a member of an organization, you’ll be able to view analytics around any posts you author for that organization. You can access organization-specific statistics from any post published under that organization.

If you are an organization administrator, you'll be able to view the organization's Analytics Dashboard directly below your personal Analytics Dashboard.

Screenshot of an organization Analytics Dashboard

We hope that making this feature available to everyone will help members of Forem communities better understand their own content and gain deeper insights into how they are interacting with the community.

For the curious ones out there, you can check out the relevant pull request for this feature below:

Remove pro role + expose analytics to all users via dashboard #13156

What type of PR is this? (check all applicable)

  • [x] Refactor
  • [x] Feature
  • [ ] Bug Fix
  • [ ] Optimization
  • [x] Documentation Update

Description

Related Tickets & Documents

Closes https://github.com/forem/internalEngineering/issues/403.

QA Instructions, Screenshots, Recordings

To QA this feature, first make sure that you have a user locally who does not have the :pro role:

pry(main)> u = User.find_by(username: 'your-username-goes-here')
=> #<User id: ...>
]pry(main)> u.has_role? :pro
=> false
Enter fullscreen mode Exit fullscreen mode

QA Instructions, Part I:

  1. Try going to /dashboard. On the bottom left of the sidebar, you should see an Analytics option in the menu. Click on that:

Screen_Shot_2021-03-28_at_4_00_05_PM

  1. Clicking on that should take you to your "Analytics Dashboard", which previously was the "Pro dashboard". Make sure there is no "pro" language (everything should read "analytics dashboard):

Screen Shot 2021-03-28 at 4 00 24 PM

3. Now, go to any article you have published (if you haven't published any, create a quick test post).

Screen_Shot_2021-03-28_at_4_00_50_PM

4. You should see a dashboard to manage your post. Notably, you should see a `Stats` button (which used to only be rendered for "pro" users). Click on that button:

Screen_Shot_2021-03-28_at_4_01_13_PM

5. You'll now be able to see the stats for your article on a `/stats` route, which should render analytics that are _specific_ to the article you were just looking at:

Screen Shot 2021-03-28 at 4 01 24 PM

QA Instructions, Part II:

  1. Create an organization (here's the route to do so).
  2. Go back to your /dashboard. Note that the Analytics option still renders as before, only now you also should see an Analytics [Your Org Name option as well (click on that one!):

Screen_Shot_2021-03-28_at_4_04_42_PM

3. Now, you should see the analytics dashboard for _your_ specific organization:

Screen Shot 2021-03-28 at 4 31 19 PM

4. Write a post under your organization and go to that post, and click `Manage` to go to the dashboard for your newly-published article, which was published under your specific organization (the route should look something like `/llamafans/this-post-is-for-llama-fans-only-43fl/manage`. You should see the organization name render in the top left corner, and you should see a `Stats` button as well. Click on the `Stats` button:

Screen_Shot_2021-03-28_at_4_04_53_PM

5. You should be taken to an article-specific analytics dashboard for the organization you are a part of!

Screen Shot 2021-03-28 at 4 05 02 PM

QA Instructions, Part III:

  1. Assign your user either an :admin or :super_admin role, and go to /admin/users. Select a user to edit, and scroll down to the "User Status" section of the page. Click the dropdown, and ensure that the Pro role does not show up there:

Screen Shot 2021-03-28 at 3 58 48 PM

2. Feel free to check for anywhere else on the site or in the codebase where the notion of a `Pro` role still exists (hopefully I got all of them, but please let me know if I missed anything! 😃)

UI accessibility concerns?

No HTML or UX changes happens as a part of this PR, so I don't think so.

Added tests?

  • [ ] Yes
  • [x] No, and this is why: I've updated pre-existing tests and added new ones where necessary (but didn't overhaul the testing significantly enough IMO to check the "Yes" box 😉)
  • [ ] I need help with writing tests

[Forem core team only] How will this change be communicated?

Will this PR introduce a change that impacts Forem members or creators, the development process, or any of our internal teams? If so, please note how you will share this change with the people who need to know about it.

  • [ ] I've updated the Developer Docs and/or Admin Guide, or Storybook (for Crayons components)
  • [ ] I've updated the README or added inline documentation
  • [x] I will share this change in a Changelog or in a forem.dev post (I will work with @cmgorton to make sure this is highlighted/announced to the community since we are sharing a feature that was previously only available to handful of folks!)
  • [x] I will share this change internally with the appropriate teams
  • [ ] I'm not sure how best to communicate this change and need help
  • [ ] This change does not need to be communicated, and this is why not: please replace this line with details on why this change doesn't need to be shared

Are there any post deployment tasks we need to perform?

After this feature is out, we will need to delete any Pro roles from the database. Even with the "pro" code all removed, the role still exists in the database, as evidenced by this screenshot of my local Forem instance, once I added the :pro role to my own user and deleted the "pro" code (seems like the Role instance still exists in the database): Screen Shot 2021-03-28 at 3 59 01 PM

I think that this only applies to the DEV community, but I'm not entirely sure about that and could use some gut checks there. My thought was to either write a DataUpdateScript (if this applies to many communities), otherwise maybe we can delete the :pro role directly via a DEV console?

A script would definitely be more comprehensive, but if no other Forem instance has pro roles, that feels much more heavyweight than we need it to be.

What gif best describes this PR or how it makes you feel?

animation of woman cutting bangs off with scissors

We hope you’ll take a peek at this feature and give it a spin! As always, we’d love to know what you think of it and how might improve on it to make it even more useful. 😃

Top comments (8)

Collapse
 
link2twenty profile image
Andrew Bone • Edited

Awesome feature 😁

I've come across a really interesting bug

gif of error

If you click through the three tabs then mouse over a chart it may (I couldn't work out what the actual trigger was) change to a chart from another tab.

Seems my gif won't embed so here's a link to it. Link to gif

Collapse
 
vaidehijoshi profile image
Vaidehi Joshi

Hi @link2twenty ! Would you mind opening up a bug report to document this? I'd love to get someone on our team to investigate this, and having it in an issue format will ensure that we can get this prioritized and worked on :)

Thanks so much for playing with it and taking a look! I'll try to get your bug report prioritized as soon as possible once we have it in issue format 🙏

Collapse
 
link2twenty profile image
Andrew Bone

I've added the issue, thanks ☺️

[Bug] Analytics graphs changing randomly #13222

Describe the bug The graphs in the new analytics tab seem to change randomly.

To Reproduce

Expected behaviour Only the chart for the current period should be seen

Screenshots gif of error

Desktop (please complete the following information):

  • OS, version: Windows 10
  • Browser, version: Chrome 89

Smartphone (please complete the following information): N/A

Additional context It's such a random bug it must be how chartjs is storing the graphs or something.

Thread Thread
 
vaidehijoshi profile image
Vaidehi Joshi

Thanks so much for creating an issue, @link2twenty ! I am going to advocate for our engineering team to prioritize this so that we can begin to investigate starting next week :)

Collapse
 
thomasbnt profile image
Thomas Bnt

Finallyyyyyyyy :D

Collapse
 
lee profile image
Lee

Brilliant !

Collapse
 
michaeltharrington profile image
Michael Tharrington

So dope! I'm so siked this is open to all now. 😎

Collapse
 
kvaibhav01 profile image
Vaibhav Khulbe

Wow, love it!! 😍