# Getting error in firebase-analytics plugin using ionic 3

**URL:** <https://forum.ionicframework.com/t/getting-error-in-firebase-analytics-plugin-using-ionic-3/158014>\
**Category:** ionic-v3\
**Created:** [March 2, 2019, 12:55pm UTC](https://forum.ionicframework.com/t/getting-error-in-firebase-analytics-plugin-using-ionic-3/158014 "2019-03-02T12:55:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![saberprashant](https://avatars.discourse-cdn.com/v4/letter/s/3be4f8/32.png) [@saberprashant](https://forum.ionicframework.com/u/saberprashant)\
**Post date:** [March 2, 2019, 12:55pm UTC](https://forum.ionicframework.com/t/getting-error-in-firebase-analytics-plugin-using-ionic-3/158014/1 "2019-03-02T12:55:54Z")

</div>

Hi everyone,

I am using firebase-analytics plugin in my ionic 3 app, which I installed following this link:

> **[Ionic Documentation](https://ionicframework.com/docs/native/firebase-analytics/)**
>
> Ionic is the app platform for web developers. Build amazing mobile, web, and desktop apps all with one shared code base and open web standards

  
Now, when I try to fire a custom event using this:

```auto
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:

```auto
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 🙂

---

<div class="post-metadata">

**Author:** ![sebafra](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sebafra/32/113464_2.png) [@sebafra](https://forum.ionicframework.com/u/sebafra)\
**Post date:** [April 17, 2019, 12:01pm UTC](https://forum.ionicframework.com/t/getting-error-in-firebase-analytics-plugin-using-ionic-3/158014/2 "2019-04-17T12:01:48Z")

</div>

Did you solve the problem?

---

<div class="post-metadata">

**Author:** ![saberprashant](https://avatars.discourse-cdn.com/v4/letter/s/3be4f8/32.png) [@saberprashant](https://forum.ionicframework.com/u/saberprashant)\
**Post date:** [April 20, 2019, 11:02am UTC](https://forum.ionicframework.com/t/getting-error-in-firebase-analytics-plugin-using-ionic-3/158014/3 "2019-04-20T11:02:23Z")

</div>

Hi @sebafra,

Yes, I was able to solve the problem.

View this link if you want a better idea:

> <https://github.com/chemerisuk/cordova-plugin-firebase-analytics/issues/99>

(Don’t forget to like this answer if it solves your problem, like it on github too, so that people will get to know the solution easily.)

---

<div class="post-metadata">

**Author:** ![sebafra](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sebafra/32/113464_2.png) [@sebafra](https://forum.ionicframework.com/u/sebafra)\
**Post date:** [April 22, 2019, 2:28am UTC](https://forum.ionicframework.com/t/getting-error-in-firebase-analytics-plugin-using-ionic-3/158014/4 "2019-04-22T02:28:22Z")

</div>

Thanks for your answer. I don’t have any error at all. I can’t see logs in Firebase console.  
All seems to be ok. But nothing happens.  
Thanks
