Results 1 to 2 of 2

Thread: How this cookie count the pageviews?

  1. #1
    Join Date
    Apr 2008
    Posts
    30

    How this cookie count the pageviews?

    Hello,

    I am not sure how to count visitors.
    I know there is a way to count your site visitors? You can count the no of hits on your page but that wont give you the perfect idea of your website popularity. Please let me know how this cookie count the pageviews?
    I want to know how to get the exact no. of unique visitors that I got on my website. This is the most important thing to know the no. of unique visitors & for this we have to know the Ip of the visitor on cookie based code.
    If am right please guide me to do so.
    Your suggestions are welcome.

    Regards,
    sligh

  2. #2
    Join Date
    Apr 2008
    Posts
    60

    Re: How this cookie count the pageviews?

    Page Views Counter Per Session/Cookies

    TO view how many times a page was viewed you have a page counter. But if same visitor reloads page it adds counts therefore better solution is to count per session.
    Here is TIP how to DO this
    Use it in an event Before Show (PAGE)
    And customize it to Your DB table ...

    Code:
    global $InfoDetiails;
        // Write your own code here.
    	global $REMOTE_ADDR;
    	$check_ip=$REMOTE_ADDR;
    	if(CCGetParam("news_id","") !="" && CCGetSession("UserIP","") != $check_ip)
    	{
    	global $DBddd;
        // Write your own code here.
    	$productSQL="UPDATE webshop_news SET news_viewed=news_viewed+1 WHERE news_id =".CCGetParam("news_id","");
        $DBddd->query($productSQL);
        $ip=$REMOTE_ADDR;
    	CCSetSession("UserIP", $ip);
    	}
    It can be modified to use Cookies instead of Sessions ...
    Just Replace as: CCGetCookie("UserIP","")
    CCSetCookie("UserIP", $ip);

Similar Threads

  1. Replies: 6
    Last Post: 25-02-2011, 10:40 AM
  2. Difference between pageviews and visits
    By Abigaill in forum Technology & Internet
    Replies: 3
    Last Post: 19-01-2011, 07:22 AM
  3. i need cookie grabber help on php
    By piroo in forum Software Development
    Replies: 1
    Last Post: 24-10-2010, 12:30 AM
  4. LG Cookie applications
    By B e B o in forum Portable Devices
    Replies: 2
    Last Post: 21-09-2009, 12:52 PM
  5. What is a Cookie?
    By Dharmavira in forum Technology & Internet
    Replies: 5
    Last Post: 18-02-2009, 12:33 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,716,795,328.08812 seconds with 16 queries