Skip to content

Logged Event not reflected in firebase events console. #214

Open
@navaneethsaj

Description

@navaneethsaj

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions