<!-- Firebase Analytics -->
<script type="module">
import { initializeApp } from 'https://www.gstatic.com/firebasejs/10.12.0/firebase-app.js';
import { getAnalytics, logEvent, setUserId } from 'https://www.gstatic.com/firebasejs/10.12.0/firebase-analytics.js';

const app = initializeApp({
  apiKey: @json($apiKey),
  projectId: @json($projectId),
  appId: @json($appId),
  measurementId: @json($measurementId),
});
const analytics = getAnalytics(app);
@if(!empty($userEmailHash))
setUserId(analytics, @json($userEmailHash));
@endif
window.procpFirebaseAnalytics = analytics;
window.firebaseLogEvent = logEvent;
window.procpTracking = window.procpTracking || {};
window.procpTracking.firebase = true;
</script>
<!-- End Firebase Analytics -->
