[DigitalPoint] Better Google Analytics

[DigitalPoint] Better Google Analytics 1.1.2.3

No permission to download
@digitalpoint I've identified that when Better Analytics is enabled, Google tags are disabled for my account when I am logged in (userid=1).
So Analytics is not active and Google tags for ads is not active. I don't get ads.
When I disable the addon or log out, everything is fine.
Is this a bug?
Maybe a bug, but more probably, you enabled the user group permission, Do not track with Google Analytics for your user group (it’s off by default).
 
Maybe a bug, but more probably, you enabled the user group permission, Do not track with Google Analytics for your user group (it’s off by default).
Thank you. Set to No for the group but set to Yes for me in user level permissions.
The only way that could happen is by doing a blanket Yes for admin permissions for me at some point after Better Analytics was installed.
Which is unlikely, but the most feasible explanation.
Because I would never deliberately set that specific permission to Yes.
This solves a mystery going back more than a year.
Nice one 👍
 
edit, fixed nginx with this code:
Code:
location ~ ^/jc/gtm.js {
try_files $uri /index.php?$uri&$args;
}


Date presets in the admincp do not function still. anyone else notice this? on 2 different sites/servers. one nginx, one litespeed

seeing this in the console:
Screenshot 2025-10-15 134828.webp
 
Last edited:
edit, fixed nginx with this code:
Code:
location ~ ^/jc/gtm.js {
try_files $uri /index.php?$uri&$args;
}
You don't normally need to do that unless you have an (arguably) poorly configured web server setup that is blindly intercepting .js requests without checking if the file actually exists or not.

The above will tell your web server to not intercept that specific request, but a better solution is to have your web server not intercept .js requests if the file doesn't exist in the filesystem.

Whatever section of your Nginx config is intercepting .js requests, it probably makes sense to utilize the try_files directive to check if they actually exist. It's what you are doing in the above block, but you are only making that work for /jc/gtm.js... I can't think of a situation where you would need to do things like override cache-control (or other headers) for files that don't exist in the filesystem.

TL;DR: if a file doesn't exist in the filesystem, you are better off passing that request along to XenForo (in all cases).


Date presets in the admincp do not function still. anyone else notice this? on 2 different sites/servers. one nginx, one litespeed

seeing this in the console:
View attachment 328706
Disable debugging in your browser. Or more specifically, disable JavaScript source maps in your browser debugging settings. Also, Chartist is a XenForo thing, so if you want XenForo to start shipping with debugging source maps, you would need to ask them (again, chartist isn't coming from this addon, rather it's just using the charting library that XenForo ships with).

1760553409986.webp
 
I'm using the standard nginx.conf file from the xf documentation.

There is not a jc/folder on my server, i cannot find a gtm.js file at all. So i'm not sure what's actually going on.
99.9% hour web server has a rule to intercept anything with .js extension.

I disable the map option as above, no changes. It's always the past month. Every submit goes back one day.

View attachment 328714
Ya not sure… as I said, Chartist is part of XenForo.
 
The XF charts (stats) work fine.
Not sure... are you using the latest version of XenForo? Looks like it was an issue that was fixed, but way back in XenForo 2.1. I'm not able to replicate it on my sites.


As far as the .JS thing, you can test to see if it's your web server or not by checking a random URL with a .js exension. For example:

This yields as XenForo error (not a web server error), so you know the web server routed the request to XenForo:


If you try your site with test.js, and you get a XenForo error, you know the web server is configured properly. If you get a web server error, the web server is NOT routing requests as it's supposed to.
 
Yes, i have 2.3.7.

test.js goes to nginx 404 page.

This is the exact file i have
https://xenforo.com/docs/xf2/friendly-urls/#nginx straight from xf resources, with the path changed to match mine. That's it.
You have another part of your Nginx config that's affecting it. The XenForo config is additive to the rest of your Nginx config (meaning it adds to the config, it doesn't override everything else already there). The fact that the request never makes it to XenForo shows that the web server is deciding to intercept it and handle the request on it's own. If the web server was routing the request to XenForo, you'd see a XenForo error (like the link I posted above to this site). Probably best to talk to your server admin/whoever manages Nginx on the server.

...or just leave it if you don't care. I mean you have it working for this I guess. Personally, I'd try to fix the root of the issue rather than do one-off fixes for each URL though.
 
turns hat around HI :) Sys admin here.

I'm running centmin. I'll ping Eva on it to see if he has ideas.


Also, it does the same thing on the other site i'm working on , which is running litespeed with stock htaccess. The dropdown doesn't submit.
 
turns hat around HI :) Sys admin here.

I'm running centmin. I'll ping Eva on it to see if he has ideas.


Also, it does the same thing on the other site i'm working on , which is running litespeed with stock htaccess. The dropdown doesn't submit.
The dropdown is a different thing… 2.3 compatibility issues. Fixed for next version.
 
This morning i'm logging a lot of dupe posts. Getting this error on quick reply 50% of the time.
Oops! We ran into some problems.
SodiumException: sodium_crypto_secretbox(): Argument #3 ($key) must be SODIUM_CRYPTO_SECRETBOX_KEYBYTES bytes long in src/addons/DigitalPoint/Analytics/Util/Crypt.php at line 21
  1. sodium_crypto_secretbox() in src/addons/DigitalPoint/Analytics/Util/Crypt.php at line 21
  2. DigitalPoint\Analytics\Util\Crypt::encrypt() in src/addons/DigitalPoint/Analytics/XF/Mail/Mailer.php at line 54
  3. DigitalPoint\Analytics\XF\Mail\Mailer->renderMailTemplate() in src/XF/Mail/Mail.php at line 420
  4. XF\Mail\Mail->renderTemplate() in src/XF/Mail/Mail.php at line 492
  5. XF\Mail\Mail->getSendableEmail() in src/XF/Mail/Mail.php at line 587
  6. XF\Mail\Mail->queue() in src/XF/Notifier/Post/AbstractWatch.php at line 141
  7. XF\Notifier\Post\AbstractWatch->sendEmail() in src/XF/Service/AbstractNotifier.php at line 97
  8. XF\Service\AbstractNotifier->notifyType() in src/XF/Service/AbstractNotifier.php at line 49
  9. XF\Service\AbstractNotifier->notify() in src/XF/Service/AbstractNotifier.php at line 61
  10. XF\Service\AbstractNotifier->notifyAndEnqueue() in src/XF/Service/Thread/ReplierService.php at line 261
  11. XF\Service\Thread\ReplierService->sendNotifications() in src/XF/Pub/Controller/ThreadController.php at line 501
  12. XF\Pub\Controller\ThreadController->finalizeThreadReply() in src/XF/Pub/Controller/ThreadController.php at line 659
  13. XF\Pub\Controller\ThreadController->actionAddReply() in src/XF/Mvc/Dispatcher.php at line 362
  14. XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 264
  15. XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 121
  16. XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 63
  17. XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2824
  18. XF\App->run() in src/XF.php at line 806
  19. XF::runApp() in index.php at line 23
  20. [/code]
 
This morning i'm logging a lot of dupe posts. Getting this error on quick reply 50% of the time.
Did you by chance instead a new version of PHP? Specifically one that now has Sodium support where your old version didn’t?

When the addon is installed, it generates an encryption key if Sodium is supported. If it’s not supported when it’s installed, the encryption key can’t be created.

If thats the case, the easiest thing to do would be to reinstall the addon. Or if you have CLI access, you can just rerun the setup for the addon.
 
I haven't changed php. Running 8.3.x
Well somehow your baAnalyticsKey option went missing or got corrupt somehow (assuming Sodium was installed and working when you installed the addon). You can run this query to see what the value is:

SQL:
SELECT * FROM xf_option WHERE option_id = 'baAnalyticsKey' LIMIT 1;

option_value should be exactly 32 characters (anything else will cause the problem you see).
 
Another possibility would be some sort of corruption going on if you are using a cache for XenForo (for example Redis or Memcached) where options are being read from there rather than the database and it's returning incorrect data. That seems rather far fetched though... just throwing out random possibilities. Somehow, for whatever reason, the encryption key isn't 32 bytes when it's being used. 🤷🏻‍♂️
 
It ONLY happens when submitting a quick reply post on the lightspeed site running php 8.3. no cache setup here.

i have seen no errors on my nginx site with 8.4 which has redis.
 
It ONLY happens when submitting a quick reply post on the lightspeed site running php 8.3. no cache setup here.

i have seen no errors on my nginx site with 8.4 which has redis.
Yep, not sure... like I said, at the most basic level, the encryption key isn't 32 bytes when it goes to be used (for whatever reason). Don't know anything about your site or what other addons or server software you are running, so can't really offer much else as far as ideas as to why. If it was something widespread, you'd see it on your other sites and I'm sure someone else would be posting here about it. So whatever it is seems to be unique to that particular site somehow.
 
Back
Top Bottom