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

Comments

jcnventura’s picture

Version: 5.x-1.3 » 6.x-1.x-dev

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

preventingchaos’s picture

StatusFileSize
new1.97 KB

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

kbahey’s picture

Status: Active » Needs review

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

jcnventura’s picture

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

preventingchaos’s picture

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).

jcnventura’s picture

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.

preventingchaos’s picture

StatusFileSize
new1.16 KB

No, I haven't tested it.

jcnventura’s picture

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

Status: Fixed » Closed (fixed)

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