Forum Moderators: martinibuster

Message Too Old, No Replies

HTTP to HTTPS

         

keyplyr

1:10 pm on Mar 20, 2016 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



When switching site-wide from HTTP to HTTPS is there any setting changes needed in Adsense?

netmeg

2:39 pm on Mar 20, 2016 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If you're using async ads, there's a little piece of javascript that may need to be changed, depending on when you generated your code. It only has to show up once on a page (although it's included in the code of every ad unit, so if you are serving more than one ad per page, you can remove it from all but the first loading ad unit) That needs to be changed.

<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>


If you have one that says "http://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js" then you need to remove the http: part.

If you generate code nowadays, they automatically remove that.

keyplyr

5:19 pm on Mar 20, 2016 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Did you intend to say "remove the http:// part?"

Yes I have that old code, so that's helpful, thanks.

freitasm

6:54 pm on Mar 20, 2016 (gmt 0)

10+ Year Member Top Contributors Of The Month



No, he meant what he wrote.

The protocol part (http:, https:) is optional. If you leave at //www.example.com then the browser client will load the resource using the current protocol.

Take an image src="//www.example.com/image.gif". If you are on http://www.example.com then it will load as http://www.example.com/image.gif but if you are on https://www.example.com then it will load as https://www.example.com/image.gif. Automagically.

netmeg

9:06 pm on Mar 20, 2016 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Right.

No, he meant what he wrote.


Except for the "he" part. He's a she. Automagically.

freitasm

9:42 pm on Mar 20, 2016 (gmt 0)

10+ Year Member Top Contributors Of The Month



I am sorry for this. Will take note for the next time ;)

keyplyr

6:46 am on Mar 21, 2016 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Seems to work either way

netmeg

4:39 pm on Mar 21, 2016 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Well no, it'll break https if that script isn't served on https. You might not tell with all browsers, but Chrome will report it.

keyplyr

9:32 pm on Mar 21, 2016 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



What I was referring to is what I said above... www.example.com & //www.example.com and yes, using Chrome.