Although traffic increase can differ per site for different reasons, e.g. a tech blog might receive more visitors with ad blockers activated compared to a fashion blog, there could be several factors at play here. This article lists several causes with ideas on how to identify them.
IMPORTANT: Did you flush your caches?
In lots of cases I've seen caching and/or optimization plugins are the culprit. Before waisting your time digging through this troubleshooting guide, please make sure that you've flushed any and all caches from JS/CSS optimization/minification and page caching plugins.
If that doesn't help, check if your server has any PHP (e.g. Varnish) and/or database (e.g. Redis) caching mechanisms activated. Either could be preventing CAOS and/or CAOS Pro's code from executing properly. When in doubt, contact your hosting provider.
1. CAOS isn't correctly loaded in the Frontend.
Head to CAOS' settings screen inside your WordPress admin area and take note of the following things:
At the top of the screen there's a permanent notice looking like this:
Take note of the two filenames in bold. The first is the original filename, and the 2nd is the obfuscated (renamed) filename.
Now head into your site's frontend and open up Developer Tools by pressing F12 and click on the Network tab. Now reload the page (any post/page on your site will do) and you should see requests being listed inside the Network tab.
Each browser has a different way of approaching this, but all developer tools allow you to search through the list of requests. Either by filter or by search (CTRL + F on Windows, CMD + F on Mac).
Do a search for the obfuscated filename and see if the filename pops up.
If it exists, CAOS' files are properly loaded and you can continue to the next chapter. If the file isn't loaded, then you've found the culprit.
If the file isn't loaded, make sure any files generated by CAOS are excluded from any JS minification/combination plugins you might be using. This works differently in every plugin, but usually you can use wildcards symbols to exclude files stored in CAOS' cache folder, e.g. *caos*. Make sure to flush the plugin's caches after excluding the files.
If it's still not loaded, then your theme must not be implementing wp_head() and/or wp_footer() (depending on the tracking code position you chose) properly.
Set Tracking code position to Add manually and add the tracking code to your theme manually (preferably using a Child Theme).
2. Super Stealth API isn't loaded in the Frontend.
Head to CAOS' settings screen inside your WordPress admin area and take note of the following settings and its values:
- Settings > Optimize Google Analytics > Extensions > Request Handling
- Settings > Optimize Google Analytics > Extensions > Stealth Mode
Obviously, Stealth Mode should be checked. Request Handling can be set to anything, but Fast (Super Stealth API) is recommended.
If all that checks out, head to your site's frontend, open up Developer Tools (chapter 1 contains steps on how to this) and do a search for super-stealth.
- If Request Handling is set to Default (WordPress API), an URL containing /caos/v1/proxy/stealth should appear.
- If Request Handling is set to Fast (Super Stealth API), an URL containing stealth.php should appear.
If none of these appear, you've found your culprit. If it does, head on to next chapter.
3. Requests to Super Stealth API fail.
Status Code 403 - Forbidden or 405 - Method Not Allowed
Note: when requests are forbidden by the server, they usually don't show up in the network requests waterfall. They usually appear in the console and look like this:
- Contact your hosting provider and ask them to whitelist the file for execution,
- Change the Cache directory for <filename> to a different value, like /cache/caos/ or just /caos/.
- Note that /caos/ might not work on all hosting providers, because some hosts don't allow the creation of folders by plugins outside the uploads folder.
- Change Request Handling to Default (WordPress API) to make Super Stealth Upgrade use WordPress' built-in API, which is (much!) slower than the Super Stealth API, but usually works.
Status Code 404 - Not Found
When Request Handling is set to Default (WordPress API.) This means that the CAOS API endpoint can't be found.
This is usually caused by other (security) plugins blocking the WordPress API. You should never block the WordPress API entirely, because WordPress (and other plugins) use a lot of its functionality.
If you're sure you want to keep blocking the WordPress API, consider setting Plugin Handling to Super Stealth Upgrade.
When Request Handling is set to Fast (Super Stealth API), this usually means that something went wrong creating the stealth.php file.
Here's how to fix it:
- Under extension settings, disable Stealth Mode and click Save & Update.
- Then, enable Stealth Mode again and click Save & Update.
Check again if the file is created. If it isn't, please contact your hosting provider and ask if your folder permissions for ( Settings > Optimize Analytics > Advanced Settings) Cache directory for <filename> are set properly.
Some servers block PHP execution in certain folders (e.g. wp-content/uploads) and throw a 404 status code. Although the status code is confusing (and it should be a 405 Not Allowed status code) this can be easily fixed by changing CAOS' cache directory in Settings > Optimize Google Analytics > Advanced Settings.
Status Code 50x - Internal Server Error(s)
Any status code higher than 500 indicate that something went wrong on the server while executing the request.
Head into your server PHP (Error) logs, extract any information that might be relevant and send it to me using the contact form.