Category Archives: adsense

Adsense and Kubernetes

I'm in process of upgrading infrastructure, and I'm worried about violating adsense terms and getting banned.

Here's what I'm doing:

  1. Monolithic LAMP servers to HA with Kubernetes.
  2. Databases moved off the server onto a PaaS.
  3. NFS service if file storage is needed outside version control.
  4. Static assets like images, CSS, and JS moved onto a CDN.
  5. Blocking site entirely if user does not have javascript enabled.
  6. Only serving bandwidth expensive assets if user has caching enabled:

Here's what I think could go wrong

  1. Site goes down
  2. HTML/CSS changes, causing term violations
  3. Same content, different urls
  4. Fake traffic with load testing

Here's how I want to prevent it:

  1. Monitoring
  2. Implement code changes first on old servers. Save pages, then run file compare on new servers
  3. Analytics to monitor domains
  4. Disable adsense when load testing.

Should I be looking at anything else?

Can Content Security Policy be made compatible with Google Analytics and AdSense?

Does anyone know how to get CSP, even with the default-src wildcard, to work so a modern Analytics script sends website per-page data (not just home page data) to the site owner's account and so AdSense ads appear?

I tried many variations of CSP for my website, including that proposed in <>'s .htaccess file, but all blocked Google Analytics from producing per-page data (except for the home page) and Google AdSense from accepting ads on any page.

Google's machines did not see the Analytics script although Google's humans always saw it in my website source code. Even setting CSP default-src to the asterisk wildcard failed.

Asking at a Google forum and a non-Google forum got nothing that worked except that people said the problem was with my CSP and I received one email that said that I should comment CSP out completely. That last worked. Commenting out should be no better than default-src wildcard but commenting out is the only way I got ads and inside-the-website data.

No Stack Overflow thread is about CSP and AdSense. When I proposed that H5BP tell users about this in their model <.htaccess>, their respondent said it works for him and referred me to you.

As a check on advice, is anyone seeing that page-specific data in their own Google Analytics account and seeing AdSense ads while running .htaccess CSP?

Angularjs with GoogleBots using

i am having many problems to get adsense in my web. I am trying to configure my virtualhost in order to use when a bot is analyzing my web, but google bot (using search console) returns "Not accesible", and i don't find the solution.

This is the important code of my virtualHost (apache2):

    RequestHeader set X-Prerender-Token "UFpQY3t1v0ffATlsY3IX"

RewriteEngine On

RewriteCond %{HTTP_USER_AGENT} bot|baiduspider|facebookexternalhit|twitterbot|rogerbot|linkedinbot|embedly|quora\ link\ preview|showyoubot|outbrain|pinterest [NC,OR]

RewriteCond %{QUERY_STRING} _escaped_fragment_

RewriteRule ^(?!.*?(\.js|\.css|\.xml|\.less|\.png|\.jpg|\.jpeg|\.gif|\.pdf|\.doc|\.txt|\.ico|\.rss|\.zip|\.mp3|\.rar|\.exe|\.wmv|\.doc|\.avi|\.ppt|\.mpg|\.mpeg|\.tif|\.wav|\.mov|\.psd|\.ai|\.xls|\.mp4|\.m4a|\.swf|\.dat|\.dmg|\.iso|\.flv|\.m4v|\.torrent|\.ttf|\.woff))(.*)$2 [P,L]

RewriteRule ^ index.html [L]

In my mainApp.js:


And in my index.html:

<meta name="fragment" content="!">

Does anyone know what am i doing wrong?? i have been testing changes for days and i don't get google bots load the web from prerender.

Thanks a lot !!!

Adding a trailing slash on wordpress

I want to add a trailing slash in my wordpress blog. It's in the generic URL form and I would like to keep it that way.

I've searched a lot before posting but didn't find an example to this specific case.
This is a production site so I can't afford to experiment with regex.

The reason behind it is to overcome strange Adsense glitch not showing ads on random pages. Adding anything at the end of the url make the ads to show again. This is not "page content" issue if anyone concerned...

Thanks, Vadim