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

jcnventura - December 17, 2008 - 17:29
Version:5.x-1.3» 6.x-1.x-dev

This is actually a desirable feature not yet present in the new version.

#2

gcopenhaver - March 28, 2009 - 01:13

At a glance, it looks like this patch is all that's needed for this. Note: I didn't test the patch.

AttachmentSize
revenue_sharing_basic.module.patch 1.97 KB

#3

kbahey - March 28, 2009 - 01:15
Status:active» needs review

Setting it to code needs review so others can test it.

#4

jcnventura - March 29, 2009 - 00:30
Status:needs review» needs work

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

gcopenhaver - March 29, 2009 - 01:21

Something like this, just before the return statement in revenue_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

jcnventura - March 29, 2009 - 14:20

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

gcopenhaver - March 29, 2009 - 14:41

No, I haven't tested it.

AttachmentSize
revenue_sharing_basic.module.patch 1.16 KB

#8

jcnventura - March 31, 2009 - 15:36
Status:needs work» fixed

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

System Message - April 14, 2009 - 15:40
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.