Hi everyone,
I am using firebase-analytics plugin in my ionic 3 app, which I installed following this link:
Now, when I try to fire a custom event using this:
this.firebaseAnalytics.logEvent('page_view', {page: "dashboard"})
.then((res: any) => console.log(res))
.catch((error: any) => console.error(error));
I am getting an error as:
ERROR Error: Uncaught (in promise): TypeError: Object(...) is not a function
TypeError: Object(...) is not a function
at FirebaseAnalytics.logEvent (vendor.js:102827)
at MyApp.webpackJsonp.853.MyApp.registerFA (main.js:8375)
at main.js:8239
at t.invoke (polyfills.js:3)
at Object.onInvoke (vendor.js:4509)
at t.invoke (polyfills.js:3)
at r.run (polyfills.js:3)
at polyfills.js:3
at t.invokeTask (polyfills.js:3)
at Object.onInvokeTask (vendor.js:4500)
at FirebaseAnalytics.logEvent (vendor.js:102827)
at MyApp.webpackJsonp.853.MyApp.registerFA (main.js:8375)
at main.js:8239
at t.invoke (polyfills.js:3)
at Object.onInvoke (vendor.js:4509)
at t.invoke (polyfills.js:3)
at r.run (polyfills.js:3)
at polyfills.js:3
at t.invokeTask (polyfills.js:3)
at Object.onInvokeTask (vendor.js:4500)
at c (polyfills.js:3)
at polyfills.js:3
at t.invokeTask (polyfills.js:3)
at Object.onInvokeTask (vendor.js:4500)
at t.invokeTask (polyfills.js:3)
at r.runTask (polyfills.js:3)
at o (polyfills.js:3)
I don’t know what is the problem as no custom methods like setCurrentScreen() , setUserId()
etc aren’t working.
But all the automatic tracking events like “user_engagement”, “screen_view”, etc which are fired by firebase analytics by default are working properly (I even saw them in my firebase console).
Please help