[DigitalPoint] Better Google Analytics

[DigitalPoint] Better Google Analytics 1.0.10

No permission to download
Hmmm… might want to disable the option that hosts the Google Tag Manager on your own domain for the time being. Sounds like your server is having an issue getting the JavaScript from Google for whatever reason.

If you look in the /internal_data/js_cache directory, what’s in there?
 
It’s just happened again 8 minutes ago.
If you edit the DigitalPoint/Analytics/Repository/JavaScript file, and after this line:

PHP:
$response = \XF::app()->http()->reader()->getUntrusted($url, $limits, $streamFile, $options, $error);

...add this:

PHP:
if ($error)
{
   \XF::logError($error);
}

It's not going to solve the underlying issue of the server not being able to get the JavaScript from Google, but maybe the error it generates will be able to tell you why (which could be helpful in fixing whatever it is).
 
Feature request if possible :)
Please change the graph style from the stock XF looking to the one you're using here.

Stock XF
1653285185964.webp

Versus
1653285214193.webp
 
Hmmm… might want to disable the option that hosts the Google Tag Manager on your own domain for the time being. Sounds like your server is having an issue getting the JavaScript from Google for whatever reason.

If you look in the /internal_data/js_cache directory, what’s in there?
This is a standard Centminmod server:

Code:
# ls -al
total 1164
drwxr-xr-x   2 nginx nginx   4096 May 22 19:30 .
drwxr-xr-x. 11 nginx nginx   4096 May 22 10:38 ..
-rw-r--r--   1 nginx nginx 193606 May 22 17:56 007430427771b761f6f541d73d05187f.js
-rw-r--r--   1 nginx nginx 193606 May 22 18:57 01dcf25e5623504f4497f2fddcbf33d1.js
-rw-r--r--   1 nginx nginx 193606 May 22 10:57 309f6faa3dd1a95848a9e589bcc5d05d.js
-rw-r--r--   1 nginx nginx 193499 May 22 11:15 35862c3657965a3f1ea9cdafc157efed.js
-rw-r--r--   1 nginx nginx 193606 May 23 06:56 b0ec03dd8eacb8a25832ecab9689d514.js
-rw-r--r--   1 nginx nginx 193606 May 22 10:38 ce1cd72a518b116a8119c07f1cb7bc12.js
-rw-r--r--   1 nginx nginx      1 May 22 10:38 index.html

EDIT: one thing to note, it uses a HTTP proxy configuration in the config.php.
 
Feature request if possible :)
Please change the graph style from the stock XF looking to the one you're using here.

Stock XF
View attachment 268681

Versus
View attachment 268682
Would love to, unfortunately an OEM license for High Charts is cost prohibitive for a free addon.

Would be great if XenForo used High Charts. 😀


This is a standard Centminmod server:

Code:
# ls -al
total 1164
drwxr-xr-x   2 nginx nginx   4096 May 22 19:30 .
drwxr-xr-x. 11 nginx nginx   4096 May 22 10:38 ..
-rw-r--r--   1 nginx nginx 193606 May 22 17:56 007430427771b761f6f541d73d05187f.js
-rw-r--r--   1 nginx nginx 193606 May 22 18:57 01dcf25e5623504f4497f2fddcbf33d1.js
-rw-r--r--   1 nginx nginx 193606 May 22 10:57 309f6faa3dd1a95848a9e589bcc5d05d.js
-rw-r--r--   1 nginx nginx 193499 May 22 11:15 35862c3657965a3f1ea9cdafc157efed.js
-rw-r--r--   1 nginx nginx 193606 May 23 06:56 b0ec03dd8eacb8a25832ecab9689d514.js
-rw-r--r--   1 nginx nginx 193606 May 22 10:38 ce1cd72a518b116a8119c07f1cb7bc12.js
-rw-r--r--   1 nginx nginx      1 May 22 10:38 index.html

EDIT: one thing to note, it uses a HTTP proxy configuration in the config.php.
I suspect that’s probably going to be the issue. Google’s servers for serving JavaScript are pretty reliable. Not sure what sort of http proxy setup you are using, but is it setup for failover/retry if it fails for whatever reason?
 
  • Wow
Reactions: rdn
I suspect that’s probably going to be the issue. Google’s servers for serving JavaScript are pretty reliable. Not sure what sort of http proxy setup you are using, but is it setup for failover/retry if it fails for whatever reason?
No, it's a single instance of tinyproxy on a VPS. There are no other issues with the proxy fetching any of the images. What specific URL is it supposed to be fetching the file from, so I can at least check the logs?
 
Code:
# grep -i googletagmanager tinyproxy.log
CONNECT   May 23 03:56:56 [12009]: Request (file descriptor 9): CONNECT www.googletagmanager.com:443 HTTP/1.1
INFO      May 23 03:56:56 [12009]: No upstream proxy for www.googletagmanager.com
CONNECT   May 23 03:56:56 [12009]: Established connection to host "www.googletagmanager.com" using file descriptor 10.
CONNECT   May 23 05:03:52 [12007]: Request (file descriptor 9): CONNECT www.googletagmanager.com:443 HTTP/1.1
INFO      May 23 05:03:52 [12007]: No upstream proxy for www.googletagmanager.com
CONNECT   May 23 05:03:52 [12007]: Established connection to host "www.googletagmanager.com" using file descriptor 10.
CONNECT   May 23 05:57:10 [23458]: Request (file descriptor 9): CONNECT www.googletagmanager.com:443 HTTP/1.1
INFO      May 23 05:57:10 [23458]: No upstream proxy for www.googletagmanager.com
CONNECT   May 23 05:57:10 [23458]: Established connection to host "www.googletagmanager.com" using file descriptor 10.
CONNECT   May 23 06:56:18 [13718]: Request (file descriptor 9): CONNECT www.googletagmanager.com:443 HTTP/1.1
INFO      May 23 06:56:18 [13718]: No upstream proxy for www.googletagmanager.com
CONNECT   May 23 06:56:18 [13718]: Established connection to host "www.googletagmanager.com" using file descriptor 10.
CONNECT   May 23 07:58:47 [23458]: Request (file descriptor 9): CONNECT www.googletagmanager.com:443 HTTP/1.1
INFO      May 23 07:58:47 [23458]: No upstream proxy for www.googletagmanager.com
CONNECT   May 23 07:58:47 [23458]: Established connection to host "www.googletagmanager.com" using file descriptor 10.
CONNECT   May 23 08:56:55 [12016]: Request (file descriptor 9): CONNECT www.googletagmanager.com:443 HTTP/1.1
INFO      May 23 08:56:55 [12016]: No upstream proxy for www.googletagmanager.com
CONNECT   May 23 08:56:55 [12016]: Established connection to host "www.googletagmanager.com" using file descriptor 10.
CONNECT   May 23 09:58:26 [23795]: Request (file descriptor 9): CONNECT www.googletagmanager.com:443 HTTP/1.1
INFO      May 23 09:58:26 [23795]: No upstream proxy for www.googletagmanager.com
CONNECT   May 23 09:58:26 [23795]: Established connection to host "www.googletagmanager.com" using file descriptor 10.
CONNECT   May 23 10:57:16 [12013]: Request (file descriptor 9): CONNECT www.googletagmanager.com:443 HTTP/1.1
INFO      May 23 10:57:16 [12013]: No upstream proxy for www.googletagmanager.com
CONNECT   May 23 10:57:16 [12013]: Established connection to host "www.googletagmanager.com" using file descriptor 10.
CONNECT   May 23 11:56:41 [12014]: Request (file descriptor 9): CONNECT www.googletagmanager.com:443 HTTP/1.1
INFO      May 23 11:56:41 [12014]: No upstream proxy for www.googletagmanager.com
CONNECT   May 23 11:56:41 [12014]: Established connection to host "www.googletagmanager.com" using file descriptor 10.
CONNECT   May 23 13:00:24 [12011]: Request (file descriptor 9): CONNECT www.googletagmanager.com:443 HTTP/1.1
INFO      May 23 13:00:24 [12011]: No upstream proxy for www.googletagmanager.com
CONNECT   May 23 13:00:24 [12011]: Established connection to host "www.googletagmanager.com" using file descriptor 10.
 
Code:
# grep -i googletagmanager tinyproxy.log
CONNECT   May 23 03:56:56 [12009]: Request (file descriptor 9): CONNECT www.googletagmanager.com:443 HTTP/1.1
INFO      May 23 03:56:56 [12009]: No upstream proxy for www.googletagmanager.com
CONNECT   May 23 03:56:56 [12009]: Established connection to host "www.googletagmanager.com" using file descriptor 10.
CONNECT   May 23 05:03:52 [12007]: Request (file descriptor 9): CONNECT www.googletagmanager.com:443 HTTP/1.1
INFO      May 23 05:03:52 [12007]: No upstream proxy for www.googletagmanager.com
CONNECT   May 23 05:03:52 [12007]: Established connection to host "www.googletagmanager.com" using file descriptor 10.
CONNECT   May 23 05:57:10 [23458]: Request (file descriptor 9): CONNECT www.googletagmanager.com:443 HTTP/1.1
INFO      May 23 05:57:10 [23458]: No upstream proxy for www.googletagmanager.com
CONNECT   May 23 05:57:10 [23458]: Established connection to host "www.googletagmanager.com" using file descriptor 10.
CONNECT   May 23 06:56:18 [13718]: Request (file descriptor 9): CONNECT www.googletagmanager.com:443 HTTP/1.1
INFO      May 23 06:56:18 [13718]: No upstream proxy for www.googletagmanager.com
CONNECT   May 23 06:56:18 [13718]: Established connection to host "www.googletagmanager.com" using file descriptor 10.
CONNECT   May 23 07:58:47 [23458]: Request (file descriptor 9): CONNECT www.googletagmanager.com:443 HTTP/1.1
INFO      May 23 07:58:47 [23458]: No upstream proxy for www.googletagmanager.com
CONNECT   May 23 07:58:47 [23458]: Established connection to host "www.googletagmanager.com" using file descriptor 10.
CONNECT   May 23 08:56:55 [12016]: Request (file descriptor 9): CONNECT www.googletagmanager.com:443 HTTP/1.1
INFO      May 23 08:56:55 [12016]: No upstream proxy for www.googletagmanager.com
CONNECT   May 23 08:56:55 [12016]: Established connection to host "www.googletagmanager.com" using file descriptor 10.
CONNECT   May 23 09:58:26 [23795]: Request (file descriptor 9): CONNECT www.googletagmanager.com:443 HTTP/1.1
INFO      May 23 09:58:26 [23795]: No upstream proxy for www.googletagmanager.com
CONNECT   May 23 09:58:26 [23795]: Established connection to host "www.googletagmanager.com" using file descriptor 10.
CONNECT   May 23 10:57:16 [12013]: Request (file descriptor 9): CONNECT www.googletagmanager.com:443 HTTP/1.1
INFO      May 23 10:57:16 [12013]: No upstream proxy for www.googletagmanager.com
CONNECT   May 23 10:57:16 [12013]: Established connection to host "www.googletagmanager.com" using file descriptor 10.
CONNECT   May 23 11:56:41 [12014]: Request (file descriptor 9): CONNECT www.googletagmanager.com:443 HTTP/1.1
INFO      May 23 11:56:41 [12014]: No upstream proxy for www.googletagmanager.com
CONNECT   May 23 11:56:41 [12014]: Established connection to host "www.googletagmanager.com" using file descriptor 10.
CONNECT   May 23 13:00:24 [12011]: Request (file descriptor 9): CONNECT www.googletagmanager.com:443 HTTP/1.1
INFO      May 23 13:00:24 [12011]: No upstream proxy for www.googletagmanager.com
CONNECT   May 23 13:00:24 [12011]: Established connection to host "www.googletagmanager.com" using file descriptor 10.
Honestly I don’t know anything about tinyproxy. The little I Googled says it needs an upstream proxy to function and your logs are implying some issue between tinyproxy and whatever upstream proxy you are relying on?
 
Honestly I don’t know anything about tinyproxy. The little I Googled says it needs an upstream proxy to function and your logs are implying some issue between tinyproxy and whatever upstream proxy you are relying on?
There is no upstream configured, the proxy works and has been working since it was introduced for @JoyFreak

That's the additional INFO log level that is enabled, and simply states there is no enforced proxy chain required for this instance on tinyproxy, and it can go straight out to fetch what it needs.

1653315625573.webp

Code:
CONNECT   May 23 14:19:53 [23796]: Connect (file descriptor 9): HOST REDACTED
CONNECT   May 23 14:19:53 [23796]: Request (file descriptor 9): CONNECT xenforo.com:443 HTTP/1.1
INFO      May 23 14:19:53 [23796]: No upstream proxy for xenforo.com
CONNECT   May 23 14:19:53 [23796]: Established connection to host "xenforo.com" using file descriptor 10.
INFO      May 23 14:19:53 [23796]: Not sending client headers to remote machine
INFO      May 23 14:19:54 [23796]: Closed connection between local client (fd:9) and remote client (fd:10)
 
Last edited:
I suppose it could be setup to suppress writing anything to the error log if it fails to fetch the JavaScript from Google (for whatever reason). Although to be honest, I’d rather know if it was failing than not know.

The problem is that only someone with access to your servers and some familiarity with tinyproxy is going to be able to answer the “why”.

The test doesn’t really tell much because it looks like it’s working most of the time even with the JavaScript fetching. But it’s failing once in awhile.

If it was my setup, I’d want no single point of failure and have proxy redundancy (if tinyproxy is down for any reason, I’d want backup ones it could use).
 
I suppose it could be setup to suppress writing anything to the error log if it fails to fetch the JavaScript from Google (for whatever reason). Although to be honest, I’d rather know if it was failing than not know.

The problem is that only someone with access to your servers and some familiarity with tinyproxy is going to be able to answer the “why”.

The test doesn’t really tell much because it looks like it’s working most of the time even with the JavaScript fetching. But it’s failing once in awhile.

If it was my setup, I’d want no single point of failure and have proxy redundancy (if tinyproxy is down for any reason, I’d want backup ones it could use).
The timestamps from the logs in tinyproxy suggest it connected to googletagmanager

Code:
CONNECT   May 22 11:42:31 [12014]: Connect (file descriptor 9): REMOVED
CONNECT   May 22 11:42:31 [12014]: Request (file descriptor 9): CONNECT www.googletagmanager.com:443 HTTP/1.1
INFO      May 22 11:42:31 [12014]: No upstream proxy for www.googletagmanager.com
CONNECT   May 22 11:42:32 [12014]: Established connection to host "www.googletagmanager.com" using file descriptor 10.
INFO      May 22 11:42:32 [12014]: Not sending client headers to remote machine
INFO      May 22 11:42:32 [12014]: Closed connection between local client (fd:9) and remote client (fd:10)
CONNECT   May 22 11:42:34 [12017]: Connect (file descriptor 9): REMOVED
CONNECT   May 22 11:42:34 [12017]: Request (file descriptor 9): CONNECT www.googletagmanager.com:443 HTTP/1.1
INFO      May 22 11:42:34 [12017]: No upstream proxy for www.googletagmanager.com
CONNECT   May 22 11:42:34 [12017]: Established connection to host "www.googletagmanager.com" using file descriptor 10.
INFO      May 22 11:42:34 [12017]: Not sending client headers to remote machine
INFO      May 22 11:42:34 [12017]: Closed connection between local client (fd:9) and remote client (fd:10)

Server time is UTC, error log from his XenForo install was BST.

I've switched the proxy over to squid.
 
Well it's definitely working most of the time. If it wasn't working at all, you would end up with an entry in your server error log with every page view of every user.

Again, I don't know anything about tinyproxy whatsoever (and don't have access to a tinyproxy installation). But maybe it has some sort of bypass option for certain domains? I don't really see the need to use a proxy to get JavaScript from Google (doubt Google cares about your server's IP address if that's what you are trying to hide).
 
Feature request if possible :)
Please change the graph style from the stock XF looking to the one you're using here.

Stock XF
View attachment 268681

Versus
View attachment 268682
Not even sure how much their OEM license is, but it's probably not cheap. But that would be the license needed to be able to distribute it to other people's servers: https://shop.highcharts.com/

You can do a lot of cool things with that charting library though. Like scroll down and check out the Geography, Browser and Operating system charts here (click on them): https://cookieforensics.com/analytics/sample/ I also use it here: https://outgress.com/stats

Tons of other demos of the kind of things you can do with it: https://www.highcharts.com/demo

There have been a couple times where I thought of making a feature request thread here for High Charts usage for charts. But XF doesn't really do enough charting to warrant a commercial charting library I'm guessing.
 
  • Love
Reactions: rdn
Would love to, unfortunately an OEM license for High Charts is cost prohibitive for a free addon.

Would be great if XenForo used High Charts. 😀



I suspect that’s probably going to be the issue. Google’s servers for serving JavaScript are pretty reliable. Not sure what sort of http proxy setup you are using, but is it setup for failover/retry if it fails for whatever reason?
If it asks for you to contact them, it's never a price you actually want to be told 🤣.
 
Which template to modify this icon?
View attachment 268621

I would like to change it to a regular icon, as I'm using the FontAwesome Manager addon and I have Duotone disabled.
Thanks.

Edit: Found it on Template Mod: PAGE_CONTAINER_2_ba
I think he should change that to a regular icon (or at least make it easy for us to make the change) in the add-on because most of us use Font Awesome Manager add-on and some of us might not have the experience or want to put developer mode on to make the change (which will probably revert to the original when the add-on updates or rebuilds). Currently, the icon looks missing for me because of this.
 
I think he should change that to a regular icon (or at least make it easy for us to make the change) in the add-on because most of us use Font Awesome Manager add-on and some of us might not have the experience or want to put developer mode on to make the change (which will probably revert to the original when the add-on updates or rebuilds). Currently, the icon looks missing for me because of this.
That would be more in the scope of whatever addon you are using that is making Font Awesome a non-standard system for XenForo. This addon isn't changing anything, it's simply using what is supposed to be there. So an addon that is removing what's supposed to be there would be a better place for some change to be be made to not use what's supposed to be there I would think. Can't realistically expect every addon out there to adhere to how some unrelated third-party addon works vs. how XenForo works by default. :)

That being said, it should be a pretty simple change with template modifications to to use whatever icon you personally want to use (or make it a text link instead of an icon).
 
Top Bottom