Troubleshooting
I loaded a single page in my browser, refreshed 4Analytics report and the page has not been counted
Please check that you are not logged-in when viewing the page. If using the default measurement rule, logged-in users are automatically excluded.
I loaded a single page in my browser, refreshed 4Analytics report and the page has not been counted
Now if you are not logged-in, then first rest assured that all pages are counted as they should. But maybe not when you think they are.
To be able to count all visits, and also to accurately record how much time a visitor spend on a given page, 4Analytics uses the browser Beacon API
.
Using the Beacon API:
- ensures a visit details is sent to 4Analytics even if the visitor closes the browser tab or its browser entirely
- ensures we know to the second how long they stayed on that page
- but also: the data is only sent after the visitor has left the page
So to view the report update, you need to either click a link to go to another page, or switch to another tab in your browser for instance
I cannot save some or any settings, I get a Cannot communicate with server Unexpected token < in JSON error message (JoomlaTools)
As of 2023-07-200, websites using any of the JoomlaTools extensions such as Docman or Logman will experience the same issues as described above for WidgetKit.
These extensions include JoomlaTools Koowa
framework, usually as a Joomla system plugin. This framework unfortunately and incorrectly intercepts 4Analytics communication with your server, but fails with a PHP error in doing so and therefore prevents 4Analytics from operating.
JoomlaTools is aware of the problem but no fixed version has been release to our knowledge yet. We invite you to contact JoomlaTools directly to obtain a fixed version, or disable or uninstall these extensions when no other options exist.
Until JoomlaTools releases a fixed version, you can:
- disable that extension if not actively using it
or
- apply the following bug fix:
1 - Open the file /libraries/joomlatools/library/dispatcher/request/abstract.php
at around line 211
, you'll see:
$this->data->add($data);
2 - Replace this section so that it looks like this:
// Weeblr 2023-07-20
//$this->data->add($data);
$saferData = !is_array($data)
? [$data]
: $data;
$this->data->add($saferData);
// Weeblr 2023-07-20
3 - After saving the modified file, 4Analytics should work normally again
I cannot save some or any settings, I get a Cannot communicate with server Unexpected token < in JSON error message
As of 2023-02-27, there is a bug in the YooTheme WidgetKit component that breaks 4Analytics (and potentially all extensions from us and others) communication with your Joomla site.
Widgetkit 3.1.16 was released near March 17, 2023, and should contain a fix for this issue. Please refer to the YooTheme support forum thread where this is discussed for any further assistance from YooTheme.
That's not a problem in 4Analytics and nothing can be done on our side to fix it.
We have identified the problem and multiple users have passed on the information to YooTheme. The YooTheme support forum thread where this is discussed is here.
Until YooTheme comes up with a fixed update, you can:
- disable widgetkit if you do not actually use it
or
- apply the following bug fix to WidgetKit:
1 - Open the file /administrator/components/com_widgetkit/vendor/yootheme/framework/src/Routing/Request.php
at around line 67
, you'll see:
$this->server = new ServerBag($server ?: $_SERVER);
$this->headers = new HeaderBag($this->server->getHeaders());
// decode json content type
if (stripos($this->headers->get('CONTENT_TYPE') ?: '', 'application/json') !== false) {
if ($json = json_decode(@file_get_contents('php://input'), true)) {
$this->request->add($json);
}
}
2 - Replace this section so that it looks like this:
$this->server = new ServerBag($server ?: $_SERVER);
$this->headers = new HeaderBag($this->server->getHeaders());
// decode json content type
// Fix by Weeblr
if (stripos($this->headers->get('CONTENT_TYPE') ?: '', 'application/json') !== false) {
if ($json = json_decode(@file_get_contents('php://input'), true)) {
$saferJson = empty($json) || !is_array($json)
? [$json]
: $json;
$this->request->add($saferJson);
}
}
// End fix by Weeblr
3 - After saving the modified file, 4Analytics should work normally again
I cannot save some or any settings
This is caused in most cases by a security system called mod_security
running on your server. Depending on mod_security configuration (which changes from one hosting company to the next), requests made by 4Analytics to save data to the server may be blocked.
If you run your own server, you can disable mod_security altogether, or study the log files to see wich rules are triggered and adjust them to allow 4Analytics to work.
Otherwise, you'll need to talk to your hosting company so that they can do that for you.