I have the same issue as this thread but the answer is outdated and seems to be incorrect. It refers to a button "Add event parameters" which is not present in the current version of firebase.
I want to view the content of the bundle for the event on my Firebase event page. Here is my event page on firebase:
I've followed this firebase tutorial and here is my code:
private fun sendLogging(context: Context, source: String, logMessage: String) {
val bundle = Bundle()
bundle.putString("LOG_MESSAGE", "$source $logMessage")
FirebaseAnalytics.getInstance(context).logEvent("PUSH_CONTENT_NOT_RECEIVED", bundle)
}
The source and logMessage contain precise information about what went wrong and I need to view this. It should show up?
EDIT:
I went to "Custom Definitions":
And I've added the event:
I discovered that only from that moment it started collecting information. But I do not see the information that I've logged anywhere. Where is it?
Adding LOG_MESSAGE to the Custom Definitions as an event-scoped custom dimension is the correct direction. You can follow the "Create a custom dimension" on the "[GA4] Custom dimensions and metrics" page.
GA4 limits the length of event parameter names & event parameter values. See [GA4] Collection and configuration limits for more information. In your case, LOG_MESSAGE is the event parameter's name (limited to 40 characters), and the runtime value of "$source $logMessage" is the event parameter's value (limited to 100 characters).
If "$source $logMessage" needs to be more than 100 characters, you could make the source and logMessage separate event parameters. For example, you'd update your code to:
bundle.putString("LOG_MESSAGE_SOURCE", source)
bundle.putString("LOG_MESSAGE_VALUE", logMessage)
Then, you would register LOG_MESSAGE_SOURCE and LOG_MESSAGE_VALUE as two event-scoped custom dimensions, and each would be limited to 100 characters individually.
Thanks,
Brett Sneed
The Google Analytics Team
Try adding the LOG_MESSAGE under Custom Definitions as an event or user custom dimension, this now available from the menu on the left in the Analytics section.
Custom Definitions Image
Related
I have added Firebase Analytics events to my android app, and when I tested it with DebugView, I could clearly see the events and all their properties.
However, after launching the app, I can only see the events themselves, and the properties are missing.
I'm using :
val props = mutableMapOf<String, Any>()
props["test key"] = "test value"
Firebase.analytics.logEvent("action_test", props.toBundle())
As stated above, it works perfectly fine when I test it using the DebugView in Firebase console.
But when I go to Events sections, and click on some event, and then go to add filter, I cannot see the event properties.
The only thing I see is in that page, some statistics like the total number of events, etc.
In Firebase under "Analytics" click on "Events". Then click on the specific event you want to see the parameters of.
In your example the event name is "action_test", the parameter name is "test_key", the parameter values are the values of the map.
Now click on "action_test" in Events. It will open a detailed view for the event. Some cards will have as the title the name of the parameter.
It will take some time before the events are shown. Can be up to a couple of hours.
I found how use GTMv4 for GA and GTMv5 for FA, but no any information for v5+GA (for web side little bit more information).
is the correct replacement(in each case)?
Case 1:
Bundle params = new Bundle();
params.putString("screenName", screenName);
params.putString("screenID", screenID);
df.logEvent("openScreen", params);
from
getDefaultTracker().setScreenName(screenName);
getDefaultTracker().send(new HitBuilders.ScreenViewBuilder()
.setCustomDimension(3, screenID);
Case 2:
Bundle params = new Bundle();
params.putString("category", getCategory());
params.putString("action", getAction());
params.putString("label", getLable());
params.putInt("value", 0);
params.putString("name", "start");
df.logEvent("event", params);
from
getDefaultTracker().send(new HitBuilders.EventBuilder()
.setCategory(getCategory())
.setAction(getAction())
.setLabel(getLable()))
.setValue(0)
.setCustomDimension(2, "Start")
.build());
So, how need configure tag? In manual for v4->ga we have Variable type "Data Layer Variable".What is analog for GTMv5?
Also, where I could get all key for bind data?
img from manual v4, but i can't find similar information in v5
From manual:
Event Name: The value is set to "eventNameXYZ" when the following code in your app is executed:
Android:
FirebaseAnalytics.getInstance(mContext).logEvent("eventNameXYZ", null);
but how to set value? I can create only "new variable" with "Title". Or need set name equal key, e.g. "eventNameXYZ"?
Secondary Question:
It possible to use GTM+Firebase for save data in local storage?
Update
aghhhr, why divided radio buttons? + Custom parameter looks like hint :(
If you're trying to send Universal Analytics hits from firebase, then case 1 and case 2 both look correct, though you might want to be more specific about the name of the event in case 2. If the event you're recording is equivalent to one of the suggested Firebase Analytics events, then consider using that as the event name, instead of the more generic name event.
To setup a GA tag to fire for these logEvent calls, you'll want to create "Event Parameter" variables for each of the event parameters you're using. For example, to capture the screen name you're including in case 1, you would setup an EventParameter like this:
For the tag setup, you just use the screenName variables as the values in fields to set, event variables, or custom dimensions. For screen views, be sure to provide a screen name, as it's required for a screen view.
To trigger the Universal Analytics tag, you would setup a trigger for event name. In the first case, the trigger setup would look like this:
.
And to answer your second question, You can use Firebase user properties to store data in local storage, report it to firebase, and make it available to GTM via the Firebase User Property variable type.
I want to set user level custom variables using google analytics in android
I can see there is lack of documentation and demo for this I want to know how to set custom variable using GA and I am referring to following link
https://support.google.com/analytics/answer/2709828#scope
but it is not helpfull at all code given in it is not in java and very confusing
If anyone has proper sample related to it please share
And it is not clear at all how much time it will take to reflect these changes on GA dashboard there is no clarity while using google analytics.
Also there a sample a code given
// 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()
);
Now can anyone explain what is value 1 stands and it comes from where for in above call and why I need to call setScreenName
Also I have referred below link as well but does not give any clear idea
https://support.google.com/analytics/answer/2709829?hl=en&ref_topic=2709827
Also I tried to create custom variable I observed that one custom variable Demographic is already there I guess it is default created by GA so now my custom variable will start with index 2 or 1 that is also a confusion.
Custom Dimensions and metrics are identified by an index: 1 to n. The first Custom dimension you create will have an index of 1. Before you can send custom dimension and metric values to Analytics, they must first be defined in an Analytics property in the Analytics UI or through the Management API. Each Analytics property has 20 available indices for custom dimensions, and another 20 indices available for custom metrics.
The sample you used is sending a screen view hit (hence why it is setting the screen name) and sending a value to the first custom dimension. However you can send the information on any event type you'd like. For example:
// Get tracker.
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))
.setCustomDimension(1, "premiumUser") // Set the first custom dimension value to premiumUser for this event.
.build());
When you query for the value of the custom dimension with the Analytics Reporting API you will identify the custom dimension by index aswell, ga:dimension1.
Apart from registering in Android
Bundle().apply {
putString("Business", "NONE")
putString("PageVertical", "NONE")
FirebaseAnalytics.getInstance(context).setDefaultEventParameters(this)
}
Do not forget to register at Google Analytics UI
Custom parameters: Custom parameters can be used as dimensions or metrics in Analytics reports. You can use custom dimensions for non-numerical event parameter data and custom metrics for any parameter data better represented numerically. Once you've logged a custom parameter using the SDK, register the dimension or metric to ensure those custom parameters appear in Analytics reports. Do this via: Analytics > Events > Manage Custom Definitions > Create Custom Dimensions
Read more
I'm using Facebook analytics in my Android app to log app events - I'm seeing the correct tracking of app events and am able to view them in my Facebook App Analytics dashboard.
However, I have no idea where parameters that I attach to each event are displayed. Some of them are automatically summed and shown - for instance, purchases or other values. For other, string-based parameters, however, I'm unable to figure out where I can view them.
As an example:
Say every time something goes wrong in my app, I log an event named "Error". I then pass the parameter named AppEventsConstants.EVENT_PARAM_DESCRIPTION a string description - so this might be "App Crashed" or "No Internet Connection" or something. Let's say one of each happens.
When I go to view my analytics, I will correctly see that there have been two "Error" events. But now I want to know whether these were instances of "App Crashed" or "No Internet Connection" - presumably that's what the point of the parameters is. How do I do this? I've googled and clicked everything I can think of, but haven't found a way to see the parameter breakdown of an event.
I can confirm that it is troublesome to find and the name has been changed to "Breakdowns"...
Activity -> Breakdowns
click "Create New" in upper right
give the report a NAME
select the top level event from the EVENT pop-up
select one or more parameters to report on from the 3 BREAKDOWN
pop-ups (note that your custom parameters appear at the bottom of
these menus)
Yep, its not simple to find that information. You will need to use Segments in Facebook Analytics for that. Go to Segments and try creating a new segment. Define Condition Type as "Events". Then select the Event then you want to include. After that, select the option of "Refine". This will show you "Select a Parameter". Here you can select the parameter that you want to see and its value. Save this segment, and use it in any chart you want.
Unfortunately, that is the best way I have found, though it is not as straightforward as it should be.
I tried using the ways based on the answers provided here. But the fact is, it is tedious or going round the bush.
The answer is simple, just send the values and parameters wrapped inside "contents".
It will be visible on your analytics dashboard the same as standard events do.
var name = "Dhinesh";
var platformName = "flutter";
//custom event - fb analytics
fbq('trackCustom', 'FreeTrialPlatform',
// begin parameter object data
{
contents: [{
name: name,
platform: platformName
}],
content_type: 'product'
}
// end parameter object data
);
View in fb analytics
For your case like this,
var errorName = "App crashed";
fbq('trackCustom', 'TrackError', {
contents: [{
Error: errorName
}],
});
How can I attach a custom metric value to HitBuilders.TransactionBuilder in the following fashion? I want to associate a transaction with a value.
tracker.send(new HitBuilders.TransactionBuilder()
.setOtherAttributes(...)
.setCustomMetric(1, 10)
.build());
The rest of the data are successfully sent, but the custom metric is always 0.
It seems your code is correct. You can try to setCustomDimension instead of setCustomMetric, you only have to transform float to string.
Your code is correct. What you need to check is the server side reports you build.
Make sure you created a Custom metric in Admin - Custom Definitions - Custom metrics. Once created, custom metrics will initially appear with a 3 to 4 hours delay on the server. Give them some time to appear there. Finally, you need to create a report to see the result. Make sure you choose the right time intervals and don't add too many metric and filters, otherwise you won't see data. Make first reposts as simple as possible. I hope this helps.
The problem was with that the scope of the custom metric was not Hit and that I was looking at a custom report widget matched by Product. The value appeared when I changed the column.