最近、GoogleアナリティクスをFirebaseプロジェクトにリンクしましたが、コンソールで次のエラーが発生し、Firebaseアナリティクスダッシュボードにも何も表示されません。
[2022-04-11T06:07:13.736Z] @firebase/analytics: The measurement ID in the local
Firebase config (G-XXXXXXXXX) does not match the measurement ID fetched from the
server (undefined). To ensure analytics events are always sent to the correct Analytics
property, update the measurement ID field in the local config or remove it from the
local config.
これが私が分析を追加する方法です
const firebaseConfig = {
apiKey: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
authDomain: "*****************",
projectId: "********",
storageBucket: "*********",
messagingSenderId: "********",
appId: "*******************************",
measurementId: "G-XXXXXXXXX"
};
const app = firebase.initializeApp(firebaseConfig)
const auth = getAuth(app)
const db = getFirestore(app)
firebase.analytics()
const analytics = getAnalytics(app);
console.log(analytics)
誰かが私が欠けているものを正確に助けることができますか?どんな助けでも大歓迎です。