Address

Author Topic: Is it possible to make a HTML counter?  (Read 1590 times)

DWoodsTEC

  • FamiLAB Member
  • Sr. Member
  • *
  • Posts: 318
  • Inventors Create Jobs
    • View Profile
    • TECreation Development
Is it possible to make a HTML counter?
« on: May 28, 2012, 02:47:05 PM »
Is it possible to make a HTML counter?
I am trying to post a count on the number of times an email link is clicked.  I am using Yola as my host and am quite new to HTML.  Does HTML have the capability to count and post the number?  Next it would need to make that number global so it would turn up when a new person brings up the page.  Or is this something HTML is simply not designed to do?
Dave Woods

Real inventors turn ideas into products in the market.

kc4zvw

  • FamiLAB Member
  • Newbie
  • *
  • Posts: 34
  • Madness takes it's toll. Please have exact change
    • View Profile
    • Amateur Radio Operator: KC4ZVW
Re: Is it possible to make a HTML counter?
« Reply #1 on: May 28, 2012, 10:03:04 PM »
Is it possible to make a HTML counter?
I am trying to post a count on the number of times an email link is clicked.  I am using Yola as my host and am quite new to HTML.  Does HTML have the capability to count and post the number?  Next it would need to make that number global so it would turn up when a new person brings up the page.  Or is this something HTML is simply not designed to do?

Does that host allow you access to a simple CGI bin script?  If so this might be easy to port:

  http://www.west.net/~jay/counter.htm

regards,

David
Web: http://www.kc4zvw.us
Blog: http://kc4zvw.wordpress.com
Amsat * AVR * BSD * Duckworks * Linux * PICmicro * Raspi * TAPR

tetsuharu

  • FamiLAB Member
  • Sr. Member
  • *
  • Posts: 487
  • My sincerest contrafibularities.
    • View Profile
Re: Is it possible to make a HTML counter?
« Reply #2 on: July 12, 2012, 04:36:28 AM »
This was a common problem about 10 years ago, and many people showed up to solve the issue of 'page count' widgets. This site has a few:

http://www.hitwebcounter.com/

Most of the time you will be required to add an embed code, either a <script> tag or an <img> tag. The rest of the counting work is done by someone else's servers.

Most people these days are actually interested in a hit-counter that does NOT present information to the user. They hire a good designer and add share/like buttons to give the visitor the impression that the website has gotten many views. The go-to tool for these people is Google Analytics, which is embedded much the same way as the above script.

http://www.google.com/analytics/

ajbradburn

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: Is it possible to make a HTML counter?
« Reply #3 on: October 09, 2013, 07:27:15 AM »
To my understanding, HTML alone cannot be used to create a counter.  HTML is a bit like a skeleton to give shape to your page.

To make your HTML page "do" things, especially in this situation, you would probably want to look into Javascript.
You could include an onclick action that calls a simple javascript funtion, which then updates the text in an HTML element.

However, without some sort of persistent storage, your count of "clicks" would always show up as zero when the page was loaded, and only increase for the user who is viewing, and clicking the email address.

Ultimate solution might include javascript, which calls a server side script, which updates the number in a file or database, and then returns that number to the javascript, which in turn updates the HTML.

digitalman2112

  • Lab Dad (ex-treasurer)
  • FamiLAB Member
  • Hero Member
  • *
  • Posts: 1096
  • Work Hard, Play Hard!
    • View Profile
    • Raising Geeks
Re: Is it possible to make a HTML counter?
« Reply #4 on: October 09, 2013, 08:53:08 AM »
You can also solve this by using an email provider that supports click tracking - We use MailChimp for OMMF, and it supports that feature - http://kb.mailchimp.com/article/about-click-tracking