...

View Full Version : Allowing members to place no more than 2 Adsense like Ads on same page



student
01-07-2008, 06:20 AM
Hello,
We serve Adsense like Ads ( Free Clickbank Ads ) on the web pages of our members.
For your reference : http://cbtopsites.com/affiliates/cbadscode.php
We have mentioned on the site not to paste the code more than twice on the same page.

However, some members are pasting the Ads code too many times on the same page. ( some have pasted it more than 10 times )
That is causing problem to our server.

I have been visiting the web pages of members everyday to see if they are pasting too many ads, but it is a tedious process.

Is there any way to display the Ads only twice on a page
and display some other text on the extra Ads?

Hope you understood the problem.

Please suggest possible solutions.
Thank you

mlseim
01-07-2008, 02:41 PM
Show us one of your member's page that has more than two ads.

student
01-07-2008, 03:36 PM
Show us one of your member's page that has more than two ads.

I have blocked one such site using htaccess.
http://weightlossrecipes.blogspot.com/

You will find 403 forbidden message in the place of the Ads.
( he may remove the code anytime )

That person has pasted the code fourteen times on the same page of his blog.
Due to this problem, mysql slow queries log and cpu exceeded log are increasing.

mlse
01-07-2008, 04:16 PM
As a simple test, you could detect how many server requests for the contents of the iFrame(s) are being submitted by a single referer at "once" (in reality, time dither required) - too many requests per referer (i.e. more than two) = automatically block the domain and send a warning email.

If your clients really want to abuse the system they would then be able to do so by forging the referer, but I think the method I've suggested would probably fix 90% of your problems ... although I don't know how dedicated/evil your customers are!

Another, more robust but more complex solution would be to CURL in each and every one of the client's pages and parse them all for inclusion of your iFrame (more complex because you would need to parse the markup) - you would only need to do this periodically (and ideally randomly so as to be unpredictable) and deny access accordingly.

student
01-07-2008, 04:28 PM
Another, more robust but more complex solution would be to CURL in each and every one of the client's pages and parse them all for inclusion of your iFrame (more complex because you would need to parse the markup) - you would only need to do this periodically (and ideally randomly so as to be unpredictable) and deny access accordingly.

I am thinking of this method.

I know how to use PHP to parse html web pages and find if some code is present there or not.
I don't know about CURL.

Thank you for your suggestion.

mlse
01-07-2008, 04:32 PM
You're welcome!

CURL stands for Client URL ... very useful. Here's the documentation: http://uk3.php.net/manual/en/ref.curl.php

Mind you, in the first instance I would just knock up a quick script to record the number of requests per referer over a period of say 2 or 3 days, just to get an idea of the size of the problem. Indeed, this information should already be present in your server's logfiles. You might be able to manually manage the problem adequately with a simple solution like that rather than going for a more complex one.

student
01-07-2008, 05:26 PM
As a simple test, you could detect how many server requests for the contents of the iFrame(s) are being submitted by a single referer at "once" (in reality, time dither required) - too many requests per referer (i.e. more than two) = automatically block the domain and send a warning email.

Can you please tell me how to do this.
Thank you

mlse
01-07-2008, 05:32 PM
Firstly, look in your logfile - that info should be in there already - you will need to mine the data and your webhost may provide logfile analysis tools as part of your hosting package.

If that bears no fruit, then off the top of my head ...

Record $_SERVER[HTTP_REFERER] and time of request ... if you see a whole load of requests for your advert pages bunched together in a very small space of time (less than a second) from the same referer then there's a good chance that page has too many ads on it.

student
01-07-2008, 05:44 PM
Hello mlse,
Thank you very much
I will follow for your suggestions.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum