@convivainc/conviva-react-native-appanalytics 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,4 @@
1
+
2
+ # Changelog
3
+ ## 0.0.1 (02/APR/2023)
4
+ * Initial version of the Conviva React Native Sensor.
@@ -0,0 +1 @@
1
+ This Conviva React Native App Sensor SDK is the proprietary and confidential information of Conviva Inc. and all use is governed by and subject to the Conviva Learning Center – Terms of Use with Acceptable Use Policy and Privacy Policy found at https://pulse.conviva.com/learning-center/content/a_common/terms_of_use.htm. Conviva® Learning Center. All rights reserved.
package/README.md ADDED
@@ -0,0 +1,104 @@
1
+ # conviva-react-native-appanalytics
2
+ ## Application Analytics for Conviva React Native Sensor
3
+ Use Application Analytics to autocollect events, track application specific events and state changes, and track users anonymously. Internally it is built on top of the Native [Android](https://github.com/Conviva/conviva-android-appanalytics) and [iOS](https://github.com/Conviva/conviva-ios-appanalytics) Sensors
4
+
5
+ ## Installation
6
+
7
+ ### Install via npm:
8
+ ```js
9
+ npm install @convivainc/conviva-react-native-appanalytics --save
10
+ npx pod-install
11
+ ```
12
+ ### Install the Android React Native wrapper via Maven:
13
+ ```
14
+ dependencies {
15
+ ...
16
+ implementation 'com.conviva.sdk:conviva-react-native-tracker:<version>'
17
+ }
18
+ ```
19
+ ### Install the iOS React Native wrapper via Cocoapods:
20
+ ```
21
+ pod 'RNConvivaAppAnalytics', 'version'
22
+ ```
23
+ ## Initialize the tracker
24
+ ```js
25
+ import { createTracker } from '@convivainc/conviva-react-native-appanalytics';
26
+
27
+ createTracker(customerKey: string, appName: string);
28
+
29
+ const tracker = createTracker(
30
+ customerKey,
31
+ appName
32
+ );
33
+ ```
34
+ <strong>customerKey</strong> - a string to identify specific customer account. Different keys shall be used for development / debug versus production environment. Find your keys on the account info page in Pulse.
35
+
36
+ <strong>appName</strong> - a string value used to distinguish your applications. Simple values that are unique across all of your integrated platforms work best here.
37
+
38
+
39
+ ## Set the user id (viewer id)
40
+ ```js
41
+ tracker.setSubjectData({userId?: string});
42
+
43
+ let viewerId = "testuserid@test.com"
44
+ tracker.setSubjectData({userId: viewerId});
45
+ ```
46
+
47
+ ## Report PageView Events for tracking in-app page navigations.
48
+ ```js
49
+ tracker.trackPageViewEvent({pageUrl: string, pageTitle?: string, referrer?: string});
50
+
51
+ let pageViewEvent = {'pageUrl' : 'https://allpopulated.com',
52
+ 'pageTitle' : 'some title',
53
+ 'referrer' : 'http://refr.com'};
54
+ tracker.trackPageViewEvent(pageViewEvent);
55
+ ```
56
+
57
+ ## Custom event tracking to track your application specific events and state changes
58
+ Use trackCustomEvent() API to track all kinds of events. This API provides 2 fields to describe the tracked events.
59
+
60
+ eventName - Name of the custom event. (Mandatory)
61
+
62
+ eventData - Any JSON Object.
63
+
64
+ The following example shows the implementation of the 'onClick' event listener to any element.
65
+ ```js
66
+ tracker.trackCustomEvent(eventName: string, eventData?: any);
67
+
68
+ let eventName = "custom_event_name";
69
+ let eventData = {"tagKey1" : "tagValue1", "tagKey2" : 100, "tagKey3" : true};
70
+ tracker.trackCustomEvent(eventName, eventData);
71
+ ```
72
+
73
+ ## Setting / Clear Custom tags to report your application specific data.
74
+ Use setCustomTags() API to set all kinds of tags (key value pairs). This API provides 1 argument to describe the tags.
75
+
76
+ data - Any JSON Object.
77
+
78
+ The following example shows the implementation of the 'onClick' event listener to any element.
79
+
80
+ ```js
81
+ tracker.setCustomTags(customTagsToSet: any);
82
+
83
+ let customTagsToSet = {"tagKey1" : "tagValue1", "tagKey2" : 100, "tagKey3" : true};
84
+ tracker.setCustomTags(customTagsToSet);
85
+ ```
86
+
87
+ Use clearCustomTags() API to remove that are set prior. This API provides 1 argument to describe an array of tag keys to be removed.
88
+
89
+ keys - Array of strings representing tag keys.
90
+
91
+ The following example shows the implementation of the 'onClick' event listener to any element.
92
+ ```js
93
+ tracker.clearCustomTags(tagKeys: string[]);
94
+
95
+ let customTagKeysToClear = ['tagKey2', 'tagKey3'];
96
+ tracker.clearCustomTags(customTagKeysToClear);
97
+ ```
98
+
99
+ Use clearAllCustomTags() API to remove all the custom tags that are set prior.
100
+
101
+ The following example shows the implementation of the 'onClick' event listener to any element.
102
+ ```js
103
+ tracker.clearAllCustomTags();
104
+ ```