Closed (fixed)
Project:
Advertisement
Version:
5.x-1.7
Component:
ad module
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
24 Apr 2009 at 17:30 UTC
Updated:
20 Jul 2009 at 22:10 UTC
Hi,
First of all, thanks for a great module!
I have two ads in the same ad group. One is displaying approximately twice as much as the other. I can confirm this by looking at the statistics within the past month/week/day/hour.
How do I give these two ads equal time?
Any help is appreciated. Thanks!
Comments
Comment #1
jeremy commentedIf you've not over ridden the code selecting advertisements, this should average out in the long run. Unfortunately in the 5.x-1.x tree there is no way to weight advertisements. If you upgrade to 6.x-2.x, however, then you can use the ad_weight_probability module.
For how long a period can you confirm one advertisement being displayed more than another? Does this problem affect other ads in other groups?
Comment #2
mherchelIt seems weird. I have two ad groups on my site (gatortailgating.com). No overwritten code.
For the past month, 'Ad A' in 'ad group 1' was displayed 1883 times, while 'Ad B' was displayed 590 times.
In 'Ad Group 2', I have three ads. 'Ad A' was displayed 1006 times. 'Ad B' was displayed 1170 times, and 'Ad C' was displayed 238 times.
Ideally, they should be getting very similar stats.
Is there anything else you need?
Thanks again,
Comment #3
mherchelbump on this one. Any ideas?
Comment #4
jeremy commentedSorry, there's not much I can offer you. It's using PHP's mt_rand() function to select an advertisement -- I've not had any problems with it balancing out over time. What OS are you using? What version of PHP? It seems your random number generator isn't working as well as it should. You may either have to hack the code to use something else to select an ad.
Comment #5
mherchelHmmm... I know I'm running PHP5 on CentOS. I'm using a drupal specific hosting company (hotdrupal.com). You don't know of a way to test the random number generator by chance (I know this probably isn't your expertise...)
Does the development version of the software under v5 have ad weighting? If so, I can set it to 50/50.
Anyway, I appreciate the responses and work on a great module.
Comment #6
mherchelFYI, I just changed the mt_rand() function to rand() just to see if it makes any difference. It seems to be working. I'll report back in a couple hours and let you know if that makes a difference (and if so, I'll notify my webhost)
Comment #7
mherchelNo change... issue is still happening
Comment #8
The Computer Audiophile commentedI have the exact same issue. I'm also using Hot Drupal as my host.
EDIT: I did a little more research and it looks like one ad in every ad group suffers from a very low number of views. I have three ad groups that I use and from 5 to 3 ads in each group. 1 ad in each group has the problem. When I delete and recreate the ad, a different ad starts having the low view issue.
This is really weird!
Comment #9
The Computer Audiophile commentedOK I've collected some data in an effort to help anyone who can help figure this one out. I have three ad positions on my site. Top, side, and bottom. So far here are the number of view for ads in each position.
Bottom ad
A - 1785
B - 642
C - 1855
Side ad
D - 1807
E - 1841
F - 436
Top ad
G - 988
H - 978
I - 952
J - 181
The ads are Flash, jpg, and gif. I am using JavaScript as my display type. If I delete ad J and recreate it as ad K, the number of views will increase to the normal levels. However, either ad G, H, or I will then take its place and receive substantially less views.
Please help.
Comment #10
HotDrupal.com commentedHmmm, I checked and the mt_rand function does *work* but the amount of "randomness" seems to be questionable. I think this is just a problem with PHP5. I noticed some people discussing this on some other (non Drupal) pages.
Steve
HotDrupal.com
Comment #11
The Computer Audiophile commentedThanks Steve.
Comment #12
mherchelSo, does that mean its a problem with PHP5 in general, or the PHP5 implementation on HotDrupal's servers?
If it's the former, the authors of the module need to find a workaround, because any reasonable webhost has PHP5.
If it's a problem with HotDrupal, it obviously needs to be addressed.
Thanks for the heads up, though.
Comment #13
HotDrupal.com commentedIt means my guess is the problem is with PHP5. Maybe when combined with opcode cache. If you're looking for equal numbers, why not just rotate the ads rather than random selection? That will get your numbers to be perfect.
Comment #14
mherchelThx for the quick reply.
How do I go about doing that (rotating ads)?
Comment #15
jeremy commentedI display ads with PHP5 and with an opcode cache, and the statistics are well balanced. Note that it can take a while for the statistics to average out -- if you're dealing with only hundreds or thousands of impressions then you will likely find some ads being displayed more often than others. But as you increase to tens of thousands of impressions and more then things should average out better.
I don't know what more to offer you here -- I can confirm that I've been using mt_rand() for >7 years now through many versions of PHP and many different opcode caches, and never once have I had a problem when averaged over a significant number of impressions. Closing issue, but feel free to re-open if you still want to dig into this further.