Google Analytics not working on OOD

We have Google analytics configured for OOD for centos 7, and it stopped working for the OOD on Centos 8 (No GA entries when someone is accessing the OOD website). We used the same OOD deployment procedure and configuration files, and we could not find which part went wrong.

I checked on the OOD server, the ood_portal.yml and ood-portal.conf file shows exactly as in 1. Adding Google Analytics — Open OnDemand 2.0.13 documentation
I also tried update_ood_portal, restarting httpd and htcacheclean, and the GA still not work.
The file /opt/ood/mod_ood_proxy/lib/analytics.lua exist with correct permission.
We have the following packages installed.

I worked with the Google Analytics team and confirmed that it can collect data on a test website.
So it is more likely the error is on the OOD part. I would like some help in debugging and find where it goes wrong.

Looks like we’re using wget to send off the data right the on the web node.

You can turn lua log level to debug and see what the response is. I’m guessing that you either have some connectivity issue or you simply don’t have wget.

I confirmed the wget works on the OOD server node.
How can I turn the lua log level to debug?

I set the lua to the debug level, and I can see some lua:debug entries on the httpd/error.log, the entries look like the following:

[Wed Dec 01 13:15:26.083613 2021] [lua:debug] [pid 440226:tid 140497867548416] lua_request.c(1860): [client] AH01488: request_rec->dispatching unparsed_uri → string, referer:
[Wed Dec 01 13:15:26.084238 2021] [lua:debug] [pid 440226:tid 140497867548416] lua_request.c(1842): [client] AH01486: request_rec->dispatching subprocess_env → apr table, referer:
[Wed Dec 01 13:15:26.084247 2021] [lua:debug] [pid 440226:tid 140497867548416] lua_request.c(1842): [client] AH01486: request_rec->dispatching subprocess_env → apr table, referer:

However, when I search for “Analytics input:” or “Analytics output” I could not find any. I am accessing the website at the meantime. Does this mean the Analytics.lua is not triggered at all?

In the error log, we also have entry that exist for a long time:

[Wed Dec 01 13:15:26.084263 2021] [lua:warn] [pid 440226:tid 140497867548416] AH01471: Lua error: /opt/ood/mod_ood_proxy/lib/logger.lua:22: bad argument #2 to ‘date’ (number has no integer representation)

Would this be the cause?

Could be. Did you add the analytics options to your ood_portal.yml?

Yes we already have the config exist:

ood config
[root@ridnc001is03]$ less /etc/ood/config/ood_portal.yml
url: ‘
id: ‘UA-120795448-19’

which generate config in httpd
[root@ridnc001is03 conf.d]# less ood-portal.conf
<Location “/pun”>

LuaHookLog analytics.lua analytics_handler

I tried with “/opt/ood/ood-portal-generator/sbin/update_ood_portal -f” and httpd restart as well.

I’m looking to release 2.0.20 today, it has a bugfix for the lua warning you’re seeing. But I feel like you’d see that on the other system? In any case - that may solve this though I’m skeptical.

Indeed - what’s changed here? The httpd version. Maybe the newer version really doesn’t like that warning?

what about the analytics lua part? Any suggestions to debug further?

When I turn this feature on with debug logs I saw this message. You should see something similar.

[Fri Dec 03 20:12:23.471769 2021] [lua:debug] [pid 40:tid 139666162448128] @/opt/ood/mod_ood_proxy/lib/analytics.lua(84): [client] Analytics input: 'v=1&t=pageview&tid=UA-79331310-4&cid=jeff%40localhost&uid=jeff%40localhost&uip=', referer: http://localhost:5556/
[Fri Dec 03 20:12:23.472138 2021] [lua:debug] [pid 40:tid 139666162448128] @/opt/ood/mod_ood_proxy/lib/analytics.lua(85): [client] Analytics output: 'sh: wget: command not found' [23.178 ms], referer: http://localhost:5556/

I just grepped for it with grep 'analytics.lua' /var/log/httpd/localhost*. Do you see anything from a similar grep?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.