Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logged Event not reflected in firebase events console. #214

Open
navaneethsaj opened this issue Nov 5, 2023 · 1 comment
Open

Logged Event not reflected in firebase events console. #214

navaneethsaj opened this issue Nov 5, 2023 · 1 comment

Comments

@navaneethsaj
Copy link

I am logging the custom events (eg: game_over, user_registered etc) using logEvent(). I am getting the status "OK" in the success callback. However, I cannot see the events being logged on the events page in the Firebase console. But I am seeing some predefined(page_views, app_started etc) events working.

My code snippet.

@Injectable({
  providedIn: 'root'
})
export class FirebaseService {
  constructor(
    private firebaseAnalytics: FirebaseAnalytics,
    private platform: Platform) {
    this.platform.ready().then(() => {
      this.logEventWithMsg('game_started', {
        username: localStorage.getItem('username') || 'Guest',
        login_id: localStorage.getItem('loginid') || 'Guest'
      });
    }).catch(e => {
      console.error(e);
    });
  }

  public logEventWithMsg(event: string, msg: any) {
    try {
      this.firebaseAnalytics.logEvent(event, { msg })
        .then((res: any) => console.log({ res }))
        .catch((error: any) => console.error({ error }));
    } catch (error) {
      console.log(error);
    }
  }
}

Kindly help.

@navaneethsaj
Copy link
Author

Kindly help @chemerisuk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant