0
0
Firebasecloud~10 mins

User properties in Firebase - Interactive Code Practice

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

Complete the code to set a user property named 'favorite_color' with the value 'blue'.

Firebase
firebase.analytics().setUserProperties({ [1]: 'blue' });
Drag options to blanks, or click blank then click option'
Asession_duration
Buser_id
Cfavorite_color
Devent_name
Attempts:
3 left
💡 Hint
Common Mistakes
Using event names instead of user property names.
Using reserved keywords like 'user_id' incorrectly.
2fill in blank
medium

Complete the code to set the user property 'membership_level' to 'gold'.

Firebase
firebase.analytics().setUserProperties({ [1]: 'gold' });
Drag options to blanks, or click blank then click option'
Amembership_level
Buser_status
Cpurchase_amount
Dlast_login
Attempts:
3 left
💡 Hint
Common Mistakes
Using unrelated property names.
Confusing user properties with event parameters.
3fill in blank
hard

Fix the error in the code to correctly set the user property 'preferred_language' to 'en'.

Firebase
firebase.analytics().setUserProperties({ [1]: 'en' });
Drag options to blanks, or click blank then click option'
Apreferred_language
Bpreferred-language
CPreferredLanguage
Dlanguage_preferred
Attempts:
3 left
💡 Hint
Common Mistakes
Using hyphens instead of underscores.
Using camelCase or PascalCase instead of snake_case.
4fill in blank
hard

Fill both blanks to set user properties 'age' to 30 and 'subscription_status' to 'active'.

Firebase
firebase.analytics().setUserProperties({ [1]: 30, [2]: 'active' });
Drag options to blanks, or click blank then click option'
Aage
Bsubscription_status
Cuser_age
Dstatus
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect or shortened property names.
Mixing up the order of properties.
5fill in blank
hard

Fill all three blanks to set user properties: 'gender' to 'female', 'level' to 'beginner', and 'notifications_enabled' to true.

Firebase
firebase.analytics().setUserProperties({ [1]: 'female', [2]: 'beginner', [3]: true });
Drag options to blanks, or click blank then click option'
Agender
Blevel
Cbeginner
Dnotifications_enabled
Attempts:
3 left
💡 Hint
Common Mistakes
Putting boolean values inside quotes.
Using incorrect property names.