setDimension in PluginGoogleAnalytics not work!

setDimension in PluginGoogleAnalytics not work!
0

#1

Hello,
I have problem with PluginGoogleAnalytics v2.4.2.0 in cocos creator,the function “logEvent” work correctly but function “setDimension” not work,i not see data of custom dimension on google analytics events.
I’m thing this issue due plugin implement incorrect because custom dimension must be a addition param for a event before send to server,here guide from google:
https://developers.google.com/analytics/devguides/collection/android/v4/customdimsmets

and used in plugin,i think 2 function not linked dimension to event:
sdkbox.PluginGoogleAnalytics.logEvent(eventCategory,
eventAction,
eventLabel,
value);
sdkbox.PluginGoogleAnalytics.setDimension(index, value);

So anyone have same problem ? and how to fix ?


#2

PluginGoogleAnalytics::logEvent(“EventCategory 1”, “EventAction 1”, “EventLabel 1”, 10);

The setCustomDimension should be use with setScreenName ?

// Get tracker.
Tracker t = ((AnalyticsSampleApp) getActivity().getApplication()).getTracker(
    TrackerName.APP_TRACKER);
t.setScreenName("Home Screen");

// Send the custom dimension value with a screen view.
// Note that the value only needs to be sent once.
t.send(new HitBuilders.ScreenViewBuilder()
    .setCustomDimension(1, "premiumUser")
    .build()
);

If yes, I think we need to change the

static void setDimension(int index, const std::string& value);

to

static void setDimension(int index, const std::string& value, const std::string& screenName);

#3

Hi,
That is an example, not necessarily setScreenName, but it must be added to an event ,screenView…before being sent to the server.Here guide
"
Custom dimension values can be sent with any Google Analytics hit type, including screen views, events, ecommerce transactions, user timings, and social interactions. The defined scope of the custom dimension will determine, at processing time, which hits are associated with the dimension value."