I am implementing Firebase Analytics in my app.
Everything works fine, I am getting the logged events in my Firebase console, but I am having trouble with the bundle data (Params) that are passed during the logging of event.
Bundle bundle = new Bundle();
bundle.putString(FirebaseAnalytics.Param.VALUE, "event Value");
firebaseAnalytics.logEvent(FirebaseAnalyticsConstants.ON_VIEW_EVENT, bundle);
I want to differentiate based on the VALUE param.
The VALUE parameter is meant to be numeric. See the documentation on it here.
Of course, you can log any custom parameter you want with your event, but parameter reporting is only currently offered on a subset of suggested events. Alternatively, you can query your raw events, parameters and user properties if you link your app to BigQuery.
I faced same issue:
//pass this code in any click event or anywhere.
FirebaseAnalytics firebaseAnalytics = FirebaseAnalytics.getInstance(this);
Bundle bundle = new Bundle();
bundle.putString("Category",category);
bundle.putString("Screen",Screen);
firebaseAnalytics.logEvent("MyCustomEvent",bundle);
Pass this command for track:
adb shell setprop log.tag.FA VERBOSE
adb shell setprop log.tag.FA-SVC VERBOSE
adb logcat -v time -s FA FA-SVC
not when your app is send event log you will see logs. Custom tag i used android studio's emulator. Geny motion set SDK path from Genymotion: settings-> ADB.
Note: After 15-20 minutes open firebase console, see right side and select today. you will find your custome event.
Try this snippet code
findViewById(R.id.tvOrderTitle).setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
String strClickLogs;
Bundle params = new Bundle();
params.putString("mobileno", logMobileno);
params.putString("name", logName);
params.putString("email", logEmail);
strClickLogs = "Eventlogs_Generated";
Log.e(TAG, strClickLogs);
//Logs an app event.
mFirebaseAnalytics.logEvent(strClickLogs, params);
}
});
You can see genrated logs in verbose in Logcat as below format:
V/FA-SVC: Logging event: origin=app,name=Eventlogs_Generated,params=Bundle[{mobileno=9876543210, firebase_event_origin(_o)=app, firebase_screen_class(_sc)=SupplierListActivity, firebase_screen_id(_si)=7001228486350086694, name=Ashish Tikarye, email=ashisht#set.com}]
Related
In this manual Get started with Google Analytics there is a section "Start logging events":
Java code
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);
Kotlin code:
firebaseAnalytics.logEvent(FirebaseAnalytics.Event.SELECT_ITEM) {
param(FirebaseAnalytics.Param.ITEM_ID, id)
param(FirebaseAnalytics.Param.ITEM_NAME, name)
param(FirebaseAnalytics.Param.CONTENT_TYPE, "image")
}
Questions:
Confusing between FirebaseAnalytics.Event.SELECT_CONTENT in Java the code and FirebaseAnalytics.Event.SELECT_ITEM in the Kotlin code.. The both parameters are different (SELECT_CONTENT vs SELECT_ITEM). Webpage about events: https://firebase.google.com/docs/analytics/events is Service Unavailable.
When I go to the: Firebase -> Analytics -> Events -> select_content: there is: Events in last 30 minutes. I cannot list of all events. I don't see the values of selected event.. I don't see all the select_content events includes values.
I tried to create custom dimension in Custom definitions, I waited 24 hours and I still don't know where to see the event.
Do you know, how to show all Events with values reported by FirebaseAnalytics.Event.SELECT_CONTENT ? Like in old Firebase before update? This is image of the old Firebase select_content:
The new Firebase logging events is not clear at all to me.
Similar post with unaswered good question:
Do you mean that you can get report for some type of select_content event by item_id? Did you try this?
I am trying to see which parts of my app are most used, for this I have added a logEvent like this:
Bundle bundle= new Bundle();
bundle.putString(FirebaseAnalytics.Param.ITEM_CATEGORY, "action");
bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, "screen_a");
FirebaseAnalytics.getInstance(context).logEvent(FirebaseAnalytics.Event,VIEW_ITEM, bundle);
The events get logged and I can see in my Dashboard under Events section a view_item entry with the Count, however, when I enter it, I can see the counts, meaning values, but I can't see any values like "screen_a" or "screen_b"...
Since these are not custom events, shouldn't the values be available in the dashboard?
I got the same question as you. By asking email to firebase team, they replied the exact method to watch the log of item_name. Below are the example, I logged an ITEM_NAME "action_getProVersion" with ECOMMERCE_PURCHASE event:
log event in your codes: (You have done this)
Bundle bundle = new Bundle();
//bundle.putString(FirebaseAnalytics.Param.ITEM_ID, itemId);
bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, "action_getProVersion");
//bundle.putString(FirebaseAnalytics.Param.CONTENT_TYPE, "image");
mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.ECOMMERCE_PURCHASE, bundle);
On the firebase event screen, press on the right side,for event "Edit parameter reporting", then add "item_name" and save. (it looks you haven't done this)
After a while, let it log from users event. You will see the events logged with parameter "ITEM_NAME" as the attached screenshot
To Log event in firebase use the code below:
private FirebaseAnalytics mFirebaseAnalytics;
mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);
Bundle bundle = new Bundle();
bundle.putString(FirebaseAnalytics.Param.ITEM_ID, getString(R.string.title_activity_quotes));
bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, "ShareButton");
bundle.putString(FirebaseAnalytics.Param.CONTENT_TYPE, "image");
mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.SELECT_CONTENT, bundle);
Add item_name in event page of firebase
Then You can debug from android studio or wait sometime to occur the event, then check in the select_content event in firebase
firebase select-content streamview
I try configure GTM for GA account, but I have minor problems.
Screen trigger+tag work almost fine(can't setup secondary dimensions)
Simple Events are not logged
I don't know which couples in "Fields to Set" must be setted. Could you help me with example?
Screen handler:
Bundle params = new Bundle();
params.putString("screenName", screenName);
params.putString("screenID", "LOL");
getFirebaseAnalytics().logEvent("openScreen", params);
Event
private void send(String category, String action, String label, int value, String videoPart) {
Bundle params = new Bundle();
params.putString("Category", category);
params.putString("Action", action);
params.putString("Label", label);
params.putString("Label", label);
params.putString("video_part", videoPart);
params.putInt("Value", value);
getFirebaseAnalytics().logEvent("event", params);
}
variables
#eric-burley please help me
edit
D/GAv4: Hit delivery requested: ht=1477299734728, _s=160, _v=ma9.8.77, a=1587067812,
aid=com..., an=...DEV, av=1.43.-1, cd2=video_part,
cid=9b2a1e0d-ec4d-48b6-87e9-69eafa40887d, ea=Action, ec=Category, el=Label, ev=Value,
ni=false, sr=1080x1776, t=event, tid=UA-XXXXXXX-20, ul=eng, v=1
Based on your logs it looks like the event is getting logged to Google Analytics by Google Tag Manager. Google Analytics is likely discarding the event because the event value parameter (ev) is required to be a positive integer. I would try using a numerical constant like 42, or removing the event value parameter.
Do you see any logs from Google Analytics or Google Tag Manager when reporting the screen view? It helps to ensure that both are logging verbosely:
adb shell setprop log.tag.GAv4 DEBUG
adb shell setprop log.tag.GoogleTagManager VERBOSE
I am integrating Firebase analytics in my android app but I cant see in documentation or google how I can add a test device so It doesn't count on stats.
I test a lot, so my main stats will be corrupted if it counts my own events
In admob I do
AdRequest adRequest = new AdRequest.Builder()
.addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
.addTestDevice("70A9E11F73EREFF712A1B73AE2BC2945")
.addTestDevice("1D18F0345E4C90E3625DB344BE64D02E")
.build();
You can add device with adb command:
adb shell setprop debug.firebase.analytics.app packageName
I solved it with a new audience in Firebase Console with filter:
User Properties / App Store + "does not contain" + "manual_install"
I figured it out that all direct app installs and also all Firebase Test Lab installs falls into this parameter.
If you want to remove only a few users then you could add this filter (haven't tried it):
User Properties / User ID + "not equal to" (or "does not contain") + your_ID
This only works in Firebase Analytics and only with events that happened after audience was created.
For BigQuery I use the following query to exclude the testing devices:
SELECT
user_dim.user_id AS userId,
FORMAT_UTC_USEC(user_dim.first_open_timestamp_micros) AS tsFirstOpen,
user_dim.device_info.device_category AS dCaterogy,
user_dim.device_info.mobile_brand_name AS dBrand,
user_dim.device_info.device_model AS dModel2,
user_dim.device_info.platform_version AS dOSver,
user_dim.device_info.user_default_language AS dDefLanguage,
user_dim.geo_info.continent AS geoCont,
user_dim.geo_info.country AS geoCounty,
user_dim.app_info.app_version AS appVer,
FROM
TABLE_DATE_RANGE(YOUR_TABLE_NAME.app_events_, TIMESTAMP('2016-06-23'), TIMESTAMP('2016-10-01'))
WHERE
// Remove all testing devices
NOT (user_dim.user_id == "YOUR_USER_ID" OR
user_dim.user_id == "YOUR_USER_ID") AND
NOT user_dim.app_info.app_store == "manual_install" AND
user_dim.user_properties.key == "first_open_time"
GROUP BY
tsFirstOpen,
userId,
dCaterogy,
dBrand,
dModel2,
dOSver,
dDefLanguage,
geoCont,
geoCounty,
appVer
ORDER BY
appVer DESC,
tsFirstOpen DESC
I am trying to integrate Firebase RemoteConfig and Analytics with my Android application. Remote configuration part is working but Analytics part is not working. Here is my build.gradle
// Firebase configuration
compile group:'com.google.firebase', name:'firebase-core', version: '9.4.0'
compile group:'com.google.firebase', name:'firebase-config', version: '9.4.0'
// Firebase analytics
compile 'com.google.android.gms:play-services-analytics:9.4.0'
Here is my Activity code.
FirebaseAnalytics firebaseAnalytics = FirebaseAnalytics.getInstance(this);
firebaseAnalytics.setUserId("5107611364");
firebaseAnalytics.setUserProperty("custom_user_property", "custom_user_proerty_value");
Bundle bundle = new Bundle();
bundle.putString(FirebaseAnalytics.Param.ITEM_ID, "SomeID");
bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, "SomeIDName");
bundle.putString(FirebaseAnalytics.Param.CONTENT_TYPE, "IdType");
firebaseAnalytics.logEvent(FirebaseAnalytics.Event.SELECT_CONTENT, bundle);
I am trying to publish customer property as well as the event but both of them are not working. I have enabled adb logging and I can see that custom event and property are published. These do not appear on the Firebase Analytics console even after 24hrs. I don't know what is wrong.
#Rakesh - you are looking in the wrong location. You are supplying customID feilds, in your example you are supplying CONTENT_TYPE : IdType. You don't need a minimum of 10 users to see the data...if you only have 1 user that data will appear within 24 hours of that user using your app.
I will say this, initially finding your own custom IDs is not very straight forward...it took me a while to find it too.
The place to find that custom reported info is: Anaylytics - Events - once on this page, click on the actual CONTENT_TYPE you are wishing to track, in your example above, it would be idType
Then on the Content graph you will see your customIDs (ie: someID)...click on someID. In my case (and in my screenshots) my equivelant someIDs are "field, button & select"
and then you will see all the data related to the values (someIDName) you passed into someID.
Now, if idType is not appearing for you then that may because Firebase isn't allowing you to create your own CONTENT_TYPE, I am not certain if you can do that as I have not tried...and in that case you would need to use a predefined CONTENT_TYPE. I am not using a custom idType, I am using CONTENT_TYPE : select_content.