We successfully set up Google Analytics via SDKBox for both Android and iOS, but for Android, our custom dimensions are not included as parameters in the event logs. As a result, we cannot filter these events by our custom dimensions.
- Cocos Creator 2.2.0
We set the custom dimension like this when the game loads:
And log events like this afterwards:
sdkbox.PluginGoogleAnalytics.logEvent(trackValue.eventCategory, trackValue.eventAction, trackValue.eventLabel, trackValue.eventValue);
When debugging Google Analytics, we can see
Hit delivery requested: ... cd7=Android when the dimension is set. For an event, the hit delivery requested includes values for
ev, but does not include
According to this page:
“Unlike other types of data, custom dimensions and metrics are sent to Analytics as parameters attached to other hits, like pageviews, events, or ecommerce transactions. As such, custom dimension or metric values need to be set before a tracking call is made in order for that value to be sent to Analytics.”
Indeed, when I look at the network calls made for Google Analytics on our web version, every event tracking includes the custom dimension values as well. In addition, the dimension values, set in the exact same way as Android, appear for all iOS events.
Does anyone know how we can include custom dimensions for event tracking in Android? Hopefully while still using SDKBox? Thanks!