Adult Script Pro Community Forums

The forum is here for legacy reasons. No new posts will be created. User registration is disabled! If you have any questions, please email us or check https://www.adultscriptpro.com for more details!

You are not logged in.

#1 2012-03-07 07:16:13

THS
Member
Registered: 2012-02-02
Posts: 313
Website

[PARTIAL FIX] Index Robot counts in video views

I was trying to figure out why the views where so high when i knew traffic was low.  After going through the video_history table and seeing a pattern in the ip strings, I finally converted them to see it was the indexing spiders from google registering.  Is there a way to filter by IP or by agent to insure we are only counting valid human views?

Offline

#2 2012-03-07 08:10:24

symtab
Administrator
Registered: 2010-08-23
Posts: 7,501
Website

Re: [PARTIAL FIX] Index Robot counts in video views

Go to modules/video/components/view.php and find this line:

            $this->db->query("UPDATE #__video
                              SET total_views = total_views+1,
                                  view_date = '".$date."',
                                  view_time = ".time()."
                              WHERE video_id = ".$this->video_id." LIMIT 1");

replace with:

if (!VBrowser::get('is_robot')) {
            $this->db->query("UPDATE #__video
                              SET total_views = total_views+1,
                                  view_date = '".$date."',
                                  view_time = ".time()."
                              WHERE video_id = ".$this->video_id." LIMIT 1");
}

Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

#3 2012-03-07 16:42:12

flogger123
Member
Registered: 2012-01-26
Posts: 65

Re: [PARTIAL FIX] Index Robot counts in video views

So just add this line?

if (!VBrowser::get('is_robot')) {

I'll try to test this.


You're never a loser until you quit trying. vmware_happy.gif

Offline

#4 2012-03-07 16:50:11

Eri
Member
Registered: 2011-03-18
Posts: 977

Re: [PARTIAL FIX] Index Robot counts in video views

I think this must be added at next version will reduce SQL load.


Best Adult Affilitate Network:
ExoClick
Best Deals on Dedicated Servers - CDN
INXY

Offline

#5 2012-03-07 19:21:22

THS
Member
Registered: 2012-02-02
Posts: 313
Website

Re: [PARTIAL FIX] Index Robot counts in video views

Symtab,

Why would we not be wrapping all 3 queries right there?  That would reduce even more calls to the db.  For clariification for others:

if (!VBrowser::get('is_robot')) {
			$this->db->query("UPDATE #__video
			                  SET total_views = total_views+1,
			                      view_date = '".$date."',
			                      view_time = ".time()."
			                  WHERE video_id = ".$this->video_id." LIMIT 1");
			$this->db->query("UPDATE #__user_activity SET total_video_views = total_video_views+1 WHERE user_id = ".$owner_id." LIMIT 1");
			$this->db->query("INSERT INTO #__video_history
			                  SET video_id = ".$this->video_id.",
			                      user_id = ".$user_id.",
			                      ip = ".$ip.",
			                      view_date = '".$date."'");
			}

Offline

#6 2012-03-08 07:21:28

symtab
Administrator
Registered: 2010-08-23
Posts: 7,501
Website

Re: [PARTIAL FIX] Index Robot counts in video views

Ok. Will do this. I thaught that a busy site is better, but a faster site is even better :-)


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

#7 2012-03-13 02:07:58

THS
Member
Registered: 2012-02-02
Posts: 313
Website

Re: [PARTIAL FIX] Index Robot counts in video views

Symtab, this hasn't resolved the issue.  I thought it did as traffic initially dropped.  For some reason I had Google hit me 4826 times in the last 5 hours.  Although the busy site looks nice, it is impacting site performance (I would assume as that is an additional almost 15K queries to the DB for no reason).   Do you think there is something I missed?

Offline

#8 2012-03-13 07:59:48

symtab
Administrator
Registered: 2010-08-23
Posts: 7,501
Website

Re: [PARTIAL FIX] Index Robot counts in video views

Hmmm...so even after you added the !VBrowser::get('is_robot') line, the video views are still update for robots? If will check my browser class and robots config file.


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

#9 2012-03-13 09:35:04

Eri
Member
Registered: 2011-03-18
Posts: 977

Re: [PARTIAL FIX] Index Robot counts in video views

I had the same problem my database after 1 month was 2 GB so i have removed the


$this->db->query("INSERT INTO #__video_history
                              SET video_id = ".$this->video_id.",
                                  user_id = ".$user_id.",
                                  ip = ".$ip.",
                                  view_date = '".$date."'");
            }


and my database is 70MB smile


Best Adult Affilitate Network:
ExoClick
Best Deals on Dedicated Servers - CDN
INXY

Offline

#10 2012-03-13 12:01:31

symtab
Administrator
Registered: 2010-08-23
Posts: 7,501
Website

Re: [PARTIAL FIX] Index Robot counts in video views

I know that. The video history is removed from 1.0 (i changed it and with cron you can keep the daily statistics, and also have a small db).


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

#11 2012-03-13 13:34:52

THS
Member
Registered: 2012-02-02
Posts: 313
Website

Re: [PARTIAL FIX] Index Robot counts in video views

Ok, I will do the same.

Offline

#12 2012-03-20 12:23:18

symtab
Administrator
Registered: 2010-08-23
Posts: 7,501
Website

Re: [PARTIAL FIX] Index Robot counts in video views

@THS: even after the !VBrowser:get('is_robot') line, it still counts robots?


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

#13 2012-03-20 22:54:40

THS
Member
Registered: 2012-02-02
Posts: 313
Website

Re: [PARTIAL FIX] Index Robot counts in video views

Unfortunately, yes.  The long ip with the most daily hits comes back to google directly.

Offline

#14 2012-03-21 07:02:02

symtab
Administrator
Registered: 2010-08-23
Posts: 7,501
Website

Re: [PARTIAL FIX] Index Robot counts in video views

Hmm...in access_log can you see its a robot?


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

#15 2012-03-21 11:46:41

THS
Member
Registered: 2012-02-02
Posts: 313
Website

Re: [PARTIAL FIX] Index Robot counts in video views

Where is this one located?  My server logs are stuffed with so many requests its not possible to tell whats what anymore.  Apologies.

Offline

#16 2012-03-21 15:45:50

symtab
Administrator
Registered: 2010-08-23
Posts: 7,501
Website

Re: [PARTIAL FIX] Index Robot counts in video views

Its the apache access log. I'm worried that the script does not detect the robot, there must be a error somewhere sad I'll retest this before 1.0.


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

#17 2012-03-21 20:22:20

THS
Member
Registered: 2012-02-02
Posts: 313
Website

Re: [PARTIAL FIX] Index Robot counts in video views

I have a way of confirming this (I hope via the logs).  I will check shortly.

Offline

#18 2012-05-15 11:39:01

symtab
Administrator
Registered: 2010-08-23
Posts: 7,501
Website

Re: [PARTIAL FIX] Index Robot counts in video views

I was able to only add the views update on non robot visitors. I will mark this a partially fixed, and once i test this in the wild smile i will mark it as fixed.


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

#19 2012-05-15 11:46:40

Eri
Member
Registered: 2011-03-18
Posts: 977

Re: [PARTIAL FIX] Index Robot counts in video views

why should add view_date and view_time at query.
At frontage needs only view_time


Best Adult Affilitate Network:
ExoClick
Best Deals on Dedicated Servers - CDN
INXY

Offline

#20 2012-05-15 11:53:14

symtab
Administrator
Registered: 2010-08-23
Posts: 7,501
Website

Re: [PARTIAL FIX] Index Robot counts in video views

Its a design problem that remained from the first version of the script. I will check and find if view_date is used and if its not used. I will remove it.

UPDATE: removed from the video view component.


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

Board footer

Powered by FluxBB