https://kotlinlang.org logo
#android
Title
# android
d

Dean Djermanović

07/14/2022, 1:17 PM
I know it’s not Kotlin related, but does someone use a proxy like Charles, for testing Google Analytics 4 events? I have a problem that I can see the requests being sent to the
<http://ssl-google-analytics.com|ssl-google-analytics.com>
, but I cannot see the request body? Does GA4 intentionally hide this information for privacy reasons, or is there some extra option I have to enable? I also know that using proxy is not recommended way of validating GA4 events, but this requirement from the marketing team. 🤷‍♂️
g

gildor

07/14/2022, 3:17 PM
It's a strange requirement, because you cannot really know when GA will send events, it creates batches If you want 100% check end to end, it's better to use Firebase analytics Debug View which shows all events received from particular client
Anyway, you can do this, you should configure ssl proxy with own certificate, google "Charles ssl proxy"
d

Dean Djermanović

07/15/2022, 1:14 PM
Yes, they are aware that events are sent in batches, but they still want to be able to inspect them using Charles. 🤷‍♂️
you should configure ssl proxy with own certificate, google “Charles ssl proxy”
I did that, that’s the reason I’m able to see the requests in the first place. The problem is that I don’t see the request body (event name, parameters, etc.). It’s the same on the iOS side. That’s why I’m assuming that GA4 intentionally hides this information for privacy reasons, but I didn’t find anything in the GA4 documentation that confirms that. They just say that it’s not recommended to use proxy, not that you cannot use proxy.
g

gildor

07/15/2022, 1:18 PM
So what is content? Maybe it's just gzipped content?
But why do they want to do this in Charles? Really strange requirement
d

Dean Djermanović

07/15/2022, 1:28 PM
This is what I see in Charles:
And the error message that I see when I click on
<unknown>
says:
Copy code
SSL handshake with client failed: An unknown issue occurred processing the certificate (certificate_unknown)
However, I didn’t even see the requests before I added the certificate, so I wouldn’t say that the problem is in the certificate itself.
d

Dean Djermanović

07/15/2022, 2:17 PM
Yup, I added that. Never mind, I’ll keeping investigating this. Thanks for your help.
g

gildor

07/15/2022, 3:15 PM
Maybe the domain is wrong in config?
d

Dean Djermanović

07/18/2022, 8:25 AM
I double checked everything. One thing I haven’t mentioned is that we don’t use GA directly, we use 3rd party library which reports events to google analytics. Maybe that could be the problem. 🤔
g

gildor

07/18/2022, 9:30 AM
It doesn’t look like that, just as some Charles proxy
Do you have access to raw body response?
d

Dean Djermanović

07/18/2022, 10:00 AM
No. Actually, I think I don’t see requests at all. I should be able to see them in the Network Inspector in Android Studio as well, right? I guess the requests I saw in Charles sent to google analytics were from some other app.
g

gildor

07/19/2022, 6:10 AM
I should be able to see them in the Network Inspector in Android Studio as well, right
No, I don’t think so
Network Inspector works not on level of network, it works on level of your application and only with HttpUrlConnection and OkHttp
What kind library do you use? Because I have feling that Firebase Analytics doesn’t even work through google-analytics.com and there is no google analytics outside of Firebase for Android
d

Dean Djermanović

07/19/2022, 10:32 AM
We use an internal library that simply serves as a wrapper around different analytics services.
g

gildor

07/19/2022, 10:38 AM
But it uses Firebase/GA under the hood anyway
163 Views