Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: Page Counter

  1. #1
    Regular Coder LearningCoder's Avatar
    Join Date
    Jan 2011
    Location
    The Pleiades
    Posts
    924
    Thanks
    76
    Thanked 29 Times in 29 Posts

    Page Counter

    Just wanted to know what the correct procedure is for counting page views with a site.

    If a user visited the homepage first and then the contact us page for example, do you cound that as 1 viewing or 2 viewings?

    Also, do I need to retrieve information about a user using the $_SERVER global to determine if it is the same user viewing the separate pages?

    Regards,

    Lc.
    Last edited by LearningCoder; 10-29-2012 at 07:27 PM.

  • #2
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,421
    Thanks
    62
    Thanked 535 Times in 522 Posts
    It's a minefield. Some forums count you looking at the same topic twice as two views while others will only count you if the number of replies has changed etc. Thats just forums..

    I don't think there is any right or wrong answer here to be honest with you LC. It's more a preference of what you prefer. Many tracking programs count hits and then 'unique' hits - so you get to see both.
    See my new CodingForums Blog: http://www.codingforums.com/blogs/tangoforce/

    Many useful explanations and tips including: Cannot modify headers - already sent, The IE if (isset($_POST['submit'])) bug explained, unexpected T_CONSTANT_ENCAPSED_STRING, debugging tips and much more!

  • #3
    Regular Coder LearningCoder's Avatar
    Join Date
    Jan 2011
    Location
    The Pleiades
    Posts
    924
    Thanks
    76
    Thanked 29 Times in 29 Posts
    Ah thank you for the clarification.

    Given what you've said, I think I will increment the count when any of the pages are accessed. After all I suppose it could be classed as a 'page view' because we're viewing that new page/content so maybe it should be incremented like that.

    Not only that, it looks better for me!

    Thanks for the reply.

    Kind regards,

    LC.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •