You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+24-4
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,8 @@ Clickstream Flutter SDK can help you easily collect and report events from your
6
6
7
7
The SDK relies on the [Clickstream Android SDK](https://github.com/awslabs/clickstream-android) and [Clickstream Swift SDK](https://github.com/awslabs/clickstream-swift). Therefore, flutter SDK also supports automatically collect common user events and attributes (e.g., session start, first open). In addition, we've added easy-to-use APIs to simplify data collection in Flutter apps.
8
8
9
+
Visit our [Documentation site](https://awslabs.github.io/clickstream-analytics-on-aws/en/sdk-manual/flutter/) to learn more about Clickstream Flutter SDK.
10
+
9
11
## Integrate SDK
10
12
11
13
### Include SDK
@@ -81,7 +83,7 @@ analytics.setUserAttributes({
81
83
});
82
84
```
83
85
84
-
When opening for the first time after integrating the SDK, you need to manually set the user attributes once, and current login user's attributes will be cached in native disk, so the next time browser open you don't need to set all user's attribute again, of course you can use the same api `analytics.setUserAttributes()` to update the current user's attribute when it changes.
86
+
Current login user's attributes will be cached in disk, so the next time app launch you don't need to set all user's attribute again, of course you can use the same api `analytics.setUserAttributes()` to update the current user's attribute when it changes.
85
87
86
88
#### Add global attribute
87
89
@@ -91,6 +93,9 @@ analytics.addGlobalAttributes({
91
93
"_traffic_source_name": "Summer promotion",
92
94
"level": 10
93
95
});
96
+
97
+
// delete global attribute
98
+
analytics.deleteGlobalAttributes(["level"]);
94
99
```
95
100
96
101
It is recommended to set global attributes after each SDK initialization, global attributes will be included in all events that occur after it is set.
@@ -106,7 +111,7 @@ analytics.init(
106
111
endpoint: "https://example.com/collect",
107
112
isLogEvents: false,
108
113
isCompressEvents: false,
109
-
sendEventsInterval: 5000,
114
+
sendEventsInterval: 10000,
110
115
isTrackScreenViewEvents: true,
111
116
isTrackUserEngagementEvents: true,
112
117
isTrackAppExceptionEvents: false,
@@ -115,10 +120,10 @@ analytics.init(
115
120
);
116
121
```
117
122
118
-
Here is an explanation of each property:
123
+
Here is an explanation of each option:
119
124
120
125
-**appId (Required)**: the app id of your project in control plane.
121
-
-**endpoint (Required)**: the endpoint path you will upload the event to AWS server.
126
+
-**endpoint (Required)**: the endpoint path you will upload the event to Clickstream ingestion server.
122
127
-**isLogEvents**: whether to print out event json for debugging, default is false.
123
128
-**isCompressEvents**: whether to compress event content when uploading events, default is `true`
124
129
-**sendEventsInterval**: event sending interval millisecond, works only bath send mode, the default value is `5000`
@@ -153,6 +158,21 @@ final analytics = ClickstreamAnalytics();
153
158
analytics.flushEvents();
154
159
```
155
160
161
+
#### Disable SDK
162
+
163
+
You can disable the SDK in the scenario you need. After disabling the SDK, the SDK will not handle the logging and
164
+
sending of any events. Of course, you can enable the SDK when you need to continue logging events.
0 commit comments