Question

Can you use Adsense behind a DigitalOcean Load Balancer?

Posted June 25, 2020 641 views
Load BalancingDigitalOcean Managed Load Balancers

I’d like to know if the health checks from a DigitalOcean Load Balancer might cause Adsense to think I’m inflating my page views.

I assume the answer is no, but I just want to be 100% certain before I place ads on my website because I don’t want to get banned from Adsense.

I only ask because Load Balancer health checks appear as page views in my Discourse analytics.

Thanks in advance!
Francis

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

Hey @francis1 good question.

Based on everything I know about Load Balancers and AdSense, I would say:

It is fine to use AdSense on a site that is behind a DO Load Balancer, LB health checks will have no affect on AdSense.

Load Balancer health checks are just requesting a URI and confirming that the HTTP response code is 200.

AdSense doesn’t even start running until:

  1. A Browser makes a request to a URI
  2. The browser renders the HTML of the page
  3. The browser downloads all included JS and CSS referenced on the page, including AdSense JS
  4. The browser executes the AdSense JS, resulting in more requests to Google servers.

Load Balancers never even get past step 1, so the health checks are completely invisible to AdSense.

Also, cool to hear you managed to set up load balanced Discourse, if you have the interest, you should do a write-up of how you set that up and share it with us!

  • Thanks very much for your help.

    Writing an article for DigitalOcean (DO) would be really cool, it was an interesting project because you have to modify Discourse slightly and use the proxy protocol feature available in DO Load Balancers.

    Where would I go to submit an article?

    Thanks,
    Francis

Submit an Answer