Skip to content

Commit 54f19c5

Browse files
author
Athira M
committed
add analytics
1 parent d3d9bee commit 54f19c5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

web-exp-bugbash/my-app/src/app/page.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { useEffect, useState } from "react";
44
import { initializeApp } from "firebase/app";
55
import { getRemoteConfig, fetchAndActivate, getAll, setCustomSignals, getString } from "firebase/remote-config";
66
import { getInstallations } from "firebase/installations";
7+
import { getAnalytics, logEvent } from "firebase/analytics";
78

89
function Screen({isLoading, welcomeMessage} = {isLoading: false, welcomeMessage: ""}) {
910
if (isLoading) {
@@ -41,6 +42,7 @@ export default function Home() {
4142
console.log(process.env.API_KEY);
4243

4344
const app = initializeApp(firebaseConfig);
45+
const analytics = getAnalytics(app);
4446
const config = getRemoteConfig(app);
4547
config.settings.minimumFetchIntervalMillis = 0;
4648

@@ -52,6 +54,7 @@ export default function Home() {
5254
console.log(success, getAll(config));
5355
setIsLoading(false);
5456
setWelcomeMessage(getString(config, 'welcome_message'));
57+
logEvent(analytics, "test-event");
5558
});
5659
});
5760

0 commit comments

Comments
 (0)