Disable Plausible and enable Google Analytics
I keep seeing this on server side logs. Can you tell me how I can disable Plausible and enable Google Analytics? Right now I am changing the code imports in
calculateDailyStats.js
manually before my deploy (yet to test this out):
7 Replies
Hi @Karan. 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 knowledge sources provided, there isn't specific information on how to disable Plausible and enable Google Analytics in Wasp. However, from the Discord support thread, it seems that you are on the right track by changing the imports in
calculateDailyStats.js
.
The error you're seeing seems to be related to the getTotalPageViews
function in plausibleAnalyticsUtils.ts
file. It's throwing a 404 not found error, which suggests that the function is trying to fetch data from a resource that doesn't exist or isn't accessible.
If you're switching to Google Analytics, you would need to ensure that the getDailyPageViews
and getSources
functions in googleAnalyticsUtils.js
are correctly implemented to fetch data from Google Analytics.
Remember to also update any environment variables or configurations related to Plausible to match Google Analytics.
If you continue to encounter issues, it would be helpful to check the logs for more detailed error messages or consider opening a Github issue in the Wasp repository for further assistance.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Karan, 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?I can confirm I am not seeing the plausible errors in the Production logs anymore - so the manual change is working - but there really needs to be a way to configure this from wasp build process
Wohooo @Karan, you just became a Waspeteer level 2!
Hi @Karan, not quite sure I get the issue.
Doesn't changing the code in
src/server/workers/calculateDailyStats.ts
do exactly what you need? 😄
Why are you changing the generated code?Hey @sodic the reason I am changing the generated code is because I couldn't find a way to turn off collecting of daily stats from plausible. It's the default. But I want to use Google Analytics since plausible is paid from what I could see.
Doesn't changing the code in src/server/workers/calculateDailyStats.ts do exactly what you need? 😄But what about this?
Ah yes. For some reason I thought the file is only in the generated code. My mistake.
Thank you for pointing that out.
I will make my change in my application code and we should be good to go.