EddyVerbruggen / nativescript-plugin-firebase

:fire: NativeScript plugin for Firebase
https://firebase.google.com
MIT License
1.01k stars 448 forks source link

fireBase.analytics.logComplexEvent not working #1831

Open mikloshumli opened 2 years ago

mikloshumli commented 2 years ago

Anybody can help me what' wrong code? I use Nativescript 6 & nativescript-plugin-firebase 10.6.3 If I use fireBase.analytics.logEvent this params work in firebase debug view

let fireParams = [
            {key: "quantity", value: this.item.itemBoxCartCount.toString().slice(0, 100)},
            {key: "item_category", value: this.item.category.slice(0, 100)},
            {key: "item_name", value: this.item.name.slice(0, 100)},
            {key: "item_id", value: this.item.id.toString().slice(0, 100)},
            {key: "price", value: this.item.price.slice(0, 100)},
            {key: "currency", value: 'HUF'},
            {key: "current_page", value: 'lista'},
        ];
        fireBase.analytics.logEvent({
            key: "add_to_cart",
            parameters: fireParams
        });
Screenshot 2021-07-26 at 16 17 31

But Google Analitycs 4 must change some properties and I must have send items array.

fireBase.analytics.logComplexEvent({
                key: "add_to_cart",
                parameters: [
                    {
                        key: "items",
                        type: "array",
                        value: [
                            {
                                parameters: [
                                    {key: "item_id", value: "id of item", type: LogComplexEventTypeParameter.STRING},
                                    {key: "item_name", value: "name of item", type: LogComplexEventTypeParameter.STRING},
                                    {key: "price", value: 1, type: LogComplexEventTypeParameter.DOUBLE},
                                    {key: "quantity", value: 1, type: LogComplexEventTypeParameter.DOUBLE},
                                    {key: "index", value: 1, type: LogComplexEventTypeParameter.DOUBLE},
                                    {key: "item_brand", value: 'brand', type: LogComplexEventTypeParameter.STRING},
                                ]
                            }
                        ]
                    }
                ]
            }).then(r => {});
Screenshot 2021-07-26 at 16 17 02

But nothing to do in the firebase console debug view. Send add_to_cart event but remove Items tab and nothing params send. Thnx the help.