I have just started using Firebase for my app analytics and I'm having some issues trying to view the parameters associated with my events. Upon logging into the console, selecting my app, then I select the iOS
version and I'm presented with the dashboard. All of that looks good. Then I select the Events
tab, and I see a list of all events that my app has logged. Again, this is all good. However, I want to be able to drill down and see reports based on the parameters that were passed with those events. in my iOS code I have the following:
[FIRAnalytics logEventWithName:kFIREventSelectContent parameters:@{
kFIRParameterItemID:@"some_item_id",
kFIRParameterContentType:@"some_content_type"
}];
I want to be able to see how many of these "select_content" events were from a particular "content_type". But I cannot figure out how to do that.
I tried creating an Audience
using "content_type" that I know I tested days ago, but my number of users is always at 0
. So I'm at a loss...how the heck do you see analytics for events based on the parameters that were supplied?
Honestly, the answer here didn't help me at all. I finally figured out that you have to manually add custom parameter reporting to each event. Here's a link to the docs.
https://support.google.com/firebase/answer/7397304?hl=en&utm_id=ad&authuser=0
And I guess in case this link dies, I'll add the steps below. This is just copy paste from the link.
Custom-parameter reporting Define custom parameters for your events.
Google Analytics for Firebase lets you specify up to 25 custom parameters per event (Android or iOS).
You can also identify up to 50 custom event parameters per project (40 numeric and 10 textual) to include in reporting by registering those parameters with their corresponding events. Once you register your custom parameters, Google Analytics for Firebase displays a corresponding data card in each related event-detail report.
Each parameter that you specify counts toward the project limit of 50. For example, if you specify the same parameter for 3 different events, then that counts as 3 of your 50.
To register custom parameters for an event:
In Analytics for Firebase, navigate to your app. Click Events. In the row for the event you want to modify, click More > Edit parameter reporting. In the Enter parameter name field, enter the name of the parameter you'd like to register. If a match is found, select it in the list and click ADD. If no match is found, click ADD. Set the Type field to Text or Number. For numeric parameters, set the Unit of Measurement field. Click SAVE, then click CONFIRM.
On the Events page, any event with registered parameters has a gray box next to the event name with the number of registered parameters for that event.
To edit registered parameters:
In the row for the event, click More > Edit parameter reporting. Add new parameters per the instructions above, or click Delete to remove a parameter. Click SAVE, then click CONFIRM.
The per-app count for registered parameters appears at the bottom of the list of parameters. As you enter parameters, the count updates. When the quota has been reached (50), that number appears in red, indicating that you cannot register any more.
When you register custom parameters, a data card for each parameter is added to the related event-detail report. However, it may take up to 24 hours for the data card to appear.
Right now to show parameters you need to configure metrics or dimensions like written here: https://support.google.com/analytics/answer/10075209
After you added it and waited for 24 hours you will see something like that:
Here shop_exit_app
is the main event, and shop_item
is a parameter of this event
UPD: To add a parameter you need just use something like this:
logShopExitApp(shopItem?: ShopItem): void {
firebase.analytics.logEvent({
key: 'shop_exit_app',
parameters: shopItem ? [
{
key: 'shop_item',
value: shopItem.title,
}
] : null,
})
}
It seems that Google changed everything and made all of us confused with their bad documentation.
Today there is something called "Custom definitions" in the Firebase console, which has 2 undocumented terms; "Dimensions" & "Metrics".
After seeing all the answers here, they lack the answer to what are those terms mean. You can have a custom user property or log a custom event from your client. To make those useful, you need to make sure analytics generates reports for it (which will take up to 24-48 hrs).
User property has only string values, while custom events have key-value pairs of string/numbers. At first, I thought dimension goes for user props while metrics for event params - this is WRONG! Metrics here means ONLY numbers! So metrics are meant for custom events that have a numeric parameter (you can guess this because there is no "Text" option in the units of measurement) like a game score.
While dimension seems to work for both user props & events. So when you have a non-numeric param in your event, you should define it as a dimension, otherwise, the reports won't work for you because in metrics they expect numbers. So something like a search term should be considered as a dimension.
Google hinted this on their docs example here:
You can create an Author dimension that gets its values from the author parameter and an Article_Length metric that gets its value from the number_of_pages parameter.
While referring to this custom event:
gtag('event','read_article', {
"author":"Bill Q",
"title":"How to Build a Backpack",
"number_of_pages":2,
});
Notes:
If anyone struggled as much as I did, here's how we did it:
Go to "Custom Definitions" in the left hand pannel (where it says events, funnels, audiences, etc.)
Click on "Custom Metrics" which is next to "Custom Dimensions" and click "Create custom metric". (For some reason old parameters go to "Dimensions" but when you create event/parameter combo, it didn't work for us in "Dimensions"... I don't know why...)
Then make sure you spell your parameter exactly the same as in your code where it asks you for the "Event parameter" and the rest of the fields don't matter.
Please note: It takes 24 hours to update and make sure you send a test event through to activate it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With