Skip to content
This repository has been archived by the owner on Sep 19, 2021. It is now read-only.

Commit

Permalink
📈 Enable analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
sasa95 committed May 30, 2020
1 parent e403c92 commit 46441f5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/firebase/firebase.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import firebase from 'firebase/app'
import 'firebase/firestore'
import 'firebase/auth'
import 'firebase/analytics'

const firebaseConfig = {
apiKey: process.env.REACT_APP_API_KEY,
Expand All @@ -10,9 +11,15 @@ const firebaseConfig = {
storageBucket: process.env.REACT_APP_STORAGE_BUCKET,
messagingSenderId: process.env.REACT_APP_MESSAGING_SENDER_ID,
appId: process.env.REACT_APP_APP_ID,
measurementId: process.env.REACT_APP_MEASUREMENT_ID,
}

firebase.initializeApp(firebaseConfig)

if (firebaseConfig.measurementId !== 'test') {
firebase.analytics()
}

firebase
.firestore()
.enablePersistence({ synchronizeTabs: true })
Expand Down

0 comments on commit 46441f5

Please sign in to comment.