Search code examples
androidgoogle-analyticsgoogle-analytics-api

Google Analytics API for Android and using Tracker#send


So I was looking through the Javadocs for com.google.analytics.tracking.android.Tracker and noticed that send(java.lang.String, java.util.Map) was public. Without knowing what the Map should look like for any particular HitType I'm not sure how this might be used. I was curious if anyone had found a use for this.


Solution

  • In general, You do not need to use this method. There are helper methods that let you send various hits with all the supported properties.

    The reason this exists is so that you can send some of the parameters that are not yet documented. This usually happens when we add some new parameter that can be sent but is not supported by old SDK. In that case, you would create a map and pass it to the send method. As you pointed out, there is no information on how to use this because there is no use case till now. If we do find a need for it, It will be documented.

    See the javadocs and the "Dev Guide" section in https://developers.google.com/analytics/devguides/collection/android/v3/ for more details.