Getting 404 error from Plausible self hosted instance.
I have tried debugging as much as i could, would appreciate any insights.

9 Replies
Hi @Killshot. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Based on the information provided in the knowledge sources, it appears you're experiencing a 404 error with Plausible Analytics integration in a Wasp application. Here's what we can gather from the available information:
1. There was a bug reported where the URL for Plausible Analytics had "v1" twice, which could cause issues. As mentioned by a community member in the Discord thread:
Discord Thread
"found the issue
u have a bug in the url : it has v1 twice"
2. The error you're seeing might be related to the
getTotalPageViews
function. From the logs shared in the Discord thread:
"Error calculating daily stats: Error: HTTP error! Status: 404
at getTotalPageViews (/Users/noamico/dev/wasp-demo/app/src/server/workers/plausibleAnalyticsUtils.ts:46:11)"
To troubleshoot this issue, you could try the following:
1. Check if you've correctly set the PLAUSIBLE_SITE_ID
environment variable.
2. Verify that the URL being used to connect to your self-hosted Plausible instance is correct and doesn't have any duplication (like the "v1" issue mentioned above).
3. Ensure that your self-hosted Plausible instance is running and accessible.
4. Check the Logs in your database, as suggested by a community member: "If the calculateDailyStats job fails, it will save a log to the DB"
If you're still unable to resolve the issue after these steps, you might want to share more detailed logs or your configuration in the Wasp Discord community for further assistance.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Killshot, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?am i doing this ri8?

i got api key from my self hosted instance.
The cloud-hosted base URL includes the
/api
path, have you tried appending that to yours?No
So it will analytics.mysite.com/api ?
@genyus this worked like a charm, thanks
This should be there in .env.server as a comment for future reasons that someone faces same issue....
thanks @genyus... do you think it would be better if the /api path to the example env var url @Killshot ?
definitely
ah, funny it's actually already changed in the current version:
aah that's nice, i keep migrating from 0.14 so might have missed it