Skip to content

Commit

Permalink
added performance analytics (#244)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Ovide authored Sep 24, 2019
1 parent 5100b42 commit a26fb18
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/custom/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"databaseURL": "https://plastic-patrol-fd3b3.firebaseio.com",
"projectId": "plastic-patrol-fd3b3",
"storageBucket": "plastic-patrol-fd3b3.appspot.com",
"messagingSenderId": "845679623528"
"messagingSenderId": "845679623528",
"appId": "1:845679623528:web:11731eae5c93b758"
},
"metadata": {
"metadataServerUrl": "https://md.plasticpatrol.co.uk",
Expand Down
14 changes: 10 additions & 4 deletions src/firebaseInit.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
// see https://firebase.google.com/docs/web/setup
import * as firebase from 'firebase/app';
import 'firebase/auth';
import 'firebase/database';
import 'firebase/firestore';
import "firebase/auth";
import "firebase/database";
import "firebase/firestore";
import "firebase/performance";
// import 'firebase/messaging';
// import 'firebase/functions';
import 'firebase/storage';
import "firebase/storage";

import config from './custom/config'
// Initialize Firebase
const firebaseApp = !firebase.apps.length ? firebase.initializeApp(config.FIREBASE) : firebase.app();
const firestore = firebase.firestore();

// measuring web performance. See https://firebase.google.com/docs/perf-mon/get-started-web
firebase.performance();
// const perf = firebase.performance(); //don't use the reference yet
// TODO: to measure input delay: https://github.com/GoogleChromeLabs/first-input-delay

function isInIframe () {
try {
return window.self !== window.top;
Expand Down

0 comments on commit a26fb18

Please sign in to comment.