How to send hashmap or json with google analytics in android - android

I want to send hashmap of values related to event using Google Analytics. I want to know it is possible or not nothing is mentioned in Google analytics documentation for it most of the analytics tools allow sending either hashmap or json don't see any option available in Google analytics.
Currently I am using custom dimensions to achieve this but this isn't meeting my requirements I want to know is it possible to send hashmap or json using GA and how

after get reference to your tracker build an event with desired data , I think this enough number of columns to send your data
Field Name Type Required Description
Category String Yes The event category
Action String Yes The event action
Label String No The event label
Value Long No The event value
Tracker t = ((AnalyticsSampleApp) getActivity().getApplication()).getTracker(
TrackerName.APP_TRACKER);
// Build and send an Event.
t.send(new HitBuilders.EventBuilder()
.setCategory(getString(categoryId))
.setAction(getString(actionId))
.setLabel(getString(labelId))
.build());
reference
https://developers.google.com/analytics/devguides/collection/android/v4/events
Update
if you are using Firebase Analytics event give your more feasibility to add data via bundle
Bundle bundle = new Bundle();
bundle.putString(FirebaseAnalytics.Param.ITEM_ID, id);
bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, name);
bundle.putString(FirebaseAnalytics.Param.CONTENT_TYPE, "image");
mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.SELECT_CONTENT, bundle);
if you need custom event with custom params
Bundle params = new Bundle();
params.putString("image_name", name);
params.putString("full_text", text);
mFirebaseAnalytics.logEvent("share_image", params);
but note
Custom parameters: Custom parameters are not represented directly in
your Analytics reports, but they can be used as filters in audience
definitions that can be applied to every report.
reference https://firebase.google.com/docs/analytics/android/events

Related

How to view Firebase event parameter values?

I have integrated Firebase Analytics in my project. I am logging around 10 different events. I can see all these events on the dashboard.
The issue is I am unable to see parameter values of the event.
Ex.
Bundle bundle = new Bundle();
bundle.putString(AppConstants.PARAM_USER_ID, getUserId());
bundle.putString(AppConstants.PARAM_OFFER_ID, itemDetails.getId());
bundle.putString(AppConstants.PARAM_OFFER_TITLE, itemDetails.getTitle());
FirebaseAnalytics mFirebaseAnalytics = FirebaseAnalytics.getInstance(activity);
mFirebaseAnalytics.logEvent("View_Item", bundle);
As per the above code, I can see the event named "View_Item" on the dashboard. But I can't see the details insight of each event's parameters like userId, item_id and offer title, etc.
Is there any way to see parameter values that?
Que 2. How long text parameter value can support?
Because I tried to log the event in Fabric with over 3k char. In this case, the content was getting cut and there no way to expand the full content in Fabric.
Is this same issue with Firebase?

Firebase Custom event - firebase parameters not visible in dashboard

I'm making an Android game, where I want to track with Firebase Analytics, how users spend their different ingame currencies. For this, I wrote the following method:
public void trackInAppUpgrades(String id, int upgradePrice, String currencyName) {
Bundle bundle = new Bundle();
bundle.putString(FirebaseAnalytics.Param.ITEM_ID, id);
bundle.putDouble(FirebaseAnalytics.Param.VALUE, (double)upgradePrice);
firebaseAnalytics.logEvent(currencyName, bundle);
}
I've used predefined parameters like ITEM_ID and VALUE and send the event with the name of my currency, as there are several currencies and I want to distinguish them as separate events.
However, when I look at the firebase console and select the event from events, I do not see the parameters I have added to this event:
24hours have passend and there isn't more to see. I've read in the documentation that custom parameters will not show up in the report, but what about custom event with prescribed parameters?
Do I really need to use the predefined events by Google to see any parameters I want to track?

Firebase share event : can't see item id and content type in console

I'm trying to use Firebase analytics in my Android app.
In the documentation, it is recommended to use events defined in the SDK as the integrate better in the Firebase console. Each type of event has some associated attributes, defined (in documentation and support).
I have tried to use 2 types of events so far SELECT_CONTENT and SHARE. Here is my code :
//Reporting a content
Bundle bundle = new Bundle();
bundle.putString(FirebaseAnalytics.Param.ITEM_ID, "Day" + Integer.toString(position));
bundle.putString(FirebaseAnalytics.Param.CONTENT_TYPE, "daily_page");
mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.SELECT_CONTENT, bundle);
//Reporting a share
Bundle bundle = new Bundle();
bundle.putString(FirebaseAnalytics.Param.ITEM_ID, socialNetwork.getName() + "_" + themeAnalytics);
bundle.putString(FirebaseAnalytics.Param.CONTENT_TYPE, "daily_image");
mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.SHARE, bundle);
In the analytics console, I can see a nice "Content" chart when the event type selected is "select_content". However, when the event type selected is "share", this chart is not visible.
The number of events differ widely. There are a few thousands "content_type" events but only a dozens of "share" events. So I was wondering whether this could be a explanation.
The only difference between the values I send is that the ITEM_ID of the share event contains an underscore, but I doubt that it causes the problem.
Has anyone experienced this situation ?

Firebase event count increase but value is empty

I used Google's sample for log events in Firebase.
FirebaseAnalytics fba = FirebaseAnalytics.getInstance(getContext());
Bundle bundle = new Bundle();
bundle.putString("name", "value");
fba.logEvent("event_name", bundle);
and it's working fine, but it just add counts and the value is always empty.
It seems for using custom events , We must upgrade to higher plans and link firebase account with Bigquery to show detailed events

Firebase events not showing NAME attribute

I have uploaded an app with firebase analytics, however, the SELECT_CONTENT events are not showing "Not set" as name, instead of the name i specified during development.
here's one of the events i set on code:
Bundle bundle = new Bundle();
bundle.putString(FirebaseAnalytics.Param.ITEM_ID, "4");
bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, "ClickedShareSocialMedia");
mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.SELECT_CONTENT, bundle);
Any help?
Looks like you forgot to set the FirebaseAnalytics.Param.CONTENT_TYPE parameter.
You get reporting on both the CONTENT_TYPE (i.e. category) and the ITEM_NAME. The "(not set)" you are seeing is in reference to the CONTENT_TYPE. Once you specify a CONTENT_TYPE, you'll be able to drill into each type of content to see the most important items in each category.

Categories

Resources