Hello, I have some interrogation about app analyti...
# multiplatform
f
Hello, I have some interrogation about app analytics and Kotlin/KMP/CMP in general. Currently, Google Analytics is (apparently) the most popular, because; I think; it’s totally free... Alternatively, I have made a matomo implementation in KMP, but I didn’t expect it to be a popular solution because the cloud server is not free. My guess is, for a good alternative, the server must be at least free ? I know there are some alternatives, but I didn’t find one free as GA.
c
Well, I guess the main benefit of Matomo is, that you can host it yourself. https://matomo.org/matomo-on-premise/
g
Never heard of this one, I am about to start to use MixPanel for analytics but I am indeed wondering if not just use GA
f
There are alternative from Matomo, using the same business plan.
The main issue with GA, it’s not fully KMP, there are missing targets
g
Don't they have a public API?
f
GA use Firebase to centralize every target.
f
SO, yeah, we need a pure KMP library using only the REST API.
g
Yup, are you taking the hit for the team? If so please allow Android / iOS / WasmJS / Desktop JVM 🙏
c
SO, yeah, we need a pure KMP library using only the REST API.
but you will need the same for Matomo, right?
f
The matomo REST API is really easy to understand.
The one from Google is different
That’s why I have implemented first something easy to understand with a clear documentation
👍🏻 1
@Chrimaeon This is what I did with matomo, I took the public API and implement it on a KMP friendly way.
I can also create a xcframework from it 😄 . It works!
c
We use the GA API as well. It’s not that hard to understand - at least for our usecases like screen tracking and basic user interaction tracking.
f
I’m not a big fan of Google; Giving an alternative to the KMP community is always good.
c
sure sure, but we are a agency so most of the time we cannot decide what to use. 😅 For our Austrian Government clients we anyway cannot use GA so we used Matomo there as well.
👍 2
f
So, that’s the link for the GA REST API.
That could work
But; a KMP solution will be really generic and not as good as the native one
@Chrimaeon By reading the API, A configured Firebase App is required for using the Firebase REST API or using the gtag.js libs which require a domain; that’s make the really complicate to directly use the API, or even useless as we already have access to the API instead of implement a new one.
c
Yes of course it's still firebase. If you use the SDK you‘ll need the same.
f
So, Firebase Analytics is not CMP friendly at all.
How about wasm?
c
Ktor is KMP so you can use the Rest API with wasm targets.
f
Google Analytics requires to use gtag.js or FirebaseWeb with Wasm, I don’t know if it’s working
c
I don't get it - it's a Rest API so plain http requests!? 🤔
f
no, not simple with Firebase, look at the requirement parameter
app_instance_id (firebase)
and
client_id (gtag.js)
from the API doc
c
That's just a „UUID“ (I'm already on vacation and do not have my work MacBook with me so I can check) - just create one and get sure to always use the same value through the requests.
f
Capture d’écran 2025-12-22 à 19.44.29.png
that’s the catch when using the REST API of firebase
c
no, I’m pretty sure we do not setup any Firebase app through the SDK.
f
the alternative is to use gtag.js with the same kind of requirement
I’m just reading the documentation 🙂
Maybe, it could be replaced with a UUID, as you said.
@Chrimaeon using a generated one doesn’t work, the request is valid but no event display on the dashboard. I’m curious about how you handle the app_instance_id
c
I can tell you beginning of next year 😊
👀 1
❤️ 1