Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // if a user is logged in when he launched the app or he finished signing up or he logged in to his account, fire this line of code, insert the userId dynamically
- [FIRAnalytics setUserID:@"123456"]
- // if a user is logged in when it launched the app or he logged in to his account, fire this line of code, insert the user sub status type dynamically, if a user started his trial you can fire this line as well to reflect the change
- [FIRAnalytics setUserPropertyString:"insert_sub_status_here" forName:@"user_sub_status"]; // 'free trial', 'canceled', 'monthly', 'yearly', 'expired'
- // This event fires when a user starts the sign up (after he entered his email and clicks 'sign in/sign up'), only if he doesn't have an account with this email
- [FIRAnalytics logEventWithName:@"sign_up_started"
- parameters:@{
- @"method": "email/apple" // the method of registration, if facebook is also an option, please include it here
- }];
- // This event fires when a user completes the signup
- [FIRAnalytics logEventWithName:@"sign_up_completed"
- parameters:@{
- @"method": "email/apple" // the method of registration, if facebook is also an option, please include it here
- }];
- // if a user is logged in when he launched the app or he finished signing up or he logged in to his account, fire this line of code, insert the userId dynamically
- [FIRAnalytics setUserID:@"123456"]
- // This event fires when a user clicks to start the survey
- [FIRAnalytics logEventWithName:@"survey_started"
- parameters:@{
- @"type": "mandatory" // the survey on mobile is usually forced (a user cannot skip it)
- }];
- // This event fires when a user finishes the survey
- [FIRAnalytics logEventWithName:@"survey_finished"
- parameters:@{
- @"type": "mandatory", // the survey on mobile is usually forced (a user cannot skip it)
- @"is_instructor": "true/false" // if the user ticked the 'I am instructor' box then it's true
- }];
- // if the user checks the 'I am instructor' checkbox on the survey, save it as a user parameter
- [FIRAnalytics setUserPropertyString:"true/false" forName:@is_instructor]; // 'true' or 'false' depends on the answer, default value: "false"
- // This event fires when a user clicks on any button that redirects to starting a free trial
- [FIRAnalytics logEventWithName:@"cta_clicked"
- parameters:@{
- @"page_title": "insert_page_title_here" // insert the title of the page the button was clicked on
- }];
- // This event fires when a user clicks to 'activate membership' if he is on a free trial or clicks on 'sign up' after his membership expired (not sure if this option is available on mobile, if it is available, please implement it)
- [FIRAnalytics logEventWithName:@"reactivation_initiated"];
- // This event fires when a user finishes to 'activate membership' after his membership expired (not sure if this option is available on mobile (meaning if your app has this feature), if it is available, please implement it like I describe below)
- // Prepare purchase params
- NSMutableDictionary *purchaseParams = [@{
- kFIRParameterTransactionID: @"T12345", // transaction id
- kFIRParameterAffiliation: @"alomoves", // insert store name region here
- kFIRParameterCurrency: @"USD", // leave static if user can only be charged with USD
- kFIRParameterValue: @14.98, // order total (excluding tax) (the amount the user paid when he activated the plan excluding tax)
- kFIRParameterTax: @2.58, // insert tax (if available or exist in the store)
- kFIRParameterCoupon: @"SUMMER_FUN" // if coupon was applied to the order, include it here
- } mutableCopy];
- // Add items
- purchaseParams[kFIRParameterItems] = [@{
- kFIRParameterItemID: @"membership activated - monthly/annually", // monthly or annually depends on the plan the user chose
- kFIRParameterItemName: @"membership activated - monthly/annually", // monthly or annually depends on the plan the user chose
- kFIRParameterPrice: @9.99, // insert an actual product price. Number or a string. Don't include currency code
- kFIRParameterQuantity: @1 // product quantity. leave static
- } mutableCopy];
- // Log purchase event
- [FIRAnalytics logEventWithName:kFIREventPurchase parameters:purchaseParams]; // name of the event. In this case, it always must be kFIREventPurchase
- // This event fires when a user chose a payment plan, captures the payment plan chosen, captures the payment plan chosen.
- [FIRAnalytics logEventWithName:@"payment_plan_chosen"
- parameters:@{
- @"type": "monthly/annually" // payment plan type
- }];
- // This event fires after a user placed his credit card information and paid on App Store and his trial started
- [FIRAnalytics logEventWithName:@"trial_started"
- parameters:@{
- @"name": "14 Days Trial - Annual/Monthly" // Annual or Monthly depends on the trial he started
- }];
- // This event fires when a user has a class opened (on page load of a class)
- [FIRAnalytics logEventWithName:@"class_viewed"
- parameters:@{
- @"class": "insert_class_name_here", // insert the class name here
- @"series": "insert_series_name_here", // insert the series name here
- @"difficulty": "insert_difficulty_here", // insert the difficulty here
- @"intensity": "insert_intesity_here", // insert the intensity here
- @"instructor": "insert_class_instructor_name" // insert the instructor here
- }];
- // This event fires when a user has a user saved a class (added to practice)
- [FIRAnalytics logEventWithName:@"class_saved"
- parameters:@{
- @"class": "insert_class_name_here", // insert the class name here
- @"series": "insert_series_name_here", // insert the series name here
- @"difficulty": "insert_difficulty_here", // insert the difficulty here
- @"intensity": "insert_intesity_here", // insert the intensity here
- @"instructor": "insert_class_instructor_name" // insert the instructor here
- }];
- // This event fires when a user has a series opened (on a page load of a series page)
- [FIRAnalytics logEventWithName:@"series_viewed"
- parameters:@{
- @"series": "insert_series_name_here", // insert the series name here
- @"difficulty": "insert_difficulty_here", // insert the difficulty here
- @"intensity": "insert_intesity_here", // insert the intensity here
- @"instructor": "insert_class_instructor_name" // insert the instructor here
- }];
- // This event fires when a user adds a series to his practice
- [FIRAnalytics logEventWithName:@"series_saved"
- parameters:@{
- @"series": "insert_series_name_here", // insert the series name here
- @"difficulty": "insert_difficulty_here", // insert the difficulty here
- @"intensity": "insert_intesity_here", // insert the intensity here
- @"instructor": "insert_class_instructor_name" // insert the instructor here
- }];
- // This event fires when a user plays the series intro video, usually the video next to the series description on the series page
- [FIRAnalytics logEventWithName:@"series_intro_played"
- parameters:@{
- @"series": "insert_series_name_here", // insert the series name here
- @"difficulty": "insert_difficulty_here", // insert the difficulty here
- @"intensity": "insert_intesity_here", // insert the intensity here
- @"instructor": "insert_class_instructor_name" // insert the instructor here
- }];
- // This event fires when a user views an instructor page (on a page load of instructor page)
- [FIRAnalytics logEventWithName:@"instructor_viewed"
- parameters:@{
- @"instructor": "insert_instructor_name"
- }];
- // This event fires when a user plays a video
- [FIRAnalytics logEventWithName:@"video_played"
- parameters:@{
- @"title": "insert_video_name_here", // insert video title (could be the name of the class)
- @"class": "insert_class_name_here", // insert class name
- @"series": "insert_series_name_here", // insert the series that video is part of
- @"difficulty": "insert_difficulty_here", // insert difficulty here
- @"intensity": "insert_intesity_here", // insert intensity here
- @"instructor": "insert_class_instructor_name" // insert instructor here
- }];
- // This event fires every 10 seconds when a video is being played.
- [FIRAnalytics logEventWithName:@"video_watched_time"
- parameters:@{
- @"duration" : 10, // 10 seconds unless defined otherwise
- @"title": "insert_video_name_here", // insert video title (could be the name of the class)
- @"class": "insert_class_name_here", // insert class name
- @"series": "insert_series_name_here", // insert the series that video is part of
- @"difficulty": "insert_difficulty_here", // insert difficulty here
- @"intensity": "insert_intesity_here", // insert intensity here
- @"instructor": "insert_class_instructor_name" // insert instructor here
- }];
- // This event fires when a user viewed 10%, 25%, 50%, 75% and 90% of the video
- [FIRAnalytics logEventWithName:@"video_watched_percent"
- parameters:@{
- @"percent" : 10, // 10, 25, 50, 75, 90
- @"title": "insert_video_name_here", // insert video title (could be the name of the class)
- @"class": "insert_class_name_here", // insert class name
- @"series": "insert_series_name_here", // insert the series that video is part of
- @"difficulty": "insert_difficulty_here", // insert difficulty here
- @"intensity": "insert_intesity_here", // insert intensity here
- @"instructor": "insert_class_instructor_name" // insert instructor here
- }];
- // This event fires when a user finishes watching a video
- [FIRAnalytics logEventWithName:@"video_finished"
- parameters:@{
- @"title": "insert_video_name_here", // insert video title (could be the name of the class)
- @"class": "insert_class_name_here", // insert class name
- @"series": "insert_series_name_here", // insert the series that video is part of
- @"difficulty": "insert_difficulty_here", // insert difficulty here
- @"intensity": "insert_intesity_here", // insert intensity here
- @"instructor": "insert_class_instructor_name" // insert instructor here
- }];
- // This event fires when a user filters the duration
- [FIRAnalytics logEventWithName:@"duration_filtered"
- parameters:@{
- @"filter_value": "insert_value_chosen"}]; // insert the value of the filter that was chosen
- // This event fires when a user filters the instructor
- [FIRAnalytics logEventWithName:@"instructor_filtered"
- parameters:@{
- @"filter_value": "insert_value_chosen"}]; // insert the value of the filter that was chosen
- // This event fires when a user filters the style
- [FIRAnalytics logEventWithName:@"style_filtered"
- parameters:@{
- @"filter_value": "insert_value_chosen"}]; // insert the value of the filter that was chosen
- // This event fires when a user filters the difficulty
- [FIRAnalytics logEventWithName:@"difficulty_filtered"
- parameters:@{
- @"filter_value": "insert_value_chosen"}]; // insert the value of the filter that was chosen
- // This event fires when a user filters the intensity
- [FIRAnalytics logEventWithName:@"intensity_filtered"
- parameters:@{
- @"filter_value": "insert_value_chosen"}]; // insert the value of the filter that was chosen
- // This event fires when a user uses the sort function
- [FIRAnalytics logEventWithName:@"sorted_by"
- parameters:@{
- @"filter_value": "insert_value_chosen"}]; // insert the value of the filter that was chosen
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement