Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.4 RN Issues
Author Message
killing-hours
RavenNuke(tm) Development Team



Joined: Oct 01, 2010
Posts: 438
Location: Houston, Tx

PostPosted: Tue Nov 23, 2010 3:45 pm Reply with quote

Hey all-

This might already be covered somewhere... but I didn't find it with the search. I noticed today playing around with the ad module that my admin page views are counting as hits. Has anyone else had this issue?

I'm using the "Impressions" option and signed in as super admin. If I refresh the page... the impressions go up by one.

RN 2.4.01

_________________
Money is the measurement of time - Me
"You can all go to hell…I’m going to Texas" -Davy Crockett 
View user's profile Send private message
fkelly
Former Moderator in Good Standing



Joined: Aug 30, 2005
Posts: 3312
Location: near Albany NY

PostPosted: Tue Nov 23, 2010 6:10 pm Reply with quote

I did some of the work on the latest versions of Advertising. I don't use impressions to manage ads. I have never understood how they were supposed to work. I would guess that every time a search engine indexes your pages the impressions counts go up, but I haven't verified this. I just use a time based approach to running ads.
 
View user's profile Send private message Visit poster's website
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Fri Nov 26, 2010 10:37 am Reply with quote

While it won't help you in this situation, the following switch in rnconfig.php will keep the statistics from being updated:

$statisticsExcludeList = array('admin');

Now, you could try opening up mainfile.php and look for this function here:

function ads($position) {

Modify the global on the next line to include (adding $user and $statisticsExcludeList):

Code:


   global $prefix, $db, $admin, $sitename, $adminmail, $nukeurl, $user, $statisticsExcludeList;


Then a little further down, you could modify the following line of code:

Code:


   $db->sql_query('UPDATE '.$prefix.'_banner SET impmade=impmade+1 WHERE bid=\''.$bid.'\'');


to something like this:

Code:


   if ((in_array('admin', $statisticsExcludeList) && is_admin($admin)) || (is_user($user) && in_array($userinfo['username'], $statisticsExcludeList))) {
   } else {
      $db->sql_query('UPDATE '.$prefix.'_banner SET impmade=impmade+1 WHERE bid=\''.$bid.'\'');
   }


This is not tested, but seems like it would keep the impressions from going up, but this is just an example and its based upon that switch in rnconfig.php. If you are only concerned about excluding an admin, then you could ignore the global line change and the code would simple be:

Code:


   if (!is_admin($admin)) {
      $db->sql_query('UPDATE '.$prefix.'_banner SET impmade=impmade+1 WHERE bid=\''.$bid.'\'');
   }


Much simpler if you don't want/need to flexibility.

_________________
Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
fkelly







PostPosted: Fri Nov 26, 2010 11:34 am Reply with quote

The fix for admins might work (should work) but if search engines are also updating the hits (impressions) and there is no way to exclude them then the statistics are still meaningless. An advertiser would want to know how many "real" people are seeing his ad and having search engines in the mix just totally confounds that. When I look at IP tracking I see a LOT of search engine activity, probably more than real user activity at many times.

I would think that advertisers could see the number of click thrus they are getting from your RN site to their sites by looking at the statistics on their own sites. But many advertisers (at least the ones I work with) are running barebones and don't even know how to look at their own statistics.
 
montego







PostPosted: Fri Nov 26, 2010 11:40 am Reply with quote

fkelly, point very well taken. It would be nice to have a common "platform" for recognizing different classes of "users" and then being able to query that platform in the code for these types of things. I completely agree.

One thing though that is terribly missing still from the Advertising module is the means to use date-based start/expiration for ads... Wink I really hate having to manage my banner ads using a spreadsheet... I just keep forgetting to check it and end my time-based ads. Sad Any chance this capability is coming in a future RN release? Sure hope so.
 
fkelly







PostPosted: Fri Nov 26, 2010 12:28 pm Reply with quote

M. your points also well taken. As always. On the bike club site that I run I was lucky enough to cajole someone into becoming the advertising manager. We set up a joint gmail account to handle all advertising related email correspondence. He gets the checks from advertisers and keeps track of expiration dates and activating/ deactivating ads. You can also put notes in the extra info field under the advertising clients administration so we use that. It still would be better to automate the expiration, I agree.

All I really did in the previous releases of RN was to fix some outright SQL-related bugs -- hard to believe but some of the updates for parts of the module must NEVER have worked properly before those fixes, and separate out a bit the various types of banner ads (images, flash, and code) because the previous entry / admin process was total guesswork. The module could use a lot of functional enhancements such as automatically expiring ads which had run out and better, more flexible placement of banners without doing a lot of programming and better statistics on use. I personally don't think I will have time to take this on ... given other priorities.
 
killing-hours







PostPosted: Tue Nov 30, 2010 12:54 pm Reply with quote

Well holy moly.... didn't expect this kinda of conversation to come out of that question... but it's good to see. Wink

The "impressions" and "bots" mixing from my understanding will never work. In order to negate the bots hits vs. real hits... if I understand all this correctly, the admin (site developer) would have to keep a "current" list of search bots in the world otherwise it would appear to RN as a legitimate hit. (count that as next to impossible unless there is more that is over my head)

I agree with the timed version as it would make much more sense and be more realistically "fair" for the advertisers. An expiration date function doesn't "seem" like it'd be that hard to do (date created, date expires) with database tables/rows and a check on the page load that the expiration date has not been reached. (I do a very similar check in my modified project tracking module for archiving purposes)

I think it was you Montego that said in some other topic that you don't make much revenue on ads anyhow so I don't know how lucrative or beneficial it would be to put a whole lot of time and effort into the ad module.

Thanks for the info and codes guys.
 
fkelly







PostPosted: Tue Nov 30, 2010 3:36 pm Reply with quote

You'd be surprised the results you can get by posting. Smile

Actually in the table _banners there is a field named dateend. It is a datetime field. It would be relatively trivial to change the mainfile and advertising blocks to check against this field and not show the ad if the current date was greater than dateend. However, none of the advertising administration screens gives you any place to input an ending date ... in fact the field dateend is not referenced anywhere in Ravennuke except the database upgrade script and even there it is just used to add another field after it.

So, the work would involve re-do-jiggering the admin screens to allow an expiration date field to be entered then modifying the presentation screens to take its presence into account. It is a little more complicated because the only "limit" field in there right now is "purchased impressions" and, as we've said, even that is not meaningful given the way bots hit your systems so we'd have to do a bit of analysis of what approach to take.

I think advertising could be a significant revenue producer for some RN sites -- I generating $500 to $1000 a year on my bike club site which is enough to pay the hosting bills and then some and I'm hardly putting any effort into it at all. We'd need to improve management and positioning capabilities and you really do need someone to manage the ads separate from normal site administration (I think).
 
fkelly







PostPosted: Wed Dec 01, 2010 3:05 pm Reply with quote

Replying to myself:

Quote:
Actually in the table _banners there is a field named dateend. It is a datetime field. It would be relatively trivial to change the mainfile and advertising blocks to check against this field and not show the ad if the current date was greater than dateend.


Thinking further. The ads function of mainfile already checks to see if the number of impressions made exceeds the impression limit for an ad. (If the limit is set to 0 then the ad has unlimited impressions). If the impression limit is exceeded then the ad is deactivated ... there is an "active" field in the table and that gets set to 0. Rather than not displaying ads that are past the expiration date, the proper approach would be to add to this check and also deactivate ads that are past their expiration date. The ads function also emails the client to tell them that their ad is being deactivated so we'd want to add to this to also tell those clients whose ads have expired.

This part of the logic would be fairly simple but we'd still need to reprogram the admin screens to add the capability to put in an expiration date.

I guess this falls in the category of "notes to self" Smile

A simple hack would be to phpmyadmin a date into the dateend field an then hack the mainfile code to deactivate expired ads.
 
montego







PostPosted: Sat Dec 04, 2010 10:42 am Reply with quote

I also wonder if it should really be counting actual clicks rather than just impressions. Maybe impressions should be obsoleted and replaced by clicks? I would still want the timed approach as well... Wink
 
Palbin
Site Admin



Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania

PostPosted: Sat Dec 04, 2010 11:40 am Reply with quote

I agree that impression should be removed and just have clicks and time.

_________________
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan. 
View user's profile Send private message
fkelly







PostPosted: Sat Dec 04, 2010 1:16 pm Reply with quote

Mental block; but how would we measure clicks? Would we need some type of Javascript onclick event?

Also, not every ad has to have a link. Some of them are just for display purposes and impressions are all we could measure in those cases. Having clicks would be a good addition where applicable ... thinking of selling ads it would be cool to be able to say "advertiser x ran his ad on our site for 3 months and got N clicks through to his site".
 
Palbin







PostPosted: Sat Dec 04, 2010 2:06 pm Reply with quote

I would say that if there is no link to click they would have to rely on time. Unless someone can satisfactory address the problems with impressions that have been listed.

The plain image advertisements are already links to "your site" which are then redirected to the appropriate destination. This is how you would count those. I do not know how flash etc is handled.
 
Guardian2003
Site Admin



Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam

PostPosted: Sat Dec 04, 2010 6:03 pm Reply with quote

Regarding the 'dateend' field, I think thats a carry over from the old banners module but could be wrong.

Caveat - the following viewpoint is purely from a commercial perspective, the ethical/moral dilemma is quite another matter!

The issue of 'impressions' (page loads) is a thorny one in my opinion. I do not know of a single site that differentiates between a bot impression and a human impression and I would rather think that any potential advertiser would be of the same opinion. When all said and done, even a bot impression has the SEO potential to get your advert across (depending on the type of advert) so it is not necessarily a 'waste' of an impression.

Of course it would be more beneficial to an advertiser to pay 'per click' or for a 'human impression' but that also means the advertising premium has to increase surely?
If a client opts for 'per click', even though his ad might never get a single click, the client is reaping the reward (potentially) in SEO terms by having his/her link associated with your website.
 
View user's profile Send private message Send e-mail
fkelly







PostPosted: Sat Dec 04, 2010 7:04 pm Reply with quote

Quote:

The plain image advertisements are already links to "your site" which are then redirected to the appropriate destination


I don't think so Palbin. Even plain image advertisements are linked to a click url which is not on your own site. I mean they COULD be on your own site but usually they aren't. Advertisers, using their own site monitoring software, such as stats in CPANEL could see the number of links from your site, but I don't know how we would count them on our sites unless we did some onclick type of thingy.

Gaurdian, you know a lot more about SEO than I do. But then again I know a lot more than most of my potential advertisers do. They are just trying to figure out whether to make an investment in my site. Most of them run very minimal web sites if they run them at all. I suppose I could sell an inflated "impressions" number to them but I refuse to, the same ethical/moral dilemma comes into play.

But thanks for confirming that sites don't distinguish between bot impressions and human impressions. I wasn't sure.
 
spasticdonkey
RavenNuke(tm) Development Team



Joined: Dec 02, 2006
Posts: 1693
Location: Texas, USA

PostPosted: Sat Dec 04, 2010 7:48 pm Reply with quote

aren't click's tracked already with op=ad_click ?

and since ad links are passed thru
index.php?op=ad_click&bid=1

I'm not sure how much SEO value they hold for advertising clients. I could be wrong but I don't think google will see the link to the clients' site; as it just opens a new browser window and dynamically sets the header to the link url.

Although I say this without alot of experience with the advertising module outside of basic image/link ads.
 
View user's profile Send private message Visit poster's website
Palbin







PostPosted: Sat Dec 04, 2010 11:17 pm Reply with quote

fkelly wrote:
Quote:

The plain image advertisements are already links to "your site" which are then redirected to the appropriate destination


I don't think so Palbin. Even plain image advertisements are linked to a click url which is not on your own site. I mean they COULD be on your own site but usually they aren't. Advertisers, using their own site monitoring software, such as stats in CPANEL could see the number of links from your site, but I don't know how we would count them on our sites unless we did some onclick type of thingy.


spasticdonkey wrote:
aren't click's tracked already with op=ad_click ?

and since ad links are passed thru
index.php?op=ad_click&bid=1
 
fkelly







PostPosted: Sun Dec 05, 2010 8:24 am Reply with quote

Good point spasticdonkey. However, not that clicks are only relevant to image type ads. For code ads or Flash ads clicks are not collected, updated or displayed, they are treated as N/A. The update to clicks happens in your root/index.php by the way based on op being set to ad_click in the mainfile ads() function. We also still have an extraneous freeresult in that index.php code.

For what it's worth, on my bike club site I have three image ads. The impressions versus clicks figures for them are interesting. They are 91772 and 184, 511645 and 822, and 14248 and 110 (the ads ran for different time periods). So there is a several hundred to one ratio in terms of impressions versus clicks. And I think advertisers would be more interested in real clicks.

I use very few pure image ads. You can embed a link in a code ad and that's what I usually do. My users, being old like me, often need the additional help of "click on the image above to go to the site" to know what to do.

If we are revising this we probably should find a way to track clicks for code ads too and even Flash.
 
spasticdonkey







PostPosted: Sun Dec 05, 2010 2:37 pm Reply with quote

I see what you are saying. I suppose if you know the id of your ad, html or even flash ads could be authored with links to enable tracking

<a href="index.php?op=ad_click&bid=1">click for info</a>

instead of a direct link to their site

however, constructing a pay-per-click payment system could get quite complex. As someone who has advertised on Overture (now yahoo) and Google, the pay-per-click system makes the most sense; but there is alot to consider before you could implement that within the current system. How would you bill customers for this? Yahoo/Google set "daily budgets" for advertisers (which you magically seem to reach every day), I think the RN system would need a similar setup, except maybe monthly budget. Then you get into "bidding" on pay-per-click prices for top or more frequent placement, which would spawn 100 more things you have to consider, lol.

For all the work involved, the time based approach seems to look better and better. Unless you are getting 25,000+ hits a day on your site, it will probably generate more reliable income as well.
 
fkelly







PostPosted: Sun Dec 05, 2010 3:37 pm Reply with quote

I wasn't thinking necessarily of a pay per click system. I agree that could be too complicated. But, being able to tell advertisers how many clicks we've generated is a lot more relevant than telling them the number of impressions, especially considering the effect of Search Engines on inflating the impressions count. There is a fair amount of work to do to advertising/admin/index.php to make this happen ... then some relatively minor modifications to /root/index.php.
 
PHrEEkie
Subject Matter Expert



Joined: Feb 23, 2004
Posts: 358

PostPosted: Sun Dec 05, 2010 5:41 pm Reply with quote

Sorry if this is out of place, I haven't really absorbed this whole thread due to unfamiliarity with the ad module...

but if you're worried about bots and engines trumping up the impressions count, there's already code built into the Stats engine that does a pretty good job of sorting out bots/spiders/engines from everyone else. You could reduce false impressions to an extremely realistic number with a few mins of work.

- Keith

_________________
PHP - Breaking your legacy scripts one build at a time. 
View user's profile Send private message
fkelly







PostPosted: Sun Dec 05, 2010 8:28 pm Reply with quote

Thanks Keith. Looking further the key code that you are referring to is in /includes/counter.php. It does this:

Code:
   if ((ereg('Navigator', $_SERVER['HTTP_USER_AGENT'])) || (ereg('Netscape', $_SERVER['HTTP_USER_AGENT']))) $browser = 'Netscape';

   elseif (ereg('Firefox', $_SERVER['HTTP_USER_AGENT'])) $browser = 'FireFox';
   elseif (ereg('MSIE', $_SERVER['HTTP_USER_AGENT'])) $browser = 'MSIE';
   elseif (ereg('Lynx', $_SERVER['HTTP_USER_AGENT'])) $browser = 'Lynx';
   elseif (ereg('Opera', $_SERVER['HTTP_USER_AGENT'])) $browser = 'Opera';
   elseif (ereg('WebTV', $_SERVER['HTTP_USER_AGENT'])) $browser = 'WebTV';
   elseif (ereg('Konqueror', $_SERVER['HTTP_USER_AGENT'])) $browser = 'Konqueror';
   elseif (ereg('Chrome', $_SERVER['HTTP_USER_AGENT'])) $browser = 'Chrome';
   elseif ((ereg('Safari', $_SERVER['HTTP_USER_AGENT'])) && (!ereg('Chrome', $_SERVER['HTTP_USER_AGENT']))) $browser = 'Safari';
   elseif ((eregi('bot', $_SERVER['HTTP_USER_AGENT'])) || (ereg('Google', $_SERVER['HTTP_USER_AGENT'])) || (ereg('Slurp', $_SERVER['HTTP_USER_AGENT'])) || (ereg('Scooter', $_SERVER['HTTP_USER_AGENT'])) || (eregi('Spider', $_SERVER['HTTP_USER_AGENT'])) || (eregi('Infoseek', $_SERVER['HTTP_USER_AGENT']))) $browser = 'Bot';
   else $browser = 'Other';


Then when statistics are presented in the statistics module it simply finds the records that are browser==bot. Would this be a reliable way to exclude bots from the impressions count? Tracked IP's doesn't seem to provide enough information to make a judgment on this. Does Google, for instance, always use "Google" as a user agent?
 
PHrEEkie







PostPosted: Sun Dec 05, 2010 10:48 pm Reply with quote

I would think it's reliable from the standpoint of most search engines, bots, etc., do not try to hide the fact that they are a bot. They do that with a unique user agent that generally cannot be mistaken for a browser.

I think that the code you provided is a really good starting point, but I'd bet a search of some communities that specialize in this sort of things would provide you with even better results. The code you provided above is just another one of those "chunks" of code that should be turned into a function, and then be available to be called upon whenever needed. Or it can be run from mainfile, and the variable assigned brought in as global where needed. I would vote former, as more globals to keep track of wouldn't be that good of a solution.

- Keith
 
Guardian2003







PostPosted: Mon Dec 06, 2010 3:37 am Reply with quote

In case it is of any interest, I use this old but simple function when determining whether or no to display certain data to some search engines. I haveremoved a lot of spiders from the array for clarity.
Code:


function is_spider(){
  $spiders = array(
    'Googlebot', 'Openbot', 'Yahoo', 'Slurp', 'msnbot',
    'ia_archiver', 'Lycos', 'Scooter', 'AltaVista', 'Teoma', 'Gigabot',
    'Googlebot-Mobile'
    );
// Loop through each spider and check if it appears in
// the User Agent 
   foreach ($spiders as $spider) 
     {
       if (eregi($spider, $_SERVER['HTTP_USER_AGENT']))
        { return TRUE; }
      }
      return FALSE;
}
 
hicuxunicorniobestbuildpc
The Mouse Is Extension Of Arm



Joined: Aug 13, 2009
Posts: 1123

PostPosted: Mon Dec 06, 2010 6:52 am Reply with quote

This one looks nice Guardian. Where should I put this code?
 
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.4 RN Issues

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©