Tinybird Analytics Empty, No Errors

I’m currently self-hosting Ghost 6 via Docker and have endeavored to activate analytics using Tinybird. After following the official installation instructions (“Enabling Web Analytics”) and successfully connecting my TinyBird instance, I fired up the containers (including --force-recreate due to the changes in .env) but found that no analytic data was being processed.

While I am seeing no traffic or updates within the Ghost admin page itself (and I did double-check that Settings > Analytics were all checked) what I found more interesting is that the traffic-analytics container doesn’t seem to be receiving any requests, with its log file reporting only the following, with no updates as visitors browse the site:

30 timestamp={"seconds":1772786654,"nanos":111000000} pid=1 hostname=5cff13b469f1 event=SaltCleanupSchedulerStarting delayMinutes=46

(node:1) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.

(Use `node --trace-deprecation ...` to show where the warning was created)

40 timestamp={"seconds":1772786654,"nanos":512000000} pid=1 hostname=5cff13b469f1 event=HmacValidationDisabled

30 Server listening at http://127.0.0.1:3000 | timestamp={"seconds":1772786654,"nanos":768000000} pid=1 hostname=5cff13b469f1

30 Server listening at http://172.19.0.2:3000 | timestamp={"seconds":1772786654,"nanos":768000000} pid=1 hostname=5cff13b469f1

30 severity=INFO timestamp={"seconds":1772786669,"nanos":7000000} pid=1 hostname=5cff13b469f1 logging.googleapis.com/diagnostic={"instrumentation_source":[{"name":"nodejs-gcppino","version":"1.3.1"},{"name":"nodejs","version":"11.2.1"}],"runtime":"v22.22.0"} logging.googleapis.com/insertId=..........xxxxxxxxxxxx

30 timestamp={"seconds":1772789414,"nanos":196000000} pid=1 hostname=5cff13b469f1 event=SaltCleanupCompleted deletedCount=0

It appears as though page requests are not passing from the primary container to the analysis container, which means TinyBird also doesn’t receive any data.

I’ve looked through similar Forum posts like “Analyticts [sic] Are Not Logging” and “Traffic Analytics empty despite no errors” but unfortunately neither of their situations or solutions exactly match my own.

I’d greatly appreciate any help or support for where I should look next or how I should continue troubleshooting this issue, as I’d really love to get analytics working within the Ghost ecosystem.

Might be worth checking that you’ve got Caddy proxying request to the tb container correctly? Iirc there was a block of commented out configuration that needed to be uncommented to get the traffic to tb.

Thanks for that Cathy; as I play with the configs today I remembered that I had disabled Caddy since my Synology uses its built-in nginx for reverse proxies, and with a certificate already configured Caddy wouldn’t forward traffic correctly. I see the import snippets/TrafficAnalytics line in the configuration, which I’m sure would resolve the issue I’m seeing with TinyBird if I can get Caddy working.

For testing, I have my Synology (Nginx) accepting traffic on :443, which then forwards to port 80 in my Caddy container. Thereafter I get a “The page isn’t redirecting properly” browser error and see a 308 HTTP status in the docker logs, after it tries and fails to secure a certificate (since one has already been issued for that domain).

Is there a straightforward way for me to adjust the Caddyfile to handle this double-reverse proxy situation (and ideally, not request a new certificate every time it starts up)? I found this github issue but unfortunately their solution isn’t working for me.

[My workaround to have the site operational is to forward directly from :443 to the ghost container itself, and I now recognize that this bypasses the analytics redirect Caddy can provide]

I found this site which was very promising, but unfortunately even after applying their solution my Analytics log remains empty.

At least the site works properly with the Caddy docker running, so that’s progress!

I’ve also tried browsing to [site.tld]/.ghost/analytics which successfully reported and logged in the Traffic analysis docker log, even if nothing showed up in the admin dashboard. To me that says that the redirect is working but that for some reason my site isn’t triggering the analytics headers

Resolved! I realized I had ad- and script-blocking extensions in my browser after looking at the Network tab in the F12 tools pane.

The short solution was configuring both my Nginx reverse proxy and my Caddy config to account for the nested-routing solution, and now everything seems to work just fine.

1 Like