FIX: Add suppress_anonymous_pageviews site setting (PR #12800)

For example, for sites with login_required set to true, counting anonymous pageviews is confusing.

GitHub

Can we name the setting simply suppress_anonymous_pageviews? Actually, suppress sounds like the pageviews are deleted, maybe ignore_anonymous_pageviews is clearer?

This will exclude anonymous views for login required sites regardless of the setting, right? (Or I am reading this wrong? I have trouble parsing “not this OR not that” in my head.

I think it would be good to have a test case with login_required = true and suppress_anonymous_pageviews_on_private_sites = false.

maybe ignore_anonymous_pageviews is clearer?

:+1:

I have trouble parsing “not this OR not that” in my head.

Double negations is super hard :exploding_head:

This will exclude anonymous views for login required sites regardless of the setting, right?

Looks like it.

Yes, exactly. At first I wanted to call it just suppress_anonymous_pageviews, but I wanted to point out the site has to be private (login_required = true).

It’s fine we can include that in the description of the setting :wink:

Hmm… it’s a hidden setting though.

That’s a very good point. Still I much prefer the shorter name. If they want to change it, they will need to do it via the console/ENV, so they will have to understand what it does

no need for a try here, once it exists in discourse_defaults it is safe to use.

That said, I say we just kill the setting altogether, it is not named right.

ignore_anon_views_on_private_sites is probably more correct, but it a mouthful.

Let’s offer no setting, then if someone complains they need a setting we can consider adding it.

Good to merge once my comment is addressed! :+1: