Home Events! Entrance Everyone Wiki Search Login Register

Welcome, Guest. Please login or register. - Thinking of joining the forum??
November 23, 2024 - @392.25 (what is this?)
Forum activity rating: Three Stars Posts: 31/1k.beats Unread Topics | Unread Replies | My Stuff | Random Topic | Recent Posts    Start New Topic
News: :skull: Websites are like whispers in the night  :skull:

+  MelonLand Forum
|-+  World Wild Web
| |-+  ✁ ∙ Web Crafting
| | |-+  ☔︎ ∙ I need Help!
| | | |-+  HELP: websiteout counter is not working properly


« previous next »
Pages: [1] Print
Author Topic: HELP: websiteout counter is not working properly  (Read 963 times)
Neguuy
Casual Poster ⚓︎
*


⛺︎ My Room

View Profile WWW

Joined 2023!
« on: November 09, 2023 @885.89 »

Hi!  :dog:

I just tried adding a counter from Website Out.

However, the unique visitor counter increments everytime i reload the page myself and it increments by 2 instead of 1!

Also, it starts at 37 even though I set it to 4 as the initial value (I don't know if it can get the actual numbers of unique visitors retroactively, if it does so then great and no problem there!).

I added a second counter for general visits and it seems to work better, using the value neocities gives me on my dashboard as the initial value, but I think it also increments by 2.

I haven't found anything about this from searching on Google (nor on the forums here - I haven't used forums in a long time but I remembered in extremis to search the forum before opening a new topic!! yay!) so far so I hope someone here who has already encountered this issue may know what is going on!

Thank you in advance to everyone who takes the time to reply!! :transport:
Logged
ThunderPerfectWitchcraft
Sr. Member ⚓︎
****


Here be dragons

⛺︎ My Room

View Profile WWW

Thanks for being rad!First 1000 Members!Joined 2023!
« Reply #1 on: November 09, 2023 @906.28 »

Hi.
Can't help you with the issue right at hand: The whole functionality is on the side of the service provider, and thus nobody can check where the problem resides from.

Can you use php on your site? Implementing a simple php counter is quite easy. You can do it either yourself, or use a solution made by smb else:

Code
<?php
           session_start(); // Should always be on top
           if(!isset($_SESSION['counter'])) { // It's the first visit in this session
             $handle = fopen("counter.txt", "r"); 
             if(!$handle){ 
              echo "Could not open the file" ;
               } 
              else { 
                $counter = ( int ) fread ($handle,20) ;
                fclose ($handle) ;
                $counter++ ; 
                echo" <p> Visitor Count: ". $counter . " </p> " ; 
                $handle = fopen("counter.txt", "w" ) ; 
                fwrite($handle,$counter) ; 
                fclose ($handle) ;
                $_SESSION['counter'] = $counter;
                }

           } else { // It's not the first time, do not update the counter but show the total hits stored in session
             $counter = $_SESSION['counter'];
             echo" <p> Visitor Count: ". $counter . " </p> " ;
           }
?>

Source: https://stackoverflow.com/questions/44534078/php-unique-visitor-count-without-database

If you need help at customizing this thing, just let me know ;).
Logged

Melooon
Hero Member ⚓︎
*****


So many stars!

⛺︎ My Room
SpaceHey: Friend Me!
StatusCafe: melon
iMood: Melonking
Itch.io: My Games

View Profile WWW

Thanks for being rad!a puppy for your travelsAlways My PalFirst 1000 Members!spring 2023!Squirtle!!!!MIDI WarriorMIDI Warrior1234 Posts!OzspeckCool Dude AwardRising Star of the Web AwardMessage BuddyPocket Icelogist!OG! Joined 2021!...
« Reply #2 on: November 09, 2023 @928.85 »

Can you use php on your site?
It's a neocities site so I'd guess that's a no :drat:

The important thing to know about hit counters is that they are semi-meaningless; SO many variables change their results, from bots to ad blockers, to how your site is coded, to glitches in the network connection. Every little thing can affect your hit counter to display more or less hits than your site really gets.

The neocities counter is absolutely crazy and no one has any idea how it works and some adblockers block some 3rd party counters like the one you use. So take any results on a hit counter with a brick of salt! They are still fun to have, and they can give you vague information (such as if your overall hits are increasing), but don't worry about the specifics or accuracy of them, they cannot ever be accurate :ohdear:
Logged


everything lost will be recovered, when you drift into the arms of the undiscovered
Neguuy
Casual Poster ⚓︎
*


⛺︎ My Room

View Profile WWW

Joined 2023!
« Reply #3 on: November 09, 2023 @931.75 »

Indeed, I just checked and Neocities won't allow PHP so that's a no for my site. Thanks Melooon, I didn't know that. I have Opera GX with the native adblocker enabled so that might be why it's doubling my hits on refreshes. Maybe I'll do away with counters for the time being, considering I really like to do a hard refresh everytime i change a little thing in my code so I can see how it looks on the page itself. :ozwomp:  :pc:

I might try again once I have a more stable look for my site. Thanks all for the help!! :unite:
Logged
ThunderPerfectWitchcraft
Sr. Member ⚓︎
****


Here be dragons

⛺︎ My Room

View Profile WWW

Thanks for being rad!First 1000 Members!Joined 2023!
« Reply #4 on: November 09, 2023 @934.58 »

Had no idea that they didn't allowed php either; srz dude!
Logged

Neguuy
Casual Poster ⚓︎
*


⛺︎ My Room

View Profile WWW

Joined 2023!
« Reply #5 on: November 09, 2023 @945.46 »

Neither did I until I checked after seeing your reply. :grin:  :drat:
Logged
Melooon
Hero Member ⚓︎
*****


So many stars!

⛺︎ My Room
SpaceHey: Friend Me!
StatusCafe: melon
iMood: Melonking
Itch.io: My Games

View Profile WWW

Thanks for being rad!a puppy for your travelsAlways My PalFirst 1000 Members!spring 2023!Squirtle!!!!MIDI WarriorMIDI Warrior1234 Posts!OzspeckCool Dude AwardRising Star of the Web AwardMessage BuddyPocket Icelogist!OG! Joined 2021!...
« Reply #6 on: November 09, 2023 @945.69 »

@Neguuy This is a bit of an open secret, but if you do wanna display your neocities hits on your site; I run a proxy server you can use *looks shifty and hands you a script from under a heavy coat*  :innocent:

Proxy address:
https://brain.melonking.net/neo-hits?user=neguuy

Script:
Code
<span id="hits-box"></span>
<script defer>
    // Load live neocities hits into the hit counter
    var hitsBox = document.getElementById("hits-box");
    window.onload = async function () {
        var request = new XMLHttpRequest();
        request.open("GET", "https://brain.melonking.net/neo-hits?user=neguuy", true);
        request.send(null);
        request.onreadystatechange = function () {
            if (request.readyState === 4 && request.status === 200) {
                if (request.responseText != "error") {
                    hitsBox.innerHTML = "<strong>" + request.responseText + " HITS</strong>";
                }
            }
        };
    };
</script>

If anyone else wants to add this to their site, just change the username ^^
Logged


everything lost will be recovered, when you drift into the arms of the undiscovered
Neguuy
Casual Poster ⚓︎
*


⛺︎ My Room

View Profile WWW

Joined 2023!
« Reply #7 on: November 10, 2023 @2.62 »

@Melooon O_o thank you!!
I just put it on my site :eyes: I'll have to figure out a better spot for it at some point though.
I guess that stat is still modified by my adblocker then, Neocities shows me like 7-8000 total hits and the counter says 24000  :ozwomp:
Logged
Melooon
Hero Member ⚓︎
*****


So many stars!

⛺︎ My Room
SpaceHey: Friend Me!
StatusCafe: melon
iMood: Melonking
Itch.io: My Games

View Profile WWW

Thanks for being rad!a puppy for your travelsAlways My PalFirst 1000 Members!spring 2023!Squirtle!!!!MIDI WarriorMIDI Warrior1234 Posts!OzspeckCool Dude AwardRising Star of the Web AwardMessage BuddyPocket Icelogist!OG! Joined 2021!...
« Reply #8 on: November 10, 2023 @9.36 »

Neocities shows me like 7-8000 total hits and the counter says 24000
Neocities has two numbers, Hits and Views - as far as I know, hits are literal page loads, whereas views are some sort of algorithmicly filtered number that tries to remove bots and page reloads.

You can see both your numbers if you look at it on the neocities API: https://neocities.org/api/info?sitename=neguuy

The number my proxy fetches is the hits number; I'm afraid there's no way to pick the other number via my system atm since it was only made for internal use on my sites and then it got abandoned, so it's quite limited! But I may expand it in the future if people need it ^^
Logged


everything lost will be recovered, when you drift into the arms of the undiscovered
brisray
Sr. Member ⚓︎
****


⛺︎ My Room

View Profile WWW

RocketmanFirst 1000 Members!Joined 2023!
« Reply #9 on: November 19, 2023 @964.19 »

Hardly anything is ever as easy as it first appears and website statistics is one of those. Take a simple hit counter. What is it actually measuring? It should be easy, it should be counting page views which is what a lot of people are interested in. But, is it ignoring self-visits and bot vs human visits?

Then there's other statistics available. I don't know about the Neocities API but presumably it's hooking into the server logs. A lot of information is exchanged everytime you visit a site and log analytics or beautifiers should give more information than a simple counter.

A: Visitors - The total number of visits to your site
B: Unique visitors - The number of different visitors
C: Pages - Just the pages viewed - HTM, HTML, ASP, PHP...
D: Hits - The number of files served - includes pages, images, videos...
E: Bandwidth - The size of all the files served

The difference between A and B gives an idea of how often someone revisits the site. C and A gives an idea of how many pages a visitor views on each visit. Bandwidth is important if your host charge you by bandwidth used or even shut your site down after a certain limit. Probably not so important nowadays.

Lots of other information is recorded and can be analyzed just from the logs but once you start getting into tracking cookies or JavaScript like Google Analytics and others then you're getting into looking at an individual's behaviour on the site.

That sounds a bit scary, but unless you make people log into a site, you're still only using IP addresses not personal information.

I self-host and recently installed some older log analyzers - https://brisray.com/utils/stats.htm
Logged
Pages: [1] Print 
« previous next »
 

Vaguely similar topics! (3)

Do you like death note?

Started by JackFrostBoard ⛺︎ ∙ Cinema

Replies: 16
Views: 2401
Last post March 07, 2024 @830.49
by Diggon
! ( how to get websites working on DSi? )

Started by JackFrostBoard ☔︎ ∙ I need Help!

Replies: 7
Views: 1067
Last post January 18, 2023 @922.37
by Memory
What are you working on at the moment?

Started by MelooonBoard ✁ ∙ Web Crafting

Replies: 192
Views: 15809
Last post November 16, 2024 @873.22
by Turboblack

Melonking.Net © Always and ever was! SMF 2.0.19 | SMF © 2021, Simple Machines | Terms and Policies Forum Guide | Rules | RSS | WAP | Mobile


MelonLand Badges and Other Melon Sites!

MelonLand Project! Visit the MelonLand Forum! Support the Forum
Visit Melonking.Net! Visit the Gif Gallery! Pixel Sea TamaNOTchi