Forum Moderators: martinibuster

Message Too Old, No Replies

Drop in Analytics pageviews, not in AdSense pageviews

I use the old Analytics code, along with local-hosted JS file

         

guarriman3

1:14 pm on Dec 18, 2021 (gmt 0)

10+ Year Member Top Contributors Of The Month



Hi,

Yesterday Friday 17, I got a week-over-week 23% drop in the figure of the pageviews in Analytics, but just a week-over-week 2% drop in the figure of the pageviews in AdSense.

The Analytics drop started yesterday Friday 17 at 13:00 (US Central Standard Time, UTC-6). I do not have AdSense hourly figures.

I'm afraid that the current Analytics code is the old one, and I use a local-hosted JS file.

<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://example.com/js/analytics.js','ga');
ga('create', 'UA-1234567-1', 'auto');
ga('send', 'pageview');
</script>


On the 'Tracking code' of the Google Analytics webpages, I see that Google suggests this new code:
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-1234567-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-1234567-1');
</script>


I do not remember why I left the old code (maybe to speed up the pages through the local-hosted JS file), but now I'm not sure:
- whether I should update the Analytics code or not
- whether this old code is the origin of the drop in Analytics, or it was caused by the Ranking Algorithm Tremors of the last hours (https://www.webmasterworld.com/google/5053055-3-50.htm#msg5053948).

Thank you very much.

not2easy

1:39 pm on Dec 18, 2021 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



The first place I would check is your AdSense cookie permissions. There were several discussions around here in mid to late November about Analytics accuracy and it seems that cookie permissions fixed the confusion.

Your case may or may not be the same but it could help to check through a few of those threads:

[webmasterworld.com...]
[webmasterworld.com...]

guarriman3

9:37 am on Dec 22, 2021 (gmt 0)

10+ Year Member Top Contributors Of The Month



Hi @not2easy, thank you for your nice answer.

Yes, I had been thinking about it for weeks, but I had not linked both issues. As I questioned on this another thread (https://www.webmasterworld.com/google_adsense/5053969.htm), my cookie permissions are managed by a home-made system made with PHP+JavaScript.

According to @NickMNS in one of the threads you link (https://www.webmasterworld.com/google_adsense/5051499.htm), the new AdSense cookie consent mechanism seems to fix some issues.

So I will use the Christmas vacations as an opportunity to implement the system proposed by Google (within the 'Privacy & messaging' section of Adsense).

Regards.

NickMNS

4:43 pm on Dec 22, 2021 (gmt 0)

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



@guarriman3
Adding the Adsense cookie consent banner has fixed a coverage issue, I'm not sure if it will fix your issue. But it is certainly worth trying.

For the record
According to @NickMNS

It wasn't me that discovered this it was Niresh12495.