Revenue Sharing - Hide own ID when logged in
911 - February 23, 2007 - 17:03
| Project: | AdSense |
| Version: | 6.x-1.x-dev |
| Component: | Miscellaneous |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
It would be nice, if the Adsense ads wouldn't be shown with the Users own Adsense ID as long he is Logged in. This should prevent of clicking on your own Ads/Click Fraud. I just find the solution to hide the adsense Ads complete for logged in Users, but I dont want to hide the Ads complete.
Regards

#1
This is actually a desirable feature not yet present in the new version.
#2
At a glance, it looks like this patch is all that's needed for this. Note: I didn't test the patch.
#3
Setting it to code needs review so others can test it.
#4
Now that I am looking at it, wouldn't a simple compare between the current user's publisher ID and the value of $client do exactly the same, avoiding the need to mess with the referral code?
Also, it's a lot easier to understand the objective by comparing the publisher IDs... And more robust due to the fact that a user could try to create different logins, and use one as 'author' and another as 'ad clicker'. The uid check wouldn't catch those cases, but the publisher ID would..
João
#5
Something like this, just before the
returnstatement inrevenue_sharing_basic_choose_client($format)?global $user;
// Make sure the current user doesn't view ads with their own Publisher ID
if ($client == revenue_sharing_basic_get_profile_client_id($user->uid)) {
$client = $site_client;
}
It's definitely simpler than my earlier patch, and at least as effective. It still doesn't prevent click fraud entirely (I don't think that's possible, anyway).
#6
Yes, that would be the idea. It's a lot simpler and I am pretty sure it works, just by looking at it.
Have you tested it?
João
PS: Reading back my #4 comment, the 'ad clicker' user would have to be a bit dumb to actually provide it's real publisher ID. However, I can imagine situations where a group of friends share the same publisher ID or something similar, that checking for ID would not prevent. In other words, if the code is meant to prevent the current user's publisher ID from being shown, the check should be this one.
#7
No, I haven't tested it.
#8
Hi,
I have tested the above and it works, so I committed it to CVS. Please test the dev in a few hours.
João
#9
Automatically closed -- issue fixed for 2 weeks with no activity.