I'm trying to implement total unique page view count to my webpage, Any one knows that how to do that just give me an idea to implement using CakePHP 3.0
Asked
Active
Viewed 435 times
1
-
ip based filter – Bilal Ahmed Apr 04 '17 at 06:31
-
When a user comes to your website chceck if he has your cookie if not store it. Count it and if the cookie was found ignore it – M A SIDDIQUI Apr 04 '17 at 06:35
-
You can use IP, $this->request->clientIp() this is the method to get client IP. – Mr. J Apr 05 '17 at 05:34
2 Answers
1
create table for page view
ex:
CREATE TABLE `pageview` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`page` text NOT NULL,
`userip` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
then store visitor ip address into your table using
// gets the user IP Address
$userip=$_SERVER['REMOTE_ADDR'];

Ashok
- 184
- 2
- 14
-
Thank you, I think this is best method to get count unique page view count. – Kumar May 31 '17 at 06:11
0
You can do it by checking both COOKIE and IP
There is a Plugins written by CakeManager which give those facility with proper functionality

tarikul05
- 1,843
- 1
- 16
- 24