Skip navigation
Currently Being Moderated

How do I create an invisible website counter?

Dec 28, 2013 11:30 AM

Tags: #website_counter

I need to create a website counter on my website that is invisible until i hover the mouse icon over it. Anybody have any idea on how to do this?

 
Replies
  • Currently Being Moderated
    Dec 28, 2013 11:44 AM   in reply to BillyKundalini

    Hit counters are useless & they scream "amateur site."  If your hosting company doesn't provide meaningful server stats, sign up for Google Analytics (it's free).  Analytics runs in the background -- invisible to site visitors.  The information it gathers is much more informative than an ordinary hit count.  You'll learn how many site visits you're getting, which devices your visitors use, where they come from, how long they stay on specific pages, etc... 

     

     

    Nancy O.

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 28, 2013 12:17 PM   in reply to BillyKundalini

    Hello Billy,

     

    in addition to Nancy's hint I want primary plead so too for your providers offers. To show you, what mine "brings", here two screenshots:

     

    1. Menu bar (Zugriffstatistik > something like: "access statistics""

     

    Stat01.jpg

     

    and here the statis of itself, he made for me till november:

     

    Stat02.jpg

     

    It can be seen only on the website of my provider.

     

    Hans-Günter

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 28, 2013 12:24 PM   in reply to BillyKundalini

    Not sure why you would want to do that, as has been said web counters are an unreliable source as to the number of site visitors. If you want it just for fun then you could use some simple jquery to show the counter on mouseover. I've put a border around the <div> in the example below so you can locate it.

     

    Close the gap between & and n in the & nbsp; inserted in the <div> Put the code associated with the counter where you see '<p style="text-align: center;">Counter code goes here</p>' in the jquery below.

     

     

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

    <html>

    <head>

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <title>Untitled Document</title>

    <script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>

    <script>

    $(document).ready(function() {

    $('#counter').mouseenter(function () {

    $('#counter').html('<p style="text-align: center;">Counter code goes here</p>');                                                                                                                                     

    }

    );

    });

    </script>

    <style>

    #counter {

        width: 250px;

        margin: 0 auto;

        border: 1px solid #CCC;

    }

     

    </style>

    </head>

     

    <body>

    <div id="counter">& nbsp;</div>

    </body>

    </html>

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 28, 2013 12:32 PM   in reply to BillyKundalini

    Hello Billy,

     

    that shouldn't be a problem! Use Google for a search "webcounter", there you will find offer on offer!

     

    Hans-Günter

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 28, 2013 3:26 PM   in reply to hans-g.

    A quick and simple way is to create a text file in the root of your site, and when any page loads, get it to open the file, add one to the number that it contains and close it again. If you need to count all hits, just have a  text file for each page.

    To read a file at any time, print the contents of the file on your screen in the background colour surrounded by an <a> tag. That way it is invisible. Then you need some CSS that changes the colour of the text when it is hovered over. Not hard to set up.

     

    For instance:

    <a href=# >contents of file go here</a>

    CSS

    {

    a.hover color: blue;

    }

     

    or similar

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 29, 2013 7:36 AM   in reply to BillyKundalini

    Hello Billy,

     

    are you sure, that this "mouse over icon" remains unseen for other visitors. "The mouse is everywhere!"

     

    Hans-Günter

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 30, 2013 10:50 AM   in reply to BillyKundalini

    "How do I create a small section of my website that has an icon that is hidden until i hover the mouse cursor over it?"

    Touch screen devices don't respond to Hover event triggers since they don't have a mouse.  Nowadays, it's better for usability if you use onClick event triggers.

    http://jsfiddle.net/AP9Hm/40/

     

     

    Nancy O.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 10, 2014 7:55 PM   in reply to Nancy O.

    Please, please, please help!

    I am trying to put the tracking code for google analytics in to Dreamweaver CS6 code. I have copied the code from the website and pasted it directly in front of the </head> tag; didn't work. I have also used the "common, script" way; didn't work.

    My code has been looking like this:

    <script type="text/javascript">
    <script>
      (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||func tion(){
      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
      })(window,document,'script','//www.google-analytics.com/analytics.js' ,'ga');

      ga('create', 'UA-47829116-1', 'twistedflow.com');
      ga('send', 'pageview');

    </script>

     

    In my dreamweaver the above underlined are red.

    Can you please help me??

     

    Thanks,

    Janelle

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 11, 2014 2:23 AM   in reply to jgoetz03

    You have 1 and a half sets of <script> tags:

     

     

    Delete this line of code:

     

    <script type="text/javascript">

     

     

    The below will do if you're using an html 5 doc type or it will do anyway if you are not - just the page won't validate. If you're concerned about that replace the opening <script> tag with <script type="text/javascript">

     

    <script>
      (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||func tion(){
      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
      })(window,document,'script','//www.google-analytics.com/analytics.js' ,'ga');

      ga('create', 'UA-47829116-1', 'twistedflow.com');
      ga('send', 'pageview');

    </script>

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 11, 2014 5:15 AM   in reply to jgoetz03

    jgoetz03 - please don't hijack threads as you have done. This question should be posted in a new thread, not as a reply to someone else's thread. If you still have a question about this, please start a new thread. I hope no one else responds to you here in this thread.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 11, 2014 10:49 AM   in reply to osgood_

    Thank you for your info! What do you mean by "validate" the page?

     

    Thanks!

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 11, 2014 10:50 AM   in reply to MurraySummers

    MurraySummers,

    I'm sorry to have offend you. My question was along the same line as yours and I figured instead of cluttering the boards with the same question, I could just post it here and get a response.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 11, 2014 10:59 AM   in reply to jgoetz03

    Actually your question and its answer had very little to do with the topic of this thread. And it's not a matter of offending me - threads like your question would have produced would be helpful to others searching for information about analytics coding issues but now that it's buried in this thread, no one will find it.

     

    The forum is made for people to clutter the thread list with their own questions!

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 11, 2014 11:51 AM   in reply to jgoetz03

    jgoetz03 wrote:

     

    Thank you for your info! What do you mean by "validate" the page?

     

    Thanks!

    Some say you should make sure your page validates to W3C coding standards - I was just making you aware that if you were not using html 5 and cared about validation then just using <script></script> tags would cause the page to fail a validation test.

     

    If youre happy your page works in all the major browser you want to support then you can ignore validation tests.

     

    Could I care less about a page validating, no but then I'm a pretty good code writer so I know any mistakes I make would not matter a jot. If your code is littered with errors well then you should learn to write better code.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points