Thread Rating:
  • 2 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
HitCount Plugin
#1
For all those who want an integrated hit and visitor count or don't trust Google Analytics & Co, here's a simple plugin to count hits per page: http://get-simple.info/extend/plugin/hitcount/91/

You can view and reset the hit counts in the admin console under Support - Hits & Visitors.

Installation

The plugin tries to create a directory /data/other/hitcount but depending on your hoster's setting this might be unsuccessful or just create a directory that can not be written to.

If the hit counts remain zero although you access the site:
  • create a directory hitcount in /data/other with mode 0777
  • if you use Apache, create a .htaccess file with "DENY FROM ALL" in this directory

Counting Downloads

Install the Download Interceptor plugin.
(requires Hitcount 1.0+)

Counting hits to other websites

Include a link on the other website to http://your-path-to-getsimple/plugins/hitcount/ping/ping.php?from=subject,
where subject is the name, under which you will see the hits one the Hits & Visits page.
You can return the same subject for the whole website or a different one for each page. Just make sure that the subject is different from all page slugs on your GetSimple site.
The above link returns a 1px transparent gif. If you add an additional parameter js or css, empty files of that type are returned.
(requires Hitcount 1.1+)

Blacklisting IP addresses

You can create a file /data/other/hitcount_blacklist.txt and enter the IP addresses to be blacklisted separated by blanks or line feeds. Hits from these IP addresses are not counted (if the IP address of the client is recognized).
(requires Hitcount 1.1+)

Get visitors' countries

You can download a mapping from IP to country and thus determine the countries of your visitors.
  • Enter into gsconfig.php (replace MY_TOKEN with the real token):
Code:
define('HITCOUNT_URL', 'https://www.ip2location.com/download/?token=MY_TOKEN&file=DB1LITEIPV6');
  • go to Support - Hits & Visitors and select Download IP to country database. This will create the files /data/other/ip2country.txt and /data/other/countries.txt.
  • From then on the plugin tries to determine the visitors' countries.
For more information see http://mvlcek.bplaced.net/get-simple/hitcount.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#2
mvlcek Wrote:...or don't trust Google Analytics & Co

who wouldn't trust these guys?!?!? Smile
- Chris
Thanks for using GetSimple! - Download

Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Reply
#3
Any thoughts of extending it to full analytics?

i.e. entry/exit, visitor path, etc.

-Rob A>
Reply
#4
RobA Wrote:Any thoughts of extending it to full analytics?

i.e. entry/exit, visitor path, etc.

-Rob A>
by entry you mean referrer ?
would be cool Smile
Addons: blue business theme, Online Visitors, Notepad
Reply
#5
Version 0.7 writes a log file with time, page, visitor number, referer and user agent. No personal data and no IP adresses are logged by the plugin (important in Austria and Germany, as data privacy laws forbid logging of personal data and IP adresses are seen as personal data by some courts).

Currently the plugin allows you to view visit durations, referers and user agents along with total number of visits and hits per page.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#6
Any way to have these numbers on public pages? Ex. any functions to be included in a component?
Reply
#7
Version 0.8:
  • Bars overlaying the numbers on the administration pages for a better overview
  • Functions return_hitcount_hits(return_page_slug()) and return_hitcount_visits() to display hits of the current page and visits on your site.

[Image: hitcount_hits.png]
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#8
Version 0.9:
  • Show operating systems (from user agent)
  • Show browsers (from user agent)
  • Show default language (from user agent) - to find out, into which languages you might want to translate your site using the I18N plugin ;-)
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#9
Mvlek: your plugin development is faster than me taking shower Wink

Regarding latest version of your hitcount plugin, will you update browser tab to show specific versions of browsers as well ?
You could take it from user agent info, like:
Mozilla/5.0 (Windows; U; Windows NT 6.1Wink Gecko/20110303 Firefox/3.6.15 (.NET CLR 3.5.30729)
but still haven't had enough time to look into plugin core of v.0.9

btw. hitctount plugin lacks translation possibility.
How can I provide language files to your other plugins ?
You should also push menu caption to translation file.


ahhh, I'd forgot: think about adding a feature to disable hitcount from certain IP's/domains, because counting own visits raises statistics greatly Winks
Addons: blue business theme, Online Visitors, Notepad
Reply
#10
yojoe Wrote:Regarding latest version of your hitcount plugin, will you update browser tab to show specific versions of browsers as well ?

I decided against it, because there are too many versions and the list would mostly have 1-visit entries.
Same reason for OS to have for OS X only the first 2 numbers in version.

Quote:You could take it from user agent info, like:
Mozilla/5.0 (Windows; U; Windows NT 6.1Wink Gecko/20110303 Firefox/3.6.15 (.NET CLR 3.5.30729)

The version information is parsed, but not included in the output. Maybe I'll include a "Show versions" switch? Meanwhile you can patch hitcount/browser.php and set $ua['name'] to browser[0].' '.browser[1] (if I remember correctly).

Quote:btw. hitctount plugin lacks translation possibility.

Yep, on my TODO - as the header of hitcount.php reminds me...

Quote:How can I provide language files to your other plugins?

Look into the <pluginname>/lang directory and create a similar file.

Quote:You should also push menu caption to translation file.

I do not understand?

Quote:ahhh, I'd forgot: think about adding a feature to disable hitcount from certain IP's/domains, because counting own visits raises statistics greatly Winks

Does not work for me - changing IPs. And you should see all visits, even from your IP (company), as long as it's not the editor/administrator.

How about setting a cookie in the backend - thus all editors are automatically excluded - as long as they don't delete the cookie.
But I fear there is no appropriate hook - like index-pretemplate for the frontend - for the backend?
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#11
Quote:I decided against it, because there are too many versions and the list would mostly have 1-visit entries.
Same reason for OS to have for OS X only the first 2 numbers in version.

Hmm... How about cutting versions and show main branches, for example
FX < 3.6, FX.3.6 (latest version number cut off), FX .4
Chrome < 9, 9 > 9
and so on ?
The most important for me is still Internet Exploiter :/

Quote:
Quote:How can I provide language files to your other plugins?

Look into the <pluginname>/lang directory and create a similar file.
ahh, I had on my mind where to send them, because I didn't find an email nor a contact form on your website Wink
I'll just post a zip with translation to all plugins after I patch all of them to latest version, and retranslate them, because you split i18n to 2 plugins (nice!).

Quote:
Quote:You should also push menu caption to translation file.

I do not understand?
example: hitcound plugin has hardcoded menu caption "Hits & Visitors", as well as your other plugins.
I wanted to ask to have a possibility to translate menu caption in GS admin using language file.
Of course if you already do not have this on your todo list Wink

Quote:Does not work for me - changing IPs. And you should see all visits, even from your IP (company), as long as it's not the editor/administrator.

Quote:How about setting a cookie in the backend - thus all editors are automatically excluded - as long as they don't delete the cookie.
But I fear there is no appropriate hook - like index-pretemplate for the frontend - for the backend?

Cookie isn't a great idea, as it will work only for 1 browser on 1 terminal.
How about grabbing visitor's IP, having a black list where we could paste our external IP number(s), and a button to parse all statistic files and delete numbers of all visits coming from blacklisted IPs ?
But it's not an elegant way, and takes more resources comparing to a solution based on comparation between visitor's IP and blacklisted IP number.
Addons: blue business theme, Online Visitors, Notepad
Reply
#12
Got a small requests:
1. moving hitcount window to pages page instead of support page
2. instead of hiding button of currently seen statistics, just make it unclickable.

It's easy, but you update your plugins too frequently with awesome functionalities, so it doesn't make any sense to mess with their code all the time I want to update a plugin :/
Addons: blue business theme, Online Visitors, Notepad
Reply
#13
New version 0.9.1: Just fixes a warning in debug mode on GetSimple 3.0b.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#14
yojoe Wrote:Hmm... How about cutting versions and show main branches, for example
FX < 3.6, FX.3.6 (latest version number cut off), FX .4
Chrome < 9, 9 > 9
and so on ?

Firefox 2 numbers (e.g. 3.5, 3.6), Chrome 1 number, ... is doable. And maybe a toggle - with/without versions.

yojoe Wrote:because you split i18n to 2 plugins (nice!).

In order to make a I18N Navigation plugin, but also because you can only have one admin view per plugin - and I needed a second for the navigation structure.

yojoe Wrote:example: hitcound plugin has hardcoded menu caption "Hits & Visitors", as well as your other plugins.
I wanted to ask to have a possibility to translate menu caption in GS admin using language file.

Already done for I18N and I18N Search.

yojoe Wrote:Cookie isn't a great idea, as it will work only for 1 browser on 1 terminal.
How about grabbing visitor's IP, having a black list where we could paste our external IP number(s), and a button to parse all statistic files and delete numbers of all visits coming from blacklisted IPs ?
But it's not an elegant way, and takes more resources comparing to a solution based on comparation between visitor's IP and blacklisted IP number.

If the plugin uses a blacklist, it has to be checked on first hit of a visitor, as the plugin does not and will not log ip addresses (in Germany and Austria IP addresses are personal data (probably, depends on the court) and must not be logged without the consent of the visitor).

yojoe Wrote:Got a small requests:
1. moving hitcount window to pages page instead of support page

I think it belongs to support, the editor using the pages menu doesn't normally need it.
But you can just change 'support' to 'pages' in the register_plugin call.

yojoe Wrote:2. instead of hiding button of currently seen statistics, just make it unclickable.

Are you sure? Currently the links only use a second line with "Operating Systems". After this change they always would.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#15
mvlcek Wrote:Firefox 2 numbers (e.g. 3.5, 3.6), Chrome 1 number, ... is doable. And maybe a toggle - with/without versions.

Assuming it can't be done for all types of browsers, then it makes no sense in wasting time on coding such functionality only for 1-2 browsers.

Code:
If the plugin uses a blacklist, it has to be checked on first hit of a visitor, as the plugin does not and will not log ip addresses (in Germany and Austria IP addresses are personal data (probably, depends on the court) and must not be logged without the consent of the visitor).

Going this route, using any analytic application in Germany is prohibited.
I'm not here to talk about law matters, just wanted to point out that many hits are coming from user(s) managing their own website.

Code:
I think it belongs to support, the editor using the pages menu doesn't normally need it.
But you can just change 'support' to 'pages' in the register_plugin call.
Been doing that already Wink

mvlcek Wrote:
yojoe Wrote:2. instead of hiding button of currently seen statistics, just make it unclickable.
Are you sure? Currently the links only use a second line with "Operating Systems". After this change they always would.
Hmm...I got a feeling you don't get what I'm talking about.
When (at least in hc v 9.6) I jump between: Hits | Referers | User agents | Duration | Browsers | Languages, the stat I'm currently looking has its button hidden.
This makes me confused as the navigation menu changes its size, and distracts me. It leads me to forget what stats I've already seen.
I know that there's a caption on top left corner, but looking at it from usability view, it's better to have a coloured and disabled menu button of the page I'm already on.

Just mine 2 cents.
Addons: blue business theme, Online Visitors, Notepad
Reply
#16
yojoe Wrote:Going this route, using any analytic application in Germany is prohibited.

Google analytics introduced a function to anonymize the ip addresses before they log them, mainly for Germany, I think.

yojoe Wrote:I'm not here to talk about law matters, just wanted to point out that many hits are coming from user(s) managing their own website.

I know, it shouldn't be too hard to implement a black list. I write it on my to do list.

yojoe Wrote:Hmm...I got a feeling you don't get what I'm talking about.

I do understand, but the list of links is already long and wraps into the second line sometimes. If the current link is shown, it will always wrap into the second line.
But you are right, hiding the current link is a bit confusing - I'll change it.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#17
mvlcek Wrote:thus all editors are automatically excluded
Hi,

this feature I would appreciate as well.
- could be loggen in user or
- blacklist or
- at least hits coming from admin panel

bydey
deynews.de
my getsimple page deynews.de
Reply
#18
Works fine


Regards!
Reply
#19
Awesome plugin! A suggestion would be to add back the <h3> after the <label> tab on each plugin page. Your screenshots show it, but upon installation they weren't there. Makes it blend in a little better with the default admin template...
Reply
#20
patriotmedia Wrote:Awesome plugin! A suggestion would be to add back the <h3> after the <label> tab on each plugin page. Your screenshots show it, but upon installation they weren't there. Makes it blend in a little better with the default admin template...

Thanks for the great plugin. I use it for dozens of clients. One great feature would be the ability to use track statistics on 3rd party pages. Could this be easily accomplished?
Reply
#21
mikeh Wrote:Thanks for the great plugin. I use it for dozens of clients. One great feature would be the ability to use track statistics on 3rd party pages. Could this be easily accomplished?

I'm glad that the plugin is useful :-)

What do you mean with 3rd party pages? How often the referer was another domain?
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#22
mvlcek Wrote:
mikeh Wrote:Thanks for the great plugin. I use it for dozens of clients. One great feature would be the ability to use track statistics on 3rd party pages. Could this be easily accomplished?

I'm glad that the plugin is useful :-)

What do you mean with 3rd party pages? How often the referer was another domain?

For example, services like Statcounter or give you code you can put on any webpage to track the stats on it. It doesn't necessarily need to be from the same domain/domain-level.

I integrate many of my websites with third party services (such as IDX Broker.com) (Site ex: http://search.agentboca.com/idx/8526/adv...arch.php). This plugin only tracks local pageviews, so I cannot track traffic on search.agentboca.com. It would be great if there was a piece of js or something I can put in the footer of the third party service or outside domain webpage to track traffic on that page as well.

I am definitely not asking you to make some huge addition to your plugin to help out very few people who would need something similar. I am just curious if this is possible and if so, how easy it would be to accomplish.
Reply
#23
Hello

I have noticed in Hitcount's statistics a lot of 404 hits. What can it means? Should I worry about that?
Reply
#24
blazejs Wrote:Hello

I have noticed in Hitcount's statistics a lot of 404 hits. What can it means? Should I worry about that?

It could mean that somewhere (on your site or somewhere else) there are links to pages on your site that don't exist anymore.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#25
Hmm.. that's strange as I have redirected (301) all previous pages to new and I also use LinkJuice on some sites.

I have just checked it out and it seems problem doesn't exist where LinkJuice is installed, so I have to upload it to every site. Thanx!
Reply




Users browsing this thread: 1 Guest(s)