Firebase Analytics - android

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

Related

Logging events via Firebase with GA4 in Android

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?

Firebase ITEM_NAME not visible in Analytics dashboard

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

Where to check Fire-base values send from firebase analytics [duplicate]

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}]

Android - Facebook Event track Purchase

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 ...

How to Authenticate with Alexa Voice Service from Android?

I am trying to connect to Alexa Voice Service from an Android app following the directions on this page: https://developer.amazon.com/public/solutions/alexa/alexa-voice-service/docs/authorizing-your-alexa-enabled-product-from-an-android-or-ios-mobile-app
Bundle options = new Bundle();
String scope_data = "{\"alexa:all\":{\"productID\":\"" + PRODUCT_ID +
                    "\", \"productInstanceAttributes\": {\"deviceSerialNumber\":\"" + PRODUCT_DSN + "\"}}}";
options.putString(AuthzConstants.BUNDLE_KEY.SCOPE_DATA.val, scope_data);
options.putBoolean(AuthzConstants.BUNDLE_KEY.GET_AUTH_CODE.val, true);
options.putString(AuthzConstants.BUNDLE_KEY.CODE_CHALLENGE.val, CODE_CHALLENGE);
options.putString(AuthzConstants.BUNDLE_KEY.CODE_CHALLENGE_METHOD.val, "S256");
mAuthManager.authorize(APP_SCOPES, options, new AuthorizeListener());
First, I don't know what APP_SCOPES should be. I set it to:
protected static final String[] APP_SCOPE = new String[]{"profile", "postal_code"};
but I get an error from the server
AuthError cat= INTERNAL type=ERROR_SERVER_REPSONSE - com.amazon.identity.auth.device.AuthError: Error=invalid_scope error_description=An unknown scope was requested
What am I doing wrong and how can I do this right?
The APP_SCOPE is : "alexa:all"
The PRODUCT_DSN can be anything you want, "1234" as per suggestion from Joshua Frank (https://forums.developer.amazon.com/forums/message.jspa?messageID=18973#18973)
The PRODUCT_ID is the ID in the AVS Developper Portal (https://developer.amazon.com/edw/home.html#/avs/list)
The CODE_CHALLENGE the Client Secret in the Security Profile of your application (should be already hashed in S256)
The problem is not with the APP_SCOPES variable, it is actually with the PRODUCT_ID, PRODUCT_DSN variables passed in the scope data.
I faced this exact same issue and have raised a query in amazon developers forum on what needs to be passed in those variables - Alexa authentication issue using beta SDK
Once the PRODUCT_ID, PRODUCT_DSN & CODE_CHALLENGE variables are determined then the authentication should be pretty much straight forward.
The APP_SCOPE should be "alexa:all"

Categories

Resources