Complete the code to initialize Firebase Analytics in your app.
const analytics = getAnalytics([1]);You need to pass the Firebase app instance to getAnalytics to initialize Analytics correctly.
Complete the code to log a custom event named 'purchase' with Firebase Analytics.
logEvent(analytics, [1], { value: 100 });
The event name must be 'purchase' to log a purchase event.
Fix the error in the code to import Firebase Analytics correctly.
import { [1] } from 'firebase/analytics';
The correct function to import for Firebase Analytics is getAnalytics.
Fill both blanks to configure Firebase Analytics with your app and enable analytics collection.
const analytics = getAnalytics([1]); setAnalyticsCollectionEnabled(analytics, [2]);
You pass the Firebase app instance to getAnalytics and enable analytics collection by passing true to setAnalyticsCollectionEnabled.
Fill all three blanks to log a 'level_up' event with level number and character name.
logEvent(analytics, [1], { level: [2], character: [3] });
The event name is 'level_up', with level number 5 and character name 'wizard' as parameters.