A custom event is a user-defined action that you can log to track specific behaviors or interactions in your app that are not covered by default events.
Click to reveal answer
beginner
How do you log a custom event in Firebase Analytics?
You use the logEvent method with a unique event name and optional parameters to send data about the event to Firebase Analytics.
Click to reveal answer
intermediate
Why should custom event names be descriptive and consistent?
Descriptive and consistent names help you easily understand and analyze the events later in reports, making data clearer and more useful.
Click to reveal answer
intermediate
What is the maximum number of custom event names you can register in Firebase Analytics?
Firebase Analytics allows up to 500 unique event names per project, including both default and custom events.
Click to reveal answer
beginner
Can custom events include parameters? If yes, why?
Yes, custom events can include parameters to provide more details about the event, such as item names, categories, or values, which helps in deeper analysis.
Click to reveal answer
What method is used to send a custom event in Firebase Analytics?
AtrackEvent
BsendEvent
ClogEvent
DcreateEvent
✗ Incorrect
The logEvent method is the correct way to send custom events in Firebase Analytics.
How many unique event names can Firebase Analytics handle per project?
AUnlimited
B100
C1000
D500
✗ Incorrect
Firebase Analytics supports up to 500 unique event names per project.
Why add parameters to custom events?
ATo provide extra details about the event
BTo increase event count
CTo reduce data usage
DTo change event names
✗ Incorrect
Parameters add extra details to events, helping with better analysis.
Which of these is a good practice for naming custom events?
AUse random numbers
BUse descriptive and consistent names
CUse very long names
DUse special characters
✗ Incorrect
Descriptive and consistent names make event data easier to understand.
Custom events in Firebase Analytics are used to:
ATrack specific user actions not covered by default events
BTrack default app crashes
CSend push notifications
DManage user authentication
✗ Incorrect
Custom events track user actions that default events do not cover.
Explain what a custom event is in Firebase Analytics and why you might use one.
Think about how you track special actions users take in your app.
You got /3 concepts.
Describe how to properly name and use parameters with custom events for better analytics.
Consider how clear names and extra details help you understand user behavior.
You got /3 concepts.
Practice
(1/5)
1. What is the main purpose of custom events in Firebase Analytics?
easy
A. To replace default events with simpler ones
B. To automatically collect user location data
C. To track specific user actions not covered by default events
D. To send notifications to users
Solution
Step 1: Understand default vs custom events
Default events cover common actions, but some user actions need custom tracking.
Step 2: Identify the role of custom events
Custom events let you track specific actions unique to your app that default events don't cover.
Final Answer:
To track specific user actions not covered by default events -> Option C
Quick Check:
Custom events = track unique user actions [OK]
Hint: Custom events track unique actions default events miss [OK]
A. Incorrect parameter format; parameters must be in an object
B. Event name must be uppercase
C. logEvent requires only one argument
D. The event name 'level_up' is invalid
Solution
Step 1: Review logEvent parameter requirements
logEvent expects the second argument as an object containing key-value pairs.
Step 2: Identify the mistake in argument passing
The code passes parameters as separate arguments instead of a single object.
Final Answer:
Incorrect parameter format; parameters must be in an object -> Option A
Quick Check:
Parameters must be an object, not separate arguments [OK]
Hint: Pass parameters as one object, not separate arguments [OK]
Common Mistakes:
Passing parameters as multiple arguments
Assuming event name case matters
Thinking logEvent takes only one argument
5. You want to track when users complete a tutorial step with step number and success status. Which is the best way to log this custom event in Firebase?
hard
A. firebase.analytics().logEvent('tutorial_complete', {step: stepNumber, success: isSuccess});
B. firebase.analytics().logEvent('tutorial_complete', stepNumber, isSuccess);
C. firebase.analytics().logEvent('tutorialComplete', {stepNumber, isSuccess});
D. firebase.analytics().logEvent('tutorial_complete', {stepNumber: stepNumber, success: isSuccess});
Solution
Step 1: Check event name format
Firebase recommends lowercase with underscores for event names, so 'tutorial_complete' is correct.
Step 2: Verify parameters object keys and values
Parameters should be an object with clear keys. firebase.analytics().logEvent('tutorial_complete', {stepNumber: stepNumber, success: isSuccess}); uses keys 'stepNumber' and 'success' with values from variables.
Step 3: Compare options for best practice
firebase.analytics().logEvent('tutorial_complete', {step: stepNumber, success: isSuccess}); uses 'step' key which is less descriptive than 'stepNumber'. firebase.analytics().logEvent('tutorialComplete', {stepNumber, isSuccess}); uses camelCase event name which is less recommended. firebase.analytics().logEvent('tutorial_complete', stepNumber, isSuccess); passes parameters incorrectly.
Final Answer:
firebase.analytics().logEvent('tutorial_complete', {stepNumber: stepNumber, success: isSuccess}); -> Option D
Quick Check:
Use descriptive keys and correct event name format [OK]
Hint: Use descriptive keys and underscore event names [OK]
Common Mistakes:
Passing parameters as separate arguments
Using camelCase event names instead of underscores
Using unclear parameter keys
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.