Caused by a Mixed Content error? Google Adsense impressions and PV numbers dropped sharply

2019/7/6

Status

Just before I thought that the profits started to come out smoothly, the profit of Google Adsense became 0 yen one day.

Looking at the Google Adsense report, the number of ad impressions and the number of PVs decreased to less than 1/10 like this.

Image of changes in the number of PVs and impressions of Adsense ads

Google Analytics maintained the same number of users as before, so I suspect it's an Adsense bug or a misconfiguration.

I've been updating the theme and editing additional CSS recently, so I guess the cause is around here.

Search for the cause

There are multiple error messages on the site

When I view my blog on Google chrome, I get the following error message in the upper right corner

This page is trying to load a script from an unauthorized source

When I forced it to load, google adsense came to be displayed properly.The number of impressions dropped sharply probably because the person who visited the blog didn't bother to approve it.

Also, when I tried "right-clicking"-> "verifying" my blog, there was an error message that seems to be derived from the same problem.If you extract something that looks like a keyword,

・ Mixed Content: The page at'https: //www.~~/' was loaded over HTTPS, but requested an insecure script

・'Https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js'. This request has been blocked; the content must be served over HTTPS.

It seems that the Google AdSense script is blocked because it is considered to have a mixture of HTTP and HTTPS content.

In the wordpress theme I was using, I was able to set Google Adsense just by pasting the Adsense ID in the specified location.Since this was abolished when the parent theme or child theme was updated, it seems that it was mixed content → Adsense was blocked.

The solution

If you refer to the help of Google Adsense, it seems that it is quick to create and replace a new ad code.

SSL-enabled AdSense ad code

Newly created automatic ad codeIf I paste it properly in the meantime, the error disappears and it is now displayed.