0
0
Firebasecloud~10 mins

Why analytics drive product decisions in Firebase - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to initialize Firebase Analytics in your app.

Firebase
const analytics = [1]();
Drag options to blanks, or click blank then click option'
Aauth
BinitializeApp
CgetFirestore
DgetAnalytics
Attempts:
3 left
💡 Hint
Common Mistakes
Using initializeApp instead of getAnalytics
Confusing Firestore with Analytics
2fill in blank
medium

Complete the code to log a custom event named 'purchase' with Firebase Analytics.

Firebase
analytics.[1]('purchase', { item: 'book', price: 9.99 });
Drag options to blanks, or click blank then click option'
AlogEvent
BrecordEvent
CsendEvent
DtrackEvent
Attempts:
3 left
💡 Hint
Common Mistakes
Using trackEvent which does not exist
Using sendEvent or recordEvent which are invalid
3fill in blank
hard

Fix the error in the code to correctly import Firebase Analytics.

Firebase
import { [1] } from 'firebase/analytics';
Drag options to blanks, or click blank then click option'
AinitializeAnalytics
BgetAnalytics
CfirebaseAnalytics
DanalyticsInit
Attempts:
3 left
💡 Hint
Common Mistakes
Using initializeAnalytics which does not exist
Using incorrect names like firebaseAnalytics
4fill in blank
hard

Fill both blanks to send an event with a dynamic parameter.

Firebase
analytics.[1]('select_content', { content_type: [2] });
Drag options to blanks, or click blank then click option'
AlogEvent
Btrack
C'article'
D'video'
Attempts:
3 left
💡 Hint
Common Mistakes
Using track instead of logEvent
Using wrong content type strings
5fill in blank
hard

Fill all three blanks to initialize Firebase app, get analytics, and log a 'login' event.

Firebase
const app = [1](firebaseConfig);
const analytics = [2](app);
analytics.[3]('login');
Drag options to blanks, or click blank then click option'
AinitializeApp
BgetAnalytics
ClogEvent
DstartAnalytics
Attempts:
3 left
💡 Hint
Common Mistakes
Using startAnalytics which does not exist
Mixing up the order of calls