Is it OK to copy Google's AdSense JavaScript code to avoid the mixed content warnings in browsers?

StackOverflow https://stackoverflow.com/questions/4210832

  •  25-09-2019
  •  | 
  •  

Question

You may know that Google AdSense doesn't support HTTPS.

There is a question on Stack Overflow about it.

I went to the URL that Google made me include, and copied and pasted the code between script tags and it worked.

My question is - is this too flaky, because they might change their JavaScript file at any time?

Or should I request the file with PHP, and then make a local copy of it on my server, which I can access via HTTPS?

Thanks

Update

I built a PHP proxy to serve the ads and it works - I'm just going to check if what I'm doing won't annoy Google. :)

Thanks for the answers.

Was it helpful?

Solution

Aside from the legal uses of Google's code, Google probably updates their stuff on a fairly regular basis. I would think it would be best to use PHP like you said. If they (Google) offer that as an option, last time I looked though, they only offered the ad scripts in JavaScript, maybe that's changed. That might allow for HTTPS.

Edit: Just looked at the ToS. Found this: "You will not modify, adapt, translate, prepare derivative works from, decompile, reverse engineer, disassemble or otherwise attempt to derive source code from any Google services, software, or documentation, or create or attempt to create a substitute or similar service or product through use of or access to the Program or proprietary information related thereto." I think what you're thinking of would require some that. Looks like Google doesn't want you to. Sorry I couldn't be more helpful.

OTHER TIPS

I don't think google will want to compromise the estimated $7.7 billion dollars per second they are generating through Adsense. Knowing google, their thought process may be as follows:

1 - Most people directly link to the source URL. (Revenue = $7.3 billion p/s)

2 - Some people don't. They copy the source and put it between their script tags. (Revenue = $0.4 billion p/s).

GoogleBot7: Login Successful. Logged in as Sergey.
GoogleBot7: Determine -now -truth -of -whatiamthinking
/* begin GoogleBot 7 Inference Mastication Profitization Conundrum Decisionism */

GoogleBot7: Thank you GoogleBot 1, we must maintain backward compatibility in
            case lazy site owners have done the copy/paste thingie.
            $0.4 billion p/s is required for Sergey MARS Palace I.

/* end GoogleBot 7 Inference Mastication Profitization Conundrum Decisionism */

GoogleBot7: > Anything else, Sergey?
GoogleBot7: exit

:)

Apart from the technical reasons, which you already outlined (yes, they change their code frequently) you should reread the Adsense agreement. I read it a lot of time ago but I bet that it forbid copying their code.

It would most likely work, until they come out with a new version of their code, but I'm fairly sure this goes against their ToS in some way.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top