Skip to content

Commit

Permalink
Enhance authentication handling and improve Google Analytics class pr…
Browse files Browse the repository at this point in the history
…operties
  • Loading branch information
dharmesh-hemaram committed Dec 15, 2024
1 parent e1c3597 commit a5edb65
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions apps/acf-extension/src/background/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ try {
};
Runtime.onMessageExternal(onMessageListener);
Runtime.onMessage(onMessageListener);

auth.authStateReady().then(() => {
const clientId = auth.currentUser?.uid;
if (clientId) {
chrome.storage.local.set({ clientId });
}
});
} catch (error) {
if (error instanceof Error) {
googleAnalytics?.fireErrorEvent({ name: error.name, error: error.message, additionalParams: { page: 'background' } });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { FireErrorEventParams, FireEventParams, FirePageViewEventParams } from '
export class GoogleAnalyticsBackground {
debug: boolean;
constructor(
private MEASUREMENT_ID?: string,
private API_SECRET?: string,
private readonly MEASUREMENT_ID?: string,
private readonly API_SECRET?: string,
debug = false
) {
this.MEASUREMENT_ID = MEASUREMENT_ID;
Expand Down

0 comments on commit a5edb65

Please sign in to comment.