Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit 3218451

Browse files
Log complex event Analytics #989
1 parent 8f00061 commit 3218451

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

docs/ANALYTICS.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,41 @@ For a list of predefined Events [check this Android reference](https://firebase.
4848
);
4949
```
5050

51+
### analytics.logComplexEvent
52+
Same thing as logEvent but you can add an `Array` or specific types (not just `string`).
53+
See `LogComplexEventTypeParameter` for all available types.
54+
55+
```typescript
56+
import * as firebase from "nativescript-plugin-firebase";
57+
import { LogComplexEventTypeParameter } from "nativescript-plugin-firebase";
58+
59+
firebase.analytics.logComplexEvent({
60+
key: "view_item_list",
61+
parameters: [{
62+
key: "item1",
63+
type: "array",
64+
value: [
65+
{
66+
parameters: [
67+
{key: "item_id", value: "id of item", type: LogComplexEventTypeParameter.STRING},
68+
{key: "item_name", value: "name of item", type: LogComplexEventTypeParameter.STRING},
69+
{key: "price", value: 1, type: LogComplexEventTypeParameter.DOUBLE},
70+
{key: "index", value: 1, type: LogComplexEventTypeParameter.INT}
71+
]
72+
},
73+
{
74+
parameters: [
75+
{key: "item_id", value: "id of item", type: LogComplexEventTypeParameter.STRING},
76+
{key: "item_name", value: "name of item", type: LogComplexEventTypeParameter.STRING},
77+
{key: "price", value: 1, type: LogComplexEventTypeParameter.DOUBLE},
78+
{key: "index", value: 2, type: LogComplexEventTypeParameter.INT}
79+
]
80+
}
81+
]
82+
}]
83+
});
84+
```
85+
5186
### analytics.setUserProperty
5287
User properties are attributes you define to describe segments of your userbase, such as language preference or geographic location.
5388

0 commit comments

Comments
 (0)