Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Possible to get Discussion View Counts Without Sending Stats Data?

Is there a way to have the Discussions CountViews field populated, without having to send stats data to an external site? Would enabling the stats plugin but setting $Configuration['Garden']['Analytics']['Enabled'] = FALSE; accomplish this? It was unclear from the Statistics docs page, which states

"Please note that disabling data reporting will cause the Vanilla Statistics plugin to cease to function as we will not have any data to report.".

That note makes sense, just not sure on whether the db tables still get populated. Or is there a better way to enable this if I don't need anything but that one field populated?

Tagged:

Comments

  • hgtonighthgtonight ∞ · New Moderator

    You don't need to have the vanilla statistics plugin enabled for view counts to work. Clients call the analyticstick.json asynchronously on every page load. This kicks off the local analytics as well as the remote analytics if enabled.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • oh thanks. Would there be some other reason then, that all my discussions show a ViewCount of 1? I assumed (incorrectly I guess) that these weren't being inserted due to having the stats plugin disabled. I didn't dig much further. There are some that have certainly had many more views than that, and been around quite awhile (many months/almost a year).

  • AaronWebsteyAaronWebstey Headband Afficionado Cole Harbour, NS ✭✭✭

    Your host/server may be blocking json requests. Check your javascript console and see if analyticstick.json is being successfully loaded when you load a discussion. (this recently happened to me :) ).

  • hgtonighthgtonight ∞ · New Moderator

    @nearmiss said:
    oh thanks. Would there be some other reason then, that all my discussions show a ViewCount of 1? I assumed (incorrectly I guess) that these weren't being inserted due to having the stats plugin disabled. I didn't dig much further. There are some that have certainly had many more views than that, and been around quite awhile (many months/almost a year).

    JS is required to be available and enabled on clients to count views. If you disable JS, stats won't count.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • nearmissnearmiss New
    edited March 2016

    JS definitely enabled. I see it loads global.js which has reference to

    var StatsURL = gdn.url('settings/analyticstick.json');

    That doesn't seem to be a valid path on my local install though (not sure if this is normal, or due to customizations by teams before I arrived). The ajax post to /settings/analyticstick.json doesn't succeed. I think this is related to the external vanillaforums.org url though, so not sure if I am even looking in the right spot.

    Continuing to poke around, and thanks for the pointers thus far.

  • hgtonighthgtonight ∞ · New Moderator

    @nearmiss said:
    That doesn't seem to be a valid path on my local install though (not sure if this is normal, or due to customizations by teams before I arrived).

    That does not represent a folder structure. The url path is dispatched and calls the appropriate method on the appropriate controller.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • noncenonce Necro-on Forensics
    edited March 2016

    I concur. Although the explanation could be in english instead of computer jargon. sometimes jargon is necessary.

    try entering gdn.meta in your console to see the value of StatsURL

    but as you say you may be on the wrong path metaphorically.

Sign In or Register to comment.