| 14792 |
manas |
1 |
/**
|
|
|
2 |
* Copyright 2010-present Facebook.
|
|
|
3 |
*
|
|
|
4 |
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
5 |
* you may not use this file except in compliance with the License.
|
|
|
6 |
* You may obtain a copy of the License at
|
|
|
7 |
*
|
|
|
8 |
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
9 |
*
|
|
|
10 |
* Unless required by applicable law or agreed to in writing, software
|
|
|
11 |
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
13 |
* See the License for the specific language governing permissions and
|
|
|
14 |
* limitations under the License.
|
|
|
15 |
*/
|
|
|
16 |
|
|
|
17 |
package com.facebook;
|
|
|
18 |
|
|
|
19 |
/**
|
|
|
20 |
* Predefined event and parameter names for logging events common to many apps. Logging occurs through the
|
|
|
21 |
* {@link AppEventsLogger#logEvent(String, android.os.Bundle)} family of methods.
|
|
|
22 |
*/
|
|
|
23 |
public class AppEventsConstants {
|
|
|
24 |
// Event names
|
|
|
25 |
|
|
|
26 |
// General purpose
|
|
|
27 |
|
|
|
28 |
/** Log this event when an app is being activated. */
|
|
|
29 |
public static final String EVENT_NAME_ACTIVATED_APP = "fb_mobile_activate_app";
|
|
|
30 |
|
|
|
31 |
public static final String EVENT_NAME_DEACTIVATED_APP = "fb_mobile_deactivate_app";
|
|
|
32 |
|
|
|
33 |
public static final String EVENT_NAME_SESSION_INTERRUPTIONS = "fb_mobile_app_interruptions";
|
|
|
34 |
|
|
|
35 |
public static final String EVENT_NAME_TIME_BETWEEN_SESSIONS = "fb_mobile_time_between_sessions";
|
|
|
36 |
|
|
|
37 |
/** Log this event when a user has completed registration with the app. */
|
|
|
38 |
public static final String EVENT_NAME_COMPLETED_REGISTRATION = "fb_mobile_complete_registration";
|
|
|
39 |
|
|
|
40 |
/** Log this event when a user has viewed a form of content in the app. */
|
|
|
41 |
public static final String EVENT_NAME_VIEWED_CONTENT = "fb_mobile_content_view";
|
|
|
42 |
|
|
|
43 |
/** Log this event when a user has performed a search within the app. */
|
|
|
44 |
public static final String EVENT_NAME_SEARCHED = "fb_mobile_search";
|
|
|
45 |
|
|
|
46 |
/**
|
|
|
47 |
* Log this event when the user has rated an item in the app.
|
|
|
48 |
* The valueToSum passed to logEvent should be the numeric rating.
|
|
|
49 |
*/
|
|
|
50 |
public static final String EVENT_NAME_RATED = "fb_mobile_rate";
|
|
|
51 |
|
|
|
52 |
/** Log this event when the user has completed a tutorial in the app. */
|
|
|
53 |
public static final String EVENT_NAME_COMPLETED_TUTORIAL = "fb_mobile_tutorial_completion";
|
|
|
54 |
|
|
|
55 |
// Ecommerce related
|
|
|
56 |
|
|
|
57 |
/**
|
|
|
58 |
* Log this event when the user has added an item to their cart.
|
|
|
59 |
* The valueToSum passed to logEvent should be the item's price.
|
|
|
60 |
*/
|
|
|
61 |
public static final String EVENT_NAME_ADDED_TO_CART = "fb_mobile_add_to_cart";
|
|
|
62 |
|
|
|
63 |
/**
|
|
|
64 |
* Log this event when the user has added an item to their wishlist.
|
|
|
65 |
* The valueToSum passed to logEvent should be the item's price.
|
|
|
66 |
*/
|
|
|
67 |
public static final String EVENT_NAME_ADDED_TO_WISHLIST = "fb_mobile_add_to_wishlist";
|
|
|
68 |
|
|
|
69 |
/**
|
|
|
70 |
* Log this event when the user has entered the checkout process.
|
|
|
71 |
* The valueToSum passed to logEvent should be the total price in the cart.
|
|
|
72 |
*/
|
|
|
73 |
public static final String EVENT_NAME_INITIATED_CHECKOUT = "fb_mobile_initiated_checkout";
|
|
|
74 |
|
|
|
75 |
/** Log this event when the user has entered their payment info. */
|
|
|
76 |
public static final String EVENT_NAME_ADDED_PAYMENT_INFO = "fb_mobile_add_payment_info";
|
|
|
77 |
|
|
|
78 |
/**
|
|
|
79 |
* Log this event when the user has completed a purchase.
|
|
|
80 |
* The {@link AppEventsLogger#logPurchase(java.math.BigDecimal, java.util.Currency)} method is a shortcut for
|
|
|
81 |
* logging this event.
|
|
|
82 |
*/
|
|
|
83 |
public static final String EVENT_NAME_PURCHASED = "fb_mobile_purchase";
|
|
|
84 |
|
|
|
85 |
// Gaming related
|
|
|
86 |
|
|
|
87 |
/** Log this event when the user has achieved a level in the app. */
|
|
|
88 |
public static final String EVENT_NAME_ACHIEVED_LEVEL = "fb_mobile_level_achieved";
|
|
|
89 |
|
|
|
90 |
/** Log this event when the user has unlocked an achievement in the app. */
|
|
|
91 |
public static final String EVENT_NAME_UNLOCKED_ACHIEVEMENT = "fb_mobile_achievement_unlocked";
|
|
|
92 |
|
|
|
93 |
/**
|
|
|
94 |
* Log this event when the user has spent app credits.
|
|
|
95 |
* The valueToSum passed to logEvent should be the number of credits spent.
|
|
|
96 |
*/
|
|
|
97 |
public static final String EVENT_NAME_SPENT_CREDITS = "fb_mobile_spent_credits";
|
|
|
98 |
|
|
|
99 |
|
|
|
100 |
|
|
|
101 |
|
|
|
102 |
// Event parameters
|
|
|
103 |
|
|
|
104 |
/**
|
|
|
105 |
* Parameter key used to specify currency used with logged event. E.g. "USD", "EUR", "GBP".
|
|
|
106 |
* See ISO-4217 for specific values. One reference for these is <http://en.wikipedia.org/wiki/ISO_4217>.
|
|
|
107 |
*/
|
|
|
108 |
public static final String EVENT_PARAM_CURRENCY = "fb_currency";
|
|
|
109 |
|
|
|
110 |
/**
|
|
|
111 |
* Parameter key used to specify method user has used to register for the app, e.g., "Facebook", "email",
|
|
|
112 |
* "Twitter", etc.
|
|
|
113 |
*/
|
|
|
114 |
public static final String EVENT_PARAM_REGISTRATION_METHOD = "fb_registration_method";
|
|
|
115 |
|
|
|
116 |
/**
|
|
|
117 |
* Parameter key used to specify a generic content type/family for the logged event, e.g. "music", "photo",
|
|
|
118 |
* "video". Options to use will vary based upon what the app is all about.
|
|
|
119 |
*/
|
|
|
120 |
public static final String EVENT_PARAM_CONTENT_TYPE = "fb_content_type";
|
|
|
121 |
|
|
|
122 |
/**
|
|
|
123 |
* Parameter key used to specify an ID for the specific piece of content being logged about.
|
|
|
124 |
* Could be an EAN, article identifier, etc., depending on the nature of the app.
|
|
|
125 |
*/
|
|
|
126 |
public static final String EVENT_PARAM_CONTENT_ID = "fb_content_id";
|
|
|
127 |
|
|
|
128 |
/** Parameter key used to specify the string provided by the user for a search operation. */
|
|
|
129 |
public static final String EVENT_PARAM_SEARCH_STRING = "fb_search_string";
|
|
|
130 |
|
|
|
131 |
/**
|
|
|
132 |
* Parameter key used to specify whether the activity being logged about was successful or not.
|
|
|
133 |
* EVENT_PARAM_VALUE_YES and EVENT_PARAM_VALUE_NO are good canonical values to use for this parameter.
|
|
|
134 |
*/
|
|
|
135 |
public static final String EVENT_PARAM_SUCCESS = "fb_success";
|
|
|
136 |
|
|
|
137 |
/**
|
|
|
138 |
* Parameter key used to specify the maximum rating available for the EVENT_NAME_RATE event.
|
|
|
139 |
* E.g., "5" or "10".
|
|
|
140 |
*/
|
|
|
141 |
public static final String EVENT_PARAM_MAX_RATING_VALUE = "fb_max_rating_value";
|
|
|
142 |
|
|
|
143 |
/**
|
|
|
144 |
* Parameter key used to specify whether payment info is available for the EVENT_NAME_INITIATED_CHECKOUT event.
|
|
|
145 |
* EVENT_PARAM_VALUE_YES and EVENT_PARAM_VALUE_NO are good canonical values to use for this parameter.
|
|
|
146 |
*/
|
|
|
147 |
public static final String EVENT_PARAM_PAYMENT_INFO_AVAILABLE = "fb_payment_info_available";
|
|
|
148 |
|
|
|
149 |
/**
|
|
|
150 |
* Parameter key used to specify how many items are being processed for an EVENT_NAME_INITIATED_CHECKOUT
|
|
|
151 |
* or EVENT_NAME_PURCHASE event.
|
|
|
152 |
*/
|
|
|
153 |
public static final String EVENT_PARAM_NUM_ITEMS = "fb_num_items";
|
|
|
154 |
|
|
|
155 |
/** Parameter key used to specify the level achieved in a EVENT_NAME_LEVEL_ACHIEVED event. */
|
|
|
156 |
public static final String EVENT_PARAM_LEVEL = "fb_level";
|
|
|
157 |
|
|
|
158 |
/**
|
|
|
159 |
* Parameter key used to specify a description appropriate to the event being logged.
|
|
|
160 |
* E.g., the name of the achievement unlocked in the EVENT_NAME_ACHIEVEMENT_UNLOCKED event.
|
|
|
161 |
*/
|
|
|
162 |
public static final String EVENT_PARAM_DESCRIPTION = "fb_description";
|
|
|
163 |
|
|
|
164 |
|
|
|
165 |
/**
|
|
|
166 |
* Parameter key used to specify source application package
|
|
|
167 |
*/
|
|
|
168 |
public static final String EVENT_PARAM_SOURCE_APPLICATION = "fb_mobile_launch_source";
|
|
|
169 |
|
|
|
170 |
// Parameter values
|
|
|
171 |
|
|
|
172 |
/** Yes-valued parameter value to be used with parameter keys that need a Yes/No value */
|
|
|
173 |
public static final String EVENT_PARAM_VALUE_YES = "1";
|
|
|
174 |
|
|
|
175 |
/** No-valued parameter value to be used with parameter keys that need a Yes/No value */
|
|
|
176 |
public static final String EVENT_PARAM_VALUE_NO = "0";
|
|
|
177 |
}
|