Show last authors
1 {{box cssClass="floatinginfobox" title="**Page Contents**"}}
2 {{toc/}}
3 {{/box}}
4
5 = 1. Overview =
6
7 The plugin is located at pub repositories [[(pub repositories)>>https://pub.dev/packages/flutter_mobigate]]
8 This plugin is built for:
9
10 * Mobigate SDK version 1.0.6
11
12 = 2. Adding SDK to the project =
13
14 **First, add this to your package's pubspec.yaml file**
15
16 {{code language=""}}
17 dependencies:
18 flutter_mobigate: ^1.0.2
19 {{/code}}
20
21 **Install packages from the command line**
22
23 {{code language=""}}
24 $ flutter pub get
25 {{/code}}
26
27 = 3. Api methods =
28
29 To use any method from the plugin add import:
30
31 {{code language="dart"}}
32 import 'package:flutter_mobigate/flutter_mobigate.dart';
33 {{/code}}
34
35 == 3.1 MobigateSDK class initialization ==
36
37 Initialize class with //MobigateSDK(MobigateOptions options)//
38
39 {{showhide id="2" showmessage="MobigateOptions" hidemessage="MobigateOptions"}}
40 (% class="table-bordered table-hover" style="border-color:powderblue" %)
41 |=(% style="background-color:powderblue" %)Name|=(% style="background-color:powderblue" %)Type|=(% style="background-color:powderblue" %)Default|=(% style="background-color:powderblue" %)Description
42 | appIdentifier|String| | Application identifier
43 |appInstallationSource |String| | App installation source e.g., google-play, organic.
44 |email |String | | Set's user email.
45 |cusUserId |String | | You may use your custom userID for marking data. By default we are using device ID and emails for matching. Set it before starting the service using MobigateSDk.Builder method.
46 | enableUserFields|Json Array | | Enable custom fields in user data. By default MobienceSDK is gathering all identifiers, which it can read. You can choose one of these field: ["email", "imei", "imsi", "msisdn", "mac", "serial"] see [[plugin user field constants>>https://wiki.spicymobile.pl/wiki/mobigatesdk/view/Main/sdkintegration/reactnativeintegration/#H4.1Userfieldconstants]].
47 | dataGatherPolicy| Json Object| | Enable custom data gater policy. By default MobienceSDK gather all data it can read and hide notification icon. Check below DataGatherPolicy options for more details.
48 | notificationText|String | | Foreground service notification text.
49 | enableIdProfiles|Boolean |false | turns on / off the IDs profiles system.
50 {{/showhide}}
51
52 {{showhide id="3" showmessage="DataGatherPolicy options" hidemessage="DataGatherPolicy options"}}
53 (% class="table-bordered table-hover" style="border-color:powderblue" %)
54 |=(% style="background-color:powderblue" %)Name|=(% style="background-color:powderblue" %)Type|=(% style="background-color:powderblue" %)Default|=(% style="background-color:powderblue" %)Description
55 | monitorState|String| | Possible monitor states: [[plugin constants>>https://wiki.spicymobile.pl/wiki/mobigatesdk/view/Main/sdkintegration/reactnativeintegration/#H4.2Datagatherpolicyconstants]]. More info about gathering data [[here>>https://wiki.spicymobile.pl/wiki/mobigatesdk/view/Main/mobigatesdkintegrationforandroiddevelopers/#H5.8Datagatherpolicy]]
56 |notificationText|String| | if state = Mobigate.DATA_GATHER_POLICY_DEFAULT you can pass custom foreground service notification text
57 {{/showhide}}
58
59 {{showhide id="3" showmessage="Example" hidemessage="Example"}}
60 //MobigateOptions(apiKey,{appIdentifier, appInstallationSource,email,cusUserId,enableUserFields,dataGatherPolicy,notificationText,enableIdProfiles})//
61
62 {{code language="dart"}}
63 MobigateSDK mobigateInstance = MobigateSDK(MobigateOptions(
64 "V0K6jhiIfem6CRWHYZ59Nmj3oFBBKbJsnSsWfR2JNq7ktblOUXwbJoBQTpWnw2uSwW76gpiu2kun50jweTY69B"
65 ));
66 {{/code}}
67 {{/showhide}}
68
69 == 3.2 SDK initialization ==
70
71 You must initialize the library before running it. Use //init(apiKey, options, onSuccess, onError)// method for that:
72
73 **Mobigate.init(apiKey, options, onSuccess, onError)**
74
75 (% class="table-bordered table-hover" style="border-color:powderblue" %)
76 |=(% style="background-color:powderblue" %)Parameter|=(% style="background-color:powderblue" %)Type|=(% style="background-color:powderblue" %)Description
77 |apiKey|String|Api key provided by your business partner
78 |options|Json Object|SDK configuration
79 |onSuccess|Function|returns callback object
80 |onError|Function|returns callback object
81
82 {{showhide id="2" showmessage="Options" hidemessage="Options"}}
83 (% class="table-bordered table-hover" style="border-color:powderblue" %)
84 |=(% style="background-color:powderblue" %)Name|=(% style="background-color:powderblue" %)Type|=(% style="background-color:powderblue" %)Default|=(% style="background-color:powderblue" %)Description
85 | appIdentifier|String| | Application identifier
86 |appInstallationSource |String| | App installation source e.g., google-play, organic.
87 |email |String | | Set's user email.
88 |customUserId |String | | You may use your custom userID for marking data. By default we are using device ID and emails for matching. Set it before starting the service using MobigateSDk.Builder method.
89 | enableUserFields|Json Array | | Enable custom fields in user data. By default MobienceSDK is gathering all identifiers, which it can read. You can choose one of these field: ["email", "imei", "imsi", "msisdn", "mac", "serial"] see [[plugin user field constants>>https://wiki.spicymobile.pl/wiki/mobigatesdk/view/Main/sdkintegration/reactnativeintegration/#H4.1Userfieldconstants]].
90 | dataGatherPolicy| Json Object| | Enable custom data gater policy. By default MobienceSDK gather all data it can read and hide notification icon. Check below DataGatherPolicy options for more details.
91 | enableIdProfiles|Boolean |false | turns on / off the IDs profiles system.
92 {{/showhide}}
93
94 {{showhide id="3" showmessage="DataGatherPolicy options" hidemessage="DataGatherPolicy options"}}
95 (% class="table-bordered table-hover" style="border-color:powderblue" %)
96 |=(% style="background-color:powderblue" %)Name|=(% style="background-color:powderblue" %)Type|=(% style="background-color:powderblue" %)Default|=(% style="background-color:powderblue" %)Description
97 | monitorState|String| | Possible monitor states: [[plugin constants>>https://wiki.spicymobile.pl/wiki/mobigatesdk/view/Main/sdkintegration/reactnativeintegration/#H4.2Datagatherpolicyconstants]]. More info about gathering data [[here>>https://wiki.spicymobile.pl/wiki/mobigatesdk/view/Main/mobigatesdkintegrationforandroiddevelopers/#H5.8Datagatherpolicy]]
98 |notificationText|String| | if state = Mobigate.DATA_GATHER_POLICY_DEFAULT you can pass custom foreground service notification text
99 {{/showhide}}
100
101
102 When the library is already initialized run it. Use //startSDK(onSuccess, onError)// method for that:
103
104 **Mobigate.startSDK(onSuccess, onError)**
105
106 (% class="table-bordered table-hover" style="border-color:powderblue" %)
107 |=(% style="background-color:powderblue" %)Parameter|=(% style="background-color:powderblue" %)Type|=(% style="background-color:powderblue" %)Description
108 |onSuccess|Function|returns callback object
109 |onError|Function|returns callback object
110
111 {{showhide id="3" showmessage="Example" hidemessage="Example"}}
112 {{code language="javascript"}}
113 initLibrary = () => {
114 if (Platform.OS === 'android') {
115 Mobigate.init("V0K6jhiIfem6CRWHYZ59Nmj3oFBBKbJsnSsWfR2JNq7ktblOUXwbJoBQTpWnw2uSwW76gpiu2kun50jweTY69B",
116 {
117 /*custom options, check docs for more details
118 appIdentifier: 'customUserAppIdentifier',
119 appInstallationSource: "customAppInstallationSourcexyz",
120 email: 'testemail@gmail.com',
121 userAgent: 'customUserAgent',
122 customUserId: 'customUserId',*/
123 }, (success) => {
124 /* You can configure custom collectors after init
125 Mobigate.disableAllDataCollector()
126 Mobigate.configureDataCollectors(true, [Mobigate.DATA_COLLECTOR_APPS_LIST,
127 Mobigate.DATA_COLLECTOR_BATTERY,
128 Mobigate.DATA_COLLECTOR_PHONE_INFO])*/
129
130 Mobigate.startSDK((result) => {
131 this.setState({
132 status: 'started',
133 });
134
135 }, (errorResult) => {
136 this.setState({
137 status: errorResult,
138 });
139 })
140 }, (initError) => {
141 this.setState({
142 status: initError,
143 });
144 })
145 }else{
146 this.setState({
147 status: 'Mobigate SDK supports only Android'
148 })
149 }
150 }
151 {{/code}}
152 {{/showhide}}
153
154 == 3.2 Tracking in app events ==
155
156 In-App Events provide insight on what is happening in your app. It is recommended to take the time and define the events you would like to measure.
157
158 === 3.2.1 Overview ===
159
160 An event consists of two fields that you (% style="display:none" %) (%%)can use to describe a user's interaction with your app content:
161
162 (% class="table-bordered table-hover" %)
163 |(% style="background-color:powderblue; width:200px" %)**Field name**|(% style="background-color:powderblue; width:200px" %)**Type**|(% style="background-color:powderblue; width:200px" %)**Required**|(% style="background-color:powderblue; width:200px" %)**Description**
164 |(% style="width:200px" %)Category|(% style="width:200px" %)String|(% style="width:200px" %)yes|(% style="width:200px" %)Event category
165 |(% style="width:200px" %)Parameter|(% style="width:200px" %)String|(% style="width:200px" %)no|(% style="width:200px" %)Event parameter. 
166 There can be more than one
167
168 You can use any event category or parameter string of your choice. However, react-native-mobigate plugin contains recommended event categories and parameters via String constants (see [[Event categories>>doc:||anchor="H3.2.3Eventcategories"]] and [[Event parameters>>doc:||anchor="H3.2.4Eventparameters"]]).
169
170 === 3.2.2 Implementation ===
171
172 Tracking in-app events is performed by two methods:
173
174 **Mobigate.trackEvent(options)**
175
176 {{showhide id="2" showmessage="Options" hidemessage="Options" effect="slide" effectduration="0.3"}}
177 (% class="table-bordered table-hover" style="border-color:powderblue" %)
178 |=(% style="background-color:powderblue" %)Name|=(% style="background-color:powderblue" %)Type|=(% style="background-color:powderblue" %)Default|=(% style="background-color:powderblue" %)Description
179 |name|String | | Event category name.
180 |parameters|Json array| | Array of parameters. Look below on example.
181 {{/showhide}}
182
183 {{showhide id="3" showmessage="Example" hidemessage="Example"}}
184 {{code language="javascript"}}
185 sendTrackEvent = () => {
186 if (Platform.OS === 'android') {
187 Mobigate.trackEvent({
188 name: Mobigate.CATEGORY_PURCHASE,
189 parameters: {
190 [Mobigate.PARAMETER_CONTENT_ID]: 42313532,
191 [Mobigate.PARAMETER_PRICE]: 43.23,
192 [Mobigate.PARAMETER_QUANTITY]: 2,
193 'userCustomParameterName':'simpleName'
194 },
195 })
196 }
197 }
198 {{/code}}
199 {{/showhide}}
200
201
202 **Mobigate.trackAppInstall(timestamp)**
203
204 (% class="table-bordered table-hover" style="border-color:powderblue" %)
205 |=(% style="background-color:powderblue" %)Parameter|=(% style="background-color:powderblue" %)Type|=(% style="background-color:powderblue" %)Description
206 |timestamp|double|Unix timestamp in milliseconds
207
208 {{showhide id="3" showmessage="Example" hidemessage="Example"}}
209 {{code language="javascript"}}
210 sendTrackEvent = () => {
211 if (Platform.OS === 'android') {
212 Mobigate.trackAppInstall(1578042916000)
213 }
214 }
215 {{/code}}
216 {{/showhide}}
217
218 === 3.2.3 Event categories ===
219
220 The following section describes the recommended structure of each event category. In-app events categories are defined as part of plugin String constants.
221
222
223 {{showhide id="1" showmessage="LEVEL_ACCOMPLISHED" hidemessage="LEVEL_ACCOMPLISHED" effect="slide" effectduration="0.3" style="border-radius: 5px; border: 1px solid powderblue; padding: 7px 7px 7px 30px; margin: 0px"}}
224
225 \\**Description:** Track accomplished game level achievement
226 **Event category:** LEVEL_ACCOMPLISHED
227 **Recommended parameters:** LEVEL, SCORE
228 {{/showhide}}
229
230 {{showhide id="2" showmessage="ADD_PAYMENT_INFO" hidemessage="ADD_PAYMENT_INFO" effect="slide" effectduration="0.3" style="border-radius: 5px; border: 1px solid powderblue; padding: 7px 7px 7px 30px; margin: -1px 0px 0px 0px"}}
231
232 \\**Description:** Track payment info
233 **Event category:** ADD_PAYMENT_INFO
234 **Recommended parameters:** SUCCESS
235 {{/showhide}}
236
237 {{showhide id="3" showmessage="ADD_TO_BASKET" hidemessage="ADD_TO_BASKET" effect="slide" effectduration="0.3" style="border-radius: 5px; border: 1px solid powderblue; padding: 7px 7px 7px 30px; margin: -1px 0px 0px 0px"}}
238
239 \\**Description:** Track add item to basket
240 **Event category:** ADD_TO_BASKET
241 **Recommended parameters:** PRICE, CONTENT_TYPE, CONTENT_ID, CONTENT, CURRENCY, QUANTITY
242 {{/showhide}}
243
244 {{showhide id="4" showmessage="REMOVED_FROM_BASKET" hidemessage="REMOVED_FROM_BASKET" effect="slide" effectduration="0.3" style="border-radius: 5px; border: 1px solid powderblue; padding: 7px 7px 7px 30px; margin: -1px 0px 0px 0px"}}
245
246 \\**Description:** Track removed item from basket
247 **Event category:** REMOVED_FROM_BASKET
248 **Recommended parameters:** PRICE, CONTENT_TYPE, CONTENT_ID, CONTENT, CURRENCY, QUANTITY
249 {{/showhide}}
250
251 {{showhide id="5" showmessage="ADD_TO_WISH_LIST" hidemessage="ADD_TO_WISH_LIST" effect="slide" effectduration="0.3" style="border-radius: 5px; border: 1px solid powderblue; padding: 7px 7px 7px 30px; margin: -1px 0px 0px 0px"}}
252
253 \\**Description:** Track add item to wish list
254 **Event category:** ADD_TO_WISH_LIST
255 **Recommended parameters:** PRICE, CONTENT_TYPE, CONTENT_ID, CONTENT, CURRENCY, QUANTITY
256 {{/showhide}}
257
258 {{showhide id="6" showmessage="REGISTRATION" hidemessage="REGISTRATION" effect="slide" effectduration="0.3" style="border-radius: 5px; border: 1px solid powderblue; padding: 7px 7px 7px 30px; margin: -1px 0px 0px 0px"}}
259
260 \\**Description:** Track registration
261 **Event category:** REGISTRATION
262 **Recommended parameters:** REGISTRATION_METHOD
263 {{/showhide}}
264
265 {{showhide id="7" showmessage="TUTORIAL_COMPLETION" hidemessage="TUTORIAL_COMPLETION" effect="slide" effectduration="0.3" style="border-radius: 5px; border: 1px solid powderblue; padding: 7px 7px 7px 30px; margin: -1px 0px 0px 0px"}}
266
267 \\**Description:** Track tutorial completion
268 **Event category:** TUTORIAL_COMPLETION
269 **Recommended parameters:** SUCCESS, CONTENT, CONTENT_ID
270 {{/showhide}}
271
272 {{showhide id="8" showmessage="TRIGGER_CHECKOUT" hidemessage="TRIGGER_CHECKOUT" effect="slide" effectduration="0.3" style="border-radius: 5px; border: 1px solid powderblue; padding: 7px 7px 7px 30px; margin: -1px 0px 0px 0px"}}
273
274 \\**Description:** Track triggered checkout
275 **Event category:** TRIGGER_CHECKOUT
276 **Recommended parameters:** PROCE, CONTENT_TYPE, CONTENT_ID, CONTENT, QUANTITY, PAYMENT_INFO_AVAILABLE, CURRENCY
277 {{/showhide}}
278
279 {{showhide id="9" showmessage="PURCHASE" hidemessage="PURCHASE" effect="slide" effectduration="0.3" style="border-radius: 5px; border: 1px solid powderblue; padding: 7px 7px 7px 30px; margin: -1px 0px 0px 0px"}}
280
281 \\**Description:** Track purchased item
282 **Event category:** PURCHASE
283 **Recommended parameters:** REVENUE, CONTENT_TYPE, CONTENT_ID, CONTENT, PRICE, QUANTITY, CURRENCY, ORDER_ID
284 {{/showhide}}
285
286 {{showhide id="10" showmessage="SUBSCRIBE" hidemessage="SUBSCRIBE" effect="slide" effectduration="0.3" style="border-radius: 5px; border: 1px solid powderblue; padding: 7px 7px 7px 30px; margin: -1px 0px 0px 0px"}}
287
288 \\**Description:** Track subscription purchase
289 **Event category:** SUBSCRIBE
290 **Recommended parameters:** REVENUE, CURRENCY
291 {{/showhide}}
292
293 {{showhide id="11" showmessage="BEGIN_TRIAL" hidemessage="BEGIN_TRIAL" effect="slide" effectduration="0.3" style="border-radius: 5px; border: 1px solid powderblue; padding: 7px 7px 7px 30px; margin: -1px 0px 0px 0px"}}
294
295 \\**Description:** Track begin trail of product
296 **Event category:** BEGIN_TRIAL
297 **Recommended parameters:** PRICE, CURRENCY
298 {{/showhide}}
299
300 {{showhide id="12" showmessage="RATE" hidemessage="RATE" effect="slide" effectduration="0.3" style="border-radius: 5px; border: 1px solid powderblue; padding: 7px 7px 7px 30px; margin: -1px 0px 0px 0px"}}
301
302 \\**Description:** Track app/item rate
303 **Event category:** RATE
304 **Recommended parameters:** RATING_VALUE, CONTENT_TYPE, CONTENT_ID, CONTENT, MAX_RATING_VALUE
305 {{/showhide}}
306
307 {{showhide id="13" showmessage="SEARCH" hidemessage="SEARCH" effect="slide" effectduration="0.3" style="border-radius: 5px; border: 1px solid powderblue; padding: 7px 7px 7px 30px; margin: -1px 0px 0px 0px"}}
308 \\**Description:** Track search event
309 **Event category:** SEARCH
310 **Recommended parameters:** CONTENT_TYPE, SEARCH_STRING, SUCCESS
311 {{/showhide}}
312
313 {{showhide id="14" showmessage="USED_CREDIT" hidemessage="USED_CREDIT" effect="slide" effectduration="0.3" style="border-radius: 5px; border: 1px solid powderblue; padding: 7px 7px 7px 30px; margin: -1px 0px 0px 0px"}}
314 \\**Description:** Track use of credit
315 **Event category:** USED_CREDIT
316 **Recommended parameters:** PRICE, CONTENT_TYPE, CONTENT_ID, CONTENT
317 {{/showhide}}
318
319 {{showhide id="15" showmessage="UNLOCKED_ACHIEVEMENT" hidemessage="UNLOCKED_ACHIEVEMENT" effect="slide" effectduration="0.3" style="border-radius: 5px; border: 1px solid powderblue; padding: 7px 7px 7px 30px; margin: -1px 0px 0px 0px"}}
320 \\**Description:** Track achievement unlock
321 **Event category:** UNLOCKED_ACHIEVEMENT
322 **Recommended parameters:** DESCRIPTION
323 {{/showhide}}
324
325 {{showhide id="16" showmessage="VIEW_CONTENT" hidemessage="VIEW_CONTENT" effect="slide" effectduration="0.3" style="border-radius: 5px; border: 1px solid powderblue; padding: 7px 7px 7px 30px; margin: -1px 0px 0px 0px"}}
326 \\**Description:** Track content view event
327 **Event category:** VIEW_CONTENT
328 **Recommended parameters:** PRICE, CONTENT_TYPE, CONTENT_ID, CONTENT, CURRENCY
329 {{/showhide}}
330
331 {{showhide id="17" showmessage="VIEW_LIST" hidemessage="VIEW_LIST" effect="slide" effectduration="0.3" style="border-radius: 5px; border: 1px solid powderblue; padding: 7px 7px 7px 30px; margin: -1px 0px 0px 0px"}}
332 \\**Description:** Track list event
333 **Event category:** VIEW_LIST
334 **Recommended parameters:** CONTENT_TYPE, CONTENT_LIST
335 {{/showhide}}
336
337 {{showhide id="18" showmessage="CLICK_AD" hidemessage="CLICK_AD" effect="slide" effectduration="0.3" style="border-radius: 5px; border: 1px solid powderblue; padding: 7px 7px 7px 30px; margin: -1px 0px 0px 0px"}}
338 \\**Description:** Track ad click
339 **Event category:** CLICK_AD
340 **Recommended parameters:** CONTENT_TYPE, CONTENT_ID
341 {{/showhide}}
342
343 {{showhide id="19" showmessage="VIEW_AD" hidemessage="VIEW_AD" effect="slide" effectduration="0.3" style="border-radius: 5px; border: 1px solid powderblue; padding: 7px 7px 7px 30px; margin: -1px 0px 0px 0px"}}
344 \\**Description:** Track view ad
345 **Event category:** VIEW_AD
346 **Recommended parameters:** CONTENT_TYPE, CONTENT_ID
347 {{/showhide}}
348
349 {{showhide id="20" showmessage="EVENT_BOOKING" hidemessage="EVENT_BOOKING" effect="slide" effectduration="0.3" style="border-radius: 5px; border: 1px solid powderblue; padding: 7px 7px 7px 30px; margin: -1px 0px 0px 0px"}}
350 \\**Description:** Track booking event
351 **Event category:** EVENT_BOOKING
352 **Recommended parameters:** REVENUE, DESTINATION_A, DESTINATION_B, CLASS, DESCRIPTION, CUSTOMER_USER_ID, CONTENT_TYPE, CONTENT_ID, DATE_A, DATE_B
353 {{/showhide}}
354
355 {{showhide id="21" showmessage="SHARE" hidemessage="SHARE" effect="slide" effectduration="0.3" style="border-radius: 5px; border: 1px solid powderblue; padding: 7px 7px 7px 30px; margin: -1px 0px 0px 0px"}}
356 \\**Description:** Track share event
357 **Event category:** SHARE
358 **Recommended parameters:** DESCRIPTION
359 {{/showhide}}
360
361 {{showhide id="22" showmessage="INVITE" hidemessage="INVITE" effect="slide" effectduration="0.3" style="border-radius: 5px; border: 1px solid powderblue; padding: 7px 7px 7px 30px; margin: -1px 0px 0px 0px"}}
362 \\**Description:** Track social invite event
363 **Event category:** INVITE
364 **Recommended parameters:** NONE
365 {{/showhide}}
366
367 {{showhide id="23" showmessage="LOGIN" hidemessage="LOGIN" effect="slide" effectduration="0.3" style="border-radius: 5px; border: 1px solid powderblue; padding: 7px 7px 7px 30px; margin: -1px 0px 0px 0px"}}
368 \\**Description:** Track user login event
369 **Event category:** LOGIN
370 **Recommended parameters:** NONE
371 {{/showhide}}
372
373 {{showhide id="24" showmessage="EVENT_RETURN" hidemessage="EVENT_RETURN" effect="slide" effectduration="0.3" style="border-radius: 5px; border: 1px solid powderblue; padding: 7px 7px 7px 30px; margin: -1px 0px 0px 0px"}}
374 \\**Description:** Track re engagement event
375 **Event category:** EVENT_RETURN
376 **Recommended parameters:** NONE
377 {{/showhide}}
378
379 {{showhide id="25" showmessage="OPENED_PUSH_NOTIFICATION" hidemessage="OPENED_PUSH_NOTIFICATION" effect="slide" effectduration="0.3" style="border-radius: 5px; border: 1px solid powderblue; padding: 7px 7px 7px 30px; margin: -1px 0px 0px 0px"}}
380 \\**Description:** Track user opened push notification
381 **Event category:** OPENED_PUSH_NOTIFICATION
382 **Recommended parameters:** NONE
383 {{/showhide}}
384
385 {{showhide id="26" showmessage="UPDATE" hidemessage="UPDATE" effect="slide" effectduration="0.3" style="border-radius: 5px; border: 1px solid powderblue; padding: 7px 7px 7px 30px; margin: -1px 0px 0px 0px"}}
386 \\**Description:** Track update event
387 **Event category:** UPDATE
388 **Recommended parameters:** CONTENT_ID
389 {{/showhide}}
390
391 === 3.2.4 Event parameters ===
392
393 In addition each category that is passed with event may have optional parameters defined as part of the plugin constants, or custom defined as String. Below is a list of recommended parameters.
394
395 {{showhide id="1" showmessage="Parameters list" hidemessage="Parameters list" effect="slide" effectduration="0.3"}}
396
397 (% class="table-bordered table-hover" %)
398 |(% style="background-color:powderblue; width:200px" %)**Parameter enum**|(% style="background-color:powderblue; width:200px" %)**Recommended value**
399 |(% style="width:200px" %)REVENUE|(% style="width:200px" %)FLoat
400 |(% style="width:200px" %)PRICE|(% style="width:200px" %)Float
401 |(% style="width:200px" %)LEVEL|(% style="width:200px" %)Integer
402 |(% style="width:200px" %)SUCCESS|(% style="width:200px" %)Boolean
403 |(% style="width:200px" %)CONTENT_TYPE|(% style="width:200px" %)String
404 |(% style="width:200px" %)CONTENT_LIST|(% style="width:200px" %)Array of strings
405 |(% style="width:200px" %)CONTENT_ID|(% style="width:200px" %)String
406 |(% style="width:200px" %)CURRENCY|(% style="width:200px" %)String
407 |(% style="width:200px" %)REGISTRATION_METHOD|(% style="width:200px" %)String
408 |(% style="width:200px" %)QUANTITY|(% style="width:200px" %)Integer
409 |(% style="width:200px" %)PAYMENT_INFO_AVAILABLE|(% style="width:200px" %)Boolean
410 |(% style="width:200px" %)RATING_VALUE|(% style="width:200px" %)Float
411 |(% style="width:200px" %)MAX_RATING_VALUE|(% style="width:200px" %)Float
412 |(% style="width:200px" %)SEARCH_STRING|(% style="width:200px" %)String
413 |(% style="width:200px" %)DESCRIPTION|(% style="width:200px" %)String
414 |(% style="width:200px" %)SCORE|(% style="width:200px" %)Integer
415 |(% style="width:200px" %)DESTINATION_A|(% style="width:200px" %)String
416 |(% style="width:200px" %)DESTINATION_B|(% style="width:200px" %)String
417 |(% style="width:200px" %)CLASS|(% style="width:200px" %)String
418 |(% style="width:200px" %)DATE_A|(% style="width:200px" %)String
419 |(% style="width:200px" %)DATE_B|(% style="width:200px" %)String
420 |(% style="width:200px" %)EVENT_START|(% style="width:200px" %)Unixtime
421 |(% style="width:200px" %)EVENT_END|(% style="width:200px" %)Unixtime
422 |(% style="width:200px" %)LATITUDE|(% style="width:200px" %)Double
423 |(% style="width:200px" %)LONGITUDE|(% style="width:200px" %)Double
424 |(% style="width:200px" %)CUSTOMER_USER_ID|(% style="width:200px" %)String
425 |(% style="width:200px" %)CUSTOMER_SEGMENT|(% style="width:200px" %)String
426 |(% style="width:200px" %)VALIDATED|(% style="width:200px" %)String
427 |(% style="width:200px" %)RECEIPT_ID|(% style="width:200px" %)String
428 |(% style="width:200px" %)ORDER_ID|(% style="width:200px" %)String
429 |(% style="width:200px" %)TUTORIAL_ID|(% style="width:200px" %)String
430 |(% style="width:200px" %)ACHIEVEMENT_ID|(% style="width:200px" %)String
431 |(% style="width:200px" %)VIRTUAL_CURRENCY_NAME|(% style="width:200px" %)String
432 |(% style="width:200px" %)DEEP_LINK|(% style="width:200px" %)String
433 |(% style="width:200px" %)OLD_VERSION|(% style="width:200px" %)String
434 |(% style="width:200px" %)NEW_VERSION|(% style="width:200px" %)String
435 |(% style="width:200px" %)REVIEW_TEXT|(% style="width:200px" %)String
436 |(% style="width:200px" %)COUPON_CODE|(% style="width:200px" %)String
437 |(% style="width:200px" %)DEPARTING_DEPARTURE_DATE|(% style="width:200px" %)String
438 |(% style="width:200px" %)RETURNING_DEPARTURE_DATE|(% style="width:200px" %)String
439 |(% style="width:200px" %)DESTINATION_LIST|(% style="width:200px" %)String[]
440 |(% style="width:200px" %)CITY|(% style="width:200px" %)String
441 |(% style="width:200px" %)REGION|(% style="width:200px" %)String
442 |(% style="width:200px" %)COUNTRY|(% style="width:200px" %)String
443 |(% style="width:200px" %)DEPARTING_ARRIVAL_DATE|(% style="width:200px" %)String
444 |(% style="width:200px" %)RETURNING_ARRIVAL_DATE|(% style="width:200px" %)String
445 |(% style="width:200px" %)SUGGESTED_DESTINATIONS|(% style="width:200px" %)String[]
446 |(% style="width:200px" %)TRAVEL_START|(% style="width:200px" %)String
447 |(% style="width:200px" %)TRAVEL_END|(% style="width:200px" %)String
448 |(% style="width:200px" %)NUM_ADULTS|(% style="width:200px" %)Integer
449 |(% style="width:200px" %)NUM_CHILDREN|(% style="width:200px" %)Integer
450 |(% style="width:200px" %)NUM_INFANTS|(% style="width:200px" %)Integer
451 |(% style="width:200px" %)SUGGESTED_HOTELS|(% style="width:200px" %)String[]
452 |(% style="width:200px" %)USER_SCORE|(% style="width:200px" %)Float
453 |(% style="width:200px" %)HOTEL_SCORE|(% style="width:200px" %)Float
454 |(% style="width:200px" %)PURCHASE_CURRENCY|(% style="width:200px" %)String
455 |(% style="width:200px" %)PREFERRED_STAR_RATINGS|(% style="width:200px" %)Integer[2]
456 |(% style="width:200px" %)PREFERRED_PRICE_RANGE|(% style="width:200px" %)Integer[2]
457 |(% style="width:200px" %)PREFERRED_NEIGHBORHOODS|(% style="width:200px" %)String[]
458 |(% style="width:200px" %)PREFERRED_NUM_STOPS|(% style="width:200px" %)Integer
459 |(% style="width:200px" %)CONTENT|(% style="width:200px" %)String
460 |(% style="width:200px" %)PARAM_1|(% style="width:200px" %)String
461 |(% style="width:200px" %)PARAM_2|(% style="width:200px" %)String
462 |(% style="width:200px" %)PARAM_3|(% style="width:200px" %)String
463 |(% style="width:200px" %)PARAM_4|(% style="width:200px" %)String
464 |(% style="width:200px" %)PARAM_5|(% style="width:200px" %)String
465 |(% style="width:200px" %)PARAM_6|(% style="width:200px" %)String
466 |(% style="width:200px" %)PARAM_7|(% style="width:200px" %)String
467 |(% style="width:200px" %)PARAM_8|(% style="width:200px" %)String
468 |(% style="width:200px" %)PARAM_9|(% style="width:200px" %)String
469 |(% style="width:200px" %)PARAM_10|(% style="width:200px" %)String
470
471 {{/showhide}}
472
473 == 3.3 Remaining methods ==
474
475 **Mobigate.setCollectAll()**
476 This method enables all data collectors. By default all data collectors are enabled.
477
478 {{showhide id="3" showmessage="Example" hidemessage="Example"}}
479 {{code language="javascript"}}
480 Mobigate.disableAllDataCollector()
481 {{/code}}
482 {{/showhide}}
483
484 (% style="color:powderblue" %)
485 ----
486
487 **Mobigate.configureDataCollectors(enable, collectors)**
488 Enable or disable DataCollector by array collectors input
489
490 (% class="table-bordered table-hover" style="border-color:powderblue" %)
491 |=(% style="background-color:powderblue" %)Name|=(% style="background-color:powderblue" %)Type|=(% style="background-color:powderblue" %)Description
492 |enable|boolean|true if enable, false if disable|
493 |collectors|array of [[data collector const>>doc:||anchor="H4.3Datacollectorsconstants"]]|e.g.,[Mobigate.DATA_COLLECTOR_BATTERY, DATA_COLLECTOR_GEOLOCATION]|
494
495 {{showhide id="3" showmessage="Example" hidemessage="Example"}}
496 {{code language="javascript"}}
497 Mobigate.configureDataCollectors(true, [Mobigate.DATA_COLLECTOR_APPS_LIST,
498 Mobigate.DATA_COLLECTOR_BATTERY,
499 Mobigate.DATA_COLLECTOR_PHONE_INFO])
500 {{/code}}
501 {{/showhide}}
502
503 (% style="color:powderblue" %)
504 ----
505
506 **Mobigate.disableAllDataCollector()**
507 Disable all data collectors
508
509 {{showhide id="3" showmessage="Example" hidemessage="Example"}}
510 {{code language="javascript"}}
511 Mobigate.disableAllDataCollector()
512 {{/code}}
513 {{/showhide}}
514
515 (% style="color:powderblue" %)
516 ----
517
518 **Mobigate.setEmail(email)**
519 Set user's email
520
521 (% class="table-bordered table-hover" style="border-color:powderblue" %)
522 |=(% style="background-color:powderblue" %)Name|=(% style="background-color:powderblue" %)Type|=(% style="background-color:powderblue" %)Description
523 |email |String |user's email address |
524
525 {{showhide id="3" showmessage="Example" hidemessage="Example"}}
526 {{code language="javascript"}}
527 Mobigate.setEmail('emailExample@spicymobile.pl')
528 {{/code}}
529 {{/showhide}}
530
531 (% style="color:powderblue" %)
532 ----
533
534 **Mobigate.getEmail(onSuccess, onError)**
535 Get previously set user email
536
537 (% class="table-bordered table-hover" style="border-color:powderblue" %)
538 |=(% style="background-color:powderblue" %)Name|=(% style="background-color:powderblue" %)Type|=(% style="background-color:powderblue" %)Description
539 |onSuccess |Function |returns callback object
540 |onError |Function |returns callback object
541
542 {{showhide id="3" showmessage="Example" hidemessage="Example"}}
543 {{code language="javascript"}}
544 Mobigate.getEmail((success) => {
545 console.log("user email: " + success)
546 }, (error) => {
547 console.log(error)
548 })
549 {{/code}}
550 {{/showhide}}
551
552 (% style="color:powderblue" %)
553 ----
554
555 **Mobigate.setFbToken(token)**
556 Set fb token for social network collector
557
558 (% class="table-bordered table-hover" style="border-color:powderblue" %)
559 |=(% style="background-color:powderblue" %)Name|=(% style="background-color:powderblue" %)Type|=(% style="background-color:powderblue" %)Description
560 |token |string |facebook token
561
562 {{showhide id="3" showmessage="Example" hidemessage="Example"}}
563 {{code language="javascript"}}
564 Mobigate.setFbToken('9dsf87ds98978das98d7893u12rj808d0j09012jd012')
565 {{/code}}
566 {{/showhide}}
567
568 (((
569 (% class="showhidebutton" %)
570 (((
571 {{html clean="false"}}
572 <a href="javascript:void(0)" id="showhidebuttontext3" data-show-duration="0" data-show-effect="toggle" data-show-message="Example" data-hide-message="Example">Example</a>
573 {{/html}}
574 )))
575
576 (% class="showhidecontent" id="showhidecontent3" style="display: none;" %)
577 (((
578 (((
579 {{code language="javascript"}}
580 Mobigate.setFbToken('9dsf87ds98978das98d7893u12rj808d0j09012jd012')
581 {{/code}}
582 )))
583 )))
584 )))
585
586
587
588 (% style="color:powderblue" %)
589 ----
590
591 **Mobigate.getSDKInfo(onSuccess, onError)**
592 Getting information about the library
593
594 (% class="table-bordered table-hover" style="border-color:powderblue" %)
595 |=(% style="background-color:powderblue" %)Name|=(% style="background-color:powderblue" %)Type|=(% style="background-color:powderblue" %)Description
596 |onSuccess |Function |returns callback object
597 |onError |Function |returns callback object
598
599 {{showhide id="3" showmessage="Example" hidemessage="Example"}}
600 {{code language="javascript"}}
601 Mobigate.getSDKInfo((success) => {
602 console.log("sdk info: " + success)
603 }, (error) => {
604 console.log(error)
605 })
606 {{/code}}
607 {{/showhide}}
608
609 (% style="color:powderblue" %)
610 ----
611
612 **Mobigate.getSDKUniqueIdentifier(onSuccess, onError)**
613 Return unique SDK identificator
614
615 (% class="table-bordered table-hover" style="border-color:powderblue" %)
616 |=(% style="background-color:powderblue" %)Name|=(% style="background-color:powderblue" %)Type|=(% style="background-color:powderblue" %)Description
617 |onSuccess |Function |returns callback object
618 |onError |Function |returns callback object
619
620 {{showhide id="3" showmessage="Example" hidemessage="Example"}}
621 {{code language="javascript"}}
622 Mobigate.getSDKUniqueIdentifier((success) => {
623 console.log("UUID: " + success)
624 }, (error) => {
625 console.log(error)
626 })
627 {{/code}}
628 {{/showhide}}
629
630 (% style="color:powderblue" %)
631 ----
632
633 **Mobigate.getIDsProfiles(onSuccess, onError)**
634 Method returns IDs profiles. List of IDs profiles in the application memory is updated (synchronized with the server) at specified intervals. To enable functionality, use the 'enableIDsProfiles (boolean enable)' method. Returns the identifiers of IDs profiles (ex. 5,9,20), returns '0' if list of user IDs profiles is empty, returns 'null' if the system has not yet communicated
635
636
637 (% class="table-bordered table-hover" style="border-color:powderblue" %)
638 |=(% style="background-color:powderblue" %)Name|=(% style="background-color:powderblue" %)Type|=(% style="background-color:powderblue" %)Description
639 |onSuccess |Function |returns callback object
640 |onError |Function |returns callback object
641
642 {{showhide id="3" showmessage="Example" hidemessage="Example"}}
643 {{code language="javascript"}}
644 Mobigate.getIDsProfiles((success) => {
645 console.log("Profiles: " + success)
646 }, (error) => {
647 console.log(error)
648 })
649 {{/code}}
650 {{/showhide}}
651
652 (% style="color:powderblue" %)
653 ----
654
655 **Mobigate.getAdOceanTargeting(onSuccess, onError)**
656 Getting numerical variables, that can be used for ads targeting. Method must be called from separate thread. Return 3 different identifiers of a user, encoded into a map of AdOcean numerical variables
657
658 (% class="table-bordered table-hover" style="border-color:powderblue" %)
659 |=(% style="background-color:powderblue" %)Name|=(% style="background-color:powderblue" %)Type|=(% style="background-color:powderblue" %)Description
660 |onSuccess |Function |returns callback object
661 |onError |Function |returns callback object
662
663 {{showhide id="3" showmessage="Example" hidemessage="Example"}}
664 {{code language="javascript"}}
665 Mobigate.getAdOceanTargeting((success) => {
666 console.log("Adocean targeting: " + success)
667 }, (error) => {
668 console.log(error)
669 })
670 {{/code}}
671 {{/showhide}}
672
673 = 4. Constants =
674
675 The plugin provides many helpful constants for easier implementation.
676
677 == 4.1 User field constants ==
678
679 Used to set custom user fields inside //Mobigate.init()// method:
680
681 * Mobigate.USER_FIELD_EMAIL
682 * Mobigate.USER_FIELD_IMSI
683 * Mobigate.USER_FIELD_IMEI
684 * Mobigate.USER_FIELD_SERIAL
685
686 == 4.2 Data gather policy constants ==
687
688 Used to set how the library collects data:
689
690 * Mobigate.DATA_GATHER_POLICY_DEFAULT
691 * Mobigate.DATA_GATHER_POLICY_HIDE_TRAY
692 * Mobigate.DATA_GATHER_POLICY_BLOCK_DATA_BG
693
694 == 4.3 Data collectors constants ==
695
696 Used to set which data the library should collect:
697
698 * Mobigate.DATA_COLLECTOR_APPS_LIST
699 * Mobigate.DATA_COLLECTOR_APPS_USAGE
700 * Mobigate.DATA_COLLECTOR_BATTERY
701 * Mobigate.DATA_COLLECTOR_BROWSER
702 * Mobigate.DATA_COLLECTOR_CALENDAR_EVENTS
703 * Mobigate.DATA_COLLECTOR_CPU_PROCESS
704 * Mobigate.DATA_COLLECTOR_DICTIONARY
705 * Mobigate.DATA_COLLECTOR_GEOLOCATION
706 * Mobigate.DATA_COLLECTOR_HEADSET_PLUG
707 * Mobigate.DATA_COLLECTOR_MEDIA_FILES
708 * Mobigate.DATA_COLLECTOR_MEMORY_USEAGE
709 * Mobigate.DATA_COLLECTOR_NETWORK_CONNECTION
710 * Mobigate.DATA_COLLECTOR_NETWORK_USEAGE
711 * Mobigate.DATA_COLLECTOR_PACKAGE_CHANGE
712 * Mobigate.DATA_COLLECTOR_PHONE_INFO
713 * Mobigate.DATA_COLLECTOR_ROAMING
714 * Mobigate.DATA_COLLECTOR_SCREEN_ORIENTED
715 * Mobigate.DATA_COLLECTOR_SIGNAL_STRENGTH
716 * Mobigate.DATA_COLLECTOR_PROFILE_MODE
717 * Mobigate.DATA_COLLECTOR_WIFI_DATA_CONNECTION
718 * Mobigate.DATA_COLLECTOR_PERMISSION_COLLECTOR
719 * Mobigate.DATA_COLLECTOR_NFC_COLLECTOR
720 * Mobigate.DATA_COLLECTOR_BLUETOOTH_COLLECTOR
721 * Mobigate.DATA_COLLECTOR_BLUETOOTH_DEVICES_COLLECTOR
722 * Mobigate.DATA_COLLECTOR_MOVEMENT_COLLECTOR
723 * Mobigate.DATA_COLLECTOR_FACEBOOK_NETWORK_COLLECTOR
724 * Mobigate.DATA_COLLECTOR_ROOT_COLLECTOR
725
726 == 4.4 Category and parameter constants ==
727
728 Instead of using defined [[categories>>doc:||anchor="H3.2.3Eventcategories"]] or [[parameters>>doc:||anchor="H3.2.4Eventparameters"]] in the form of text, you can use constants defined in the plugin. All you have to do is add the prefix "CATEGORY_" or "PARAMETER_" to the category name or parameter e.g., Mobigate.CATEGORY_LEVEL_ACCOMPLISHED, Mobigate.CATEGORY_PURCHASE, Mobigate.PARAMETER_PRICE, Mobigate.PARAMETER_LEVEL.
729
730 = 5. Sample app =
731
732 The sample application is located in the github repository [[here>>https://github.com/mobigatesdk/react-native-mobigate]] in //example// folder.
Spicy Mobile
spicymobile.pl