I have application which use Firebase SDK and used some predefined event and parameters but some parameters are automatically added but not all parameters
For example Add to cart event
Android :
bundle.putString(FirebaseAnalytics.Param.ITEM_CATEGORY, params.get("item_category").toString());
bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, params.get("item_name").toString());
bundle.putString(FirebaseAnalytics.Param.ITEM_LOCATION_ID, params.get("item_location_id").toString());
bundle.putString(FirebaseAnalytics.Param.CURRENCY, params.get("currency").toString());
bundle.putDouble(FirebaseAnalytics.Param.VALUE, ((Number) params.get("value")).doubleValue());
bundle.putString(FirebaseAnalytics.Param.COUPON, params.get("coupon").toString());
bundle.putString(FirebaseAnalytics.Param.ITEM_ID, params.get("item_id").toString());
bundle.putLong(FirebaseAnalytics.Param.QUANTITY, ((Number) params.get("quantity")).longValue());
this.firebaseAnalytics.logEvent(FirebaseAnalytics.Event.ADD_TO_CART, bundle);
IOS
[FIRAnalytics logEventWithName:kFIREventAddToCart parameters:#{
kFIRParameterItemCategory:[parameters valueForKey:#"item_category"],
kFIRParameterItemName:[parameters valueForKey:#"item_name"],
kFIRParameterItemLocationID:[parameters valueForKey:#"item_location_id"],
kFIRParameterCurrency:[parameters valueForKey:#"currency"],
kFIRParameterValue:[parameters valueForKey:#"value"],
kFIRParameterCoupon:[parameters valueForKey:#"coupon"],
kFIRParameterItemID:[parameters valueForKey:#"item_id"],
kFIRParameterQuantity:[parameters valueForKey:#"quantity"]
}];
In dashboard, We can see only item_name and value. please help.... thanks in advance
I'm supposing that your params object is a composed array with the similar values
{
"item_category" : "t-shirts",
"item_name" : "abc",
"item_location_id" : "ChIJiyj437sx3YAR9kUWC8QkLzQ",
"currency" : "USD",
"value" : 3.99,
"coupon" : "zz123",
"item_id" : "p7654",
"quantity" : 1
}
If that is the case then you are in the right way to create the event. But you are trying to see the event values in the Parameter Reporting section in the Firebase Console. I analysed based on the image you attached.
If you want to see the event values I recommend check the event dashboard report by clicking on the event name instead of the tab Parameter Reporting, follow this link, it shows you an example of how Firebase Events are organized in the Dashboard Console.
I hope this helps you.
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?
UPDATE:
Ok so from all the comments I got convinced that using Firebase is the best solution for a number of reasons but how would I check for that change (canceled == yes) in my json file from firebase and automatically send the notification if the course is canceled.
Sample JSON response:
{
"class" : "Class",
"time" : "00:00",
"trainer" : "T",
"canceled" : ""
},
{
"class" : "Class",
"time" : "00:00",
"trainer" : "T",
"canceled" : ""
}
INITIAL QUESTION
I am parsing a json api and one of the fields is called canceled.
I would like my app to set a notification whenever that canceled key has a value of yes and so far it's easy, just create a simple notification like in the android developer topic and if canceled == yes update the Builder and then notify();.
The issue here is how can I keep checking for changes in the json after the app has been closed and set the notification ?
I have access to the server and make changes to the api if required.
Can I do this without the help of any third party services?
As #Sujal mentioned With Android O you have restriction on running background service for a long time. So It's better move this thing to server side. Whenever there is a change in the status i.e. Whenever key canceled becomes yes send a notification to android device which would show the Notification.
Ref : https://firebase.google.com/docs/cloud-messaging/
Ref : https://www.codementor.io/flame3/send-push-notifications-to-android-with-firebase-du10860kb
I am trying to track few events of enhanced ecommerce which is to be reported in Google Analytics. I am following this link. But I am not able to see purchase data in Google analytics. My dataLayer push code is something like below:
dataLayer.push("ecommerce",
DataLayer.mapOf(
"purchase", DataLayer.mapOf(
"actionField", DataLayer.mapOf(
"id", "T12345",
"revenue", "35.43",
"coupon", "SUMMER_SALE"),
"products", DataLayer.listOf(
DataLayer.mapOf(
"name", "Triblend Android T-Shirt",
"id", "12345",
"price", "15",
"category", "Apparel",
"quantity", 1)))));
And and Tag creation is something like below:
Tag type : Universal Analytics
Track type : Screen View (App View)
Enable Enhanced Ecommerce Features: true
Use Data Layer: true
Firing Rule : {{event}} equals screen_opened and PageTitle equals Payment
Here after I push this purchase tags, I send screen_opened event with PageTitle value as Payment. And in the logs it shows that this appView event is tracked and hit is sent to AnalyticsService.
But I am not seeing any purchase report in the Analytics dashboard (I waited 2-3 days). I am seeing all other reports like screen_opened and other enhanced ecommerce events like add to cart. Is there something which I am missing in my implementation?
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.
I'm working on implementing the Facebook tracking of Purchase event in Android. I followed the guide here https://developers.facebook.com/docs/app-events/android, and made a custom Bundle to send to FB.
The problem is, on the Facebook page of events, I don't see the Value column updated for the Purchase event.
This is the code:
Bundle parameters = new Bundle();
parameters.putString(AppEventsConstants.EVENT_PARAM_CURRENCY, mCurrency);
parameters.putString(AppEventsConstants.EVENT_PARAM_CONTENT_TYPE, mProductType);
parameters.putString(AppEventsConstants.EVENT_PARAM_CONTENT_ID, mPurchaseID);
Double valueToSum = 12.042289; //this is how the price looks like
AppEventsLogger logger = AppEventsLogger.newLogger(this);
logger.logEvent(AppEventsConstants.EVENT_NAME_PURCHASED, valueToSum, parameters);
My problem is that, the valueToSum does not sum in the Facebook Events page. It's always shown as "-".
Any ideas what I am actually doing wrong?
Much appreciated.
It takes a while for the data to update on the dashboard. Try checking it the next day or so ...