1

My adsense account provided me with this piece of code:

<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>
  (adsbygoogle = window.adsbygoogle || []).push({
    google_ad_client: "ca-pub-1234434323432534",
    enable_page_level_ads: true
  });
</script>

To put it somewhere and display ads. The only problem is that I have spy colleagues and friends who are always on my tail on what websites I am working on. I'm fully aware that modifying the adsense code for the itention of tricking users or increasing earnings is ILLEGAL and I never attempted to do so as I have an adsense account for more than 7 years. But there are pub-id trackers/websites that display all the sites that a pub-id number appears on, therefore identifying different websites to the same owner(me).

The only think I wanted to attempt was to change the previous block of code to:

<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>
  (adsbygoogle = window.adsbygoogle || []).push({
    var pubid = "1234434323432534";
    google_ad_client: "ca-pub-"+ pubid,
    enable_page_level_ads: true
  });
</script>

So I just stored the pub id number to a variable and then appended it to ca-pub string.

I'm too scared to make the edit without first confirming with you guys. I'm sure you all understand this does not change the behavior of the ad.

Did anyone attempt to make this edit on their account for a long period of time?

Edit: Another idea would be putting the code in a .js file and call it on every page load. This is a viable option for my case, enough to keep most of the trackers out of my yard :)

bad_coder
  • 11,289
  • 20
  • 44
  • 72
Ryan
  • 159
  • 2
  • 14

0 Answers0