August 26, 2019

Show IH: JustCounts

Matt Gates @mgates

Hey IH,

Completed this project over the weekend. Free to use. No limit on the counters you can use. Just place the image on your website and it'll keep track of the visits to your pages. It works on any website and in emails that allow for img tags. The pro version allows you to customize the colors of your counter, change the verbiage, and see more information about your visitors.

  1. 2

    Very cool. I love the low bar to entry.

    FYI, every time I click Generate Counter, it reuses the same tracking id unless I refresh the page.

    1. 1

      Thank you! I definitely wanted to make this easy for people to use.

      I kept seeing all of these HTML and Javascript counters that were either ugly or required too much information to enter, such as your URL, the counts, etc. Many used a javascript code as well, which can be blocked on some browsers. This just uses a PHP-generated image to keep the count.

      The generate counter button that generates single ID was intentional. There was no sense in generating random IDs every time you clicked the button, as that particular ID would never be in use. The chances of someone getting the same exact ID as you are something like 1 in 999,999.

      But there are safeguards in place to ensure no one ever has the same ID. So if you don't like the ID that was generated for you, you simply refresh the page.

      1. 1

        I don't think users should have a say in the id as such. In that case, you might as well ask them to use their email address or unique domain. Now that you've mentioned collision, I think a potential issue is someone sending false requests with random id's. Perhaps, you should consider using GUID's.

        Every time I press Generate Counter, I'm sort of expecting a new/unique snippet as I might have multiple sites where I might want this specific counter.

        Anyway, the possibilities are quite cool with the type of analytics that you can provide with this.

        1. 1

          Thank you for your feedback. The issue with asking for too much information upfront is that it is off-putting. The counter already knows their domain once they place it. The ID and email are only used to update and keep track of the counter if you upgrade to the Pro.

          Otherwise, there's never an email associated with it other than the ID.

          If I were to just allow anyone to come update the ID without anything attached, then anyone could see it on a website, go to the main site, and change it. That's why the email gets associated with it. I could have easily had a unique ID, but I'd probably be safer with: "Show me all my counters" or something like that, which I can't do with a random code someone forgot, but with an email, it's easier.

          When you hit generate counter, you are generating the ID the first time, but you wouldn't need another one after that as that ID is now specifically to you. The chances of that number coming up again are like playing the lottery.

          As for sending false requests to different IDs: only once the image is set will it begin to record anything. Before that, it's just chosen at random on every page load. I can't see too much of an issue with people thinking, "Wow I really don't like that number." With phone numbers, it might be different. With a random ID, I'm not sure people are going to be so bothered by it.

    1. 1

      Oh gosh! Had spent the night awake fixing a website for a client, while finishing mine.
      8 AM. No sleep. The link would help! Thank you Shree! :)

  2. 1

    Cool project. The all stats page is broken on mobile.

    1. 1

      Thanks, I'll figure it out! There's probably a bit too much data being show for a mobile view.

  3. 2

    This comment was deleted a year ago.

    1. 1

      Haha good idea.

      There is a "smart script" in there to check whether you are visiting it directly. This prevents people from opening up the image and directly manipulating it. Sure, they can refresh the page -- but they are on the page. If they are on the image, than the counts would be wrong. So if you're trying to get it to update from the image itself, than it wouldn't work for you.

      The language it is using is just PHP keeping a count. There is some Javascript to get some additional analytics about your visitors that cannot be captured with PHP.

      1. 1

        This comment was deleted a year ago.

        1. 1

          There is a trick behind it as the image itself is drawn from scratch. That was the exciting part to me. But it was meant to just be a basic counter to start with the ability to gather data from visitors. I was working on another project of mine and using Javascript to keep count, but I noticed it wasn't counting right. It would add up 2 at a time, or sometimes even 3. I needed more accuracy. So since the script is loaded once upon a page load, it has a more accurate count.

Recommended Posts