|
1 | 1 | # Changelog
|
2 | 2 |
|
| 3 | +## 2.2.0 |
| 4 | + |
| 5 | +- Track Custom Analytics events (requires paid plan) [#338](https://github.com/wiredashio/wiredash-sdk/pull/338) |
| 6 | + |
| 7 | + Record user interactions or other significant occurrences within your app and send them to the Wiredash service for analysis. |
| 8 | + |
| 9 | + Use [Wiredash.trackEvent] for easy access from everywhere in your app. |
| 10 | + |
| 11 | + ```dart |
| 12 | + await Wiredash.trackEvent('Click Button', data: {/**/}); |
| 13 | + ``` |
| 14 | + |
| 15 | + Use the [WiredashAnalytics] instance for easy mocking and testing |
| 16 | + |
| 17 | + ```dart |
| 18 | + final analytics = WiredashAnalytics(); |
| 19 | + await analytics.trackEvent('Click Button', data: {/**/}); |
| 20 | + |
| 21 | + // inject into other classes |
| 22 | + final bloc = MyBloc(analytics: analytics); |
| 23 | + ``` |
| 24 | + |
| 25 | + Access the correct [Wiredash] project via context to send events to if you use multiple Wiredash widgets in your app. This way you don't have to specify the [projectId] every time you call [trackEvent]. |
| 26 | + |
| 27 | + ```dart |
| 28 | + Wiredash.of(context).trackEvent('Click Button'); |
| 29 | + ``` |
| 30 | + |
| 31 | + **eventName** constraints |
| 32 | + |
| 33 | + - The event name must be between 3 to 64 characters long |
| 34 | + - Contain only letters (a-zA-Z), numbers (0-9), - and _ and spaces |
| 35 | + - Must start with a letter (a-zA-Z) |
| 36 | + - Must not contain double spaces |
| 37 | + - Must not contain double or trailing spaces |
| 38 | + |
| 39 | + **data** constraints |
| 40 | + |
| 41 | + - Parameters must not contain more than 10 key-value pairs |
| 42 | + - Keys must not exceed 128 characters |
| 43 | + - Keys must not be empty |
| 44 | + - Values can be String, int or bool. null is allowed, too. |
| 45 | + - Each individual value must not exceed 1024 characters (after running them through jsonEncode). |
| 46 | + |
| 47 | + **Event Sending Behavior:** |
| 48 | + |
| 49 | + * Events are batched and sent to the Wiredash server periodically at 30-second intervals. |
| 50 | + * The first batch of events is sent after a 5-second delay. |
| 51 | + * Events are also sent immediately when the app goes to the background (not applicable to web platforms). |
| 52 | + * If events cannot be sent due to network issues, they are stored locally and retried later. |
| 53 | + * Unsent events are discarded after 3 days. |
| 54 | + |
| 55 | + **Multiple Wiredash Widgets:** |
| 56 | + |
| 57 | + If you have multiple [Wiredash] widgets in your app with different projectIds, you can specify the desired [projectId] when creating [WiredashAnalytics]. |
| 58 | + This ensures that the event is sent to the correct project. |
| 59 | + |
| 60 | + If no [projectId] is provided and multiple widgets are mounted, the event will be sent to the project associated with the first mounted widget. A warning message will also be logged to the console in this scenario. |
| 61 | + |
| 62 | + **Background Isolates:** |
| 63 | + |
| 64 | + When calling [trackEvent] from a background isolate, the event will be stored locally. |
| 65 | + The main isolate will pick up these events and send them along with the next batch or when the app goes to the background. |
| 66 | + |
3 | 67 | ## 2.1.2
|
4 | 68 |
|
5 | 69 | - Widen package_info_plus range (include 8.x)
|
|
0 commit comments