Forem Creators and Builders 🌱

Balkrishna Pandey
Balkrishna Pandey

Posted on • Updated on

What is handling stats on self-hosted forem?

From my homelab, I'm operating a self-hosted forem. I'm having an issue where the stats section never changes, its always 0. Because Google Analytics shows traffic, the stat should also reflect the number.
Forem Stats
Image description

Google analytics stats
Image description

Any kind of pointer would be appreciated.Β 

Top comments (10)

Collapse
 
ellativity profile image
Ella (she/her/elle)

Hey @pandeybk πŸ‘‹ Thanks for your question!

Is the GA data you're sharing specifically for the page "goglides.dev/bkpandey/why-we-choos..."?

I ask because that's the post that those post stats are for, so if the GA data isn't for the specific page then it's going to be hard to compare the datasets.

Collapse
 
pandeybk profile image
Balkrishna Pandey • Edited

This is what I am seeing write now in google analytics. Forem shows

forem.dev/remoteimages/uploads/art...

"Readers this Week: 2".
So how we count readers?
forem.dev/remoteimages/uploads/art...

Collapse
 
ellativity profile image
Ella (she/her/elle)

This could be a caching issue on Forem, or a discrepency in Forem/GA logic. e.g. your Forem is public but doesn't count anonymous page views (not logged-in members), and if GA does (I'm not 100% sure this is the case!), then you're going to see more hits from GA.

The cool thing from a community manager's perspective is, if you're recording member engagement, you can use these separate datasets to compare and contrast the difference between member and non-member views.

Additionally, without knowing exactly how GA is logging requests/views, it may be logging a single view multiple times. Forem's frontend updates the database every 15 seconds you're reading a post, to collect data on how long people are spending on each post. If GA is counting every request from frontend to backend, then it could be counting a new pageview every 15 seconds, even if Forem is only counting that as a single page view.

Thread Thread
 
pandeybk profile image
Balkrishna Pandey

I believe you've addressed my question.

"but doesn't count anonymous page views (not logged-in members),"

Thread Thread
 
ellativity profile image
Ella (she/her/elle)

Glad you feel your question is answered! Again, I'm not 100 that this is the discrepancy, because I don't know exactly what GA is logging, so please take this theory with a grain of salt πŸ˜‰

Collapse
 
pandeybk profile image
Balkrishna Pandey

@ellativity is it safe to confirm this is a bug?

Collapse
 
ellativity profile image
Ella (she/her/elle)

I wouldn't call it a bug. I don't necessarily think we should expect Forem to reflect the logic of GA πŸ˜‰ and I think there's value in both datasets, if you can understand how each of them is acquired.

The issue is that GA's data collection isn't 100% transparent, so it's hard for us to tell you why they're collecting different data to us.

The real question from a community management perspective is: why does this data matter to you?

If you understand the reasons why you're collecting your data, then you can determine which data set is more valuable for that purpose.

Thread Thread
 
pandeybk profile image
Balkrishna Pandey

I completely agree; I don't believe we should compare data to GA. I was only giving the stats and attempting to comprehend the rationale. So that if someone asks me a question, I can honestly answer it.

Now I have the answer :). Thank you for the support.

Thread Thread
 
ellativity profile image
Ella (she/her/elle)

You're so welcome! Thanks for the questions and curiosity!

Collapse
 
pandeybk profile image
Balkrishna Pandey

issue fixed forget to run bundle exec sidekiq -c 2