Home » Documentation » CAOS » Troubleshooting

CAOS — Troubleshooting

Analytics.js/gtag.js doesn’t exist or hasn’t been updated for more than two days.

CAOS throws this notice if analytics.js or gtag.js (depending on your settings) does not exist, or hasn’t been updated for a while. First off, check if the file exists. If not, trigger a manual update from within CAOS’ settings screen. If it does exist, then it means that the scheduled update wasn’t able to run. This usually happens on low traffic sites (< 100 visitors/daily), because WP cron wasn’t able to properly finish its schedule.
Is your site a low traffic site? There’s no shame in that :-), but it probably means that not just CAOS’ scheduled jobs, but many of WordPress cronjobs aren’t able to run properly. To work around this, you need to setup a so called real cronjob.
For this you’ll need SSH access to your server. If you don’t have this, contact your hosting provider and ask them to replace WordPress’ pseudo cron with a real cronjob.
First you need to disable WordPress’ pseudo cron. To do this go to wp-config.php (located in the root of your WordPress install and add the following line right before the line that reads /* That's all, stop editing! Happy blogging.*/:

define('DISABLE_WP_CRON', true);

Then, open up a terminal, login to your server and run crontab- e. This will open up your cron editor. Then add the following:

*/5 * * * * wget -q -O - https://yourdomain.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1

That’s it. From now on, WordPress’ cron will run every 5 minutes.