Skip to content

Firebase Analytics (Web) does not work in Non-browser Envs #2243

Open
@marcoancona

Description

@marcoancona
  • Operating System version: macOS Mojave
  • Browser version: Electron 5.0.10
  • Firebase SDK version: 7.1.0
  • Firebase Product: Analytics

Describe the problem

Steps to reproduce:

On Electron, Analytics seems to load correctly but no events, sessions or users are logged.

Relevant Code:

Include Firebase using the script tag (as importing the module from NPM fails due to gRPC).

<!-- Firebase App (the core Firebase SDK) is always required and must be listed first -->
<script src="https://www.gstatic.com/firebasejs/7.1.0/firebase-app.js"></script>

<!-- If you enabled Analytics in your project, add the Firebase SDK for Analytics -->
<script src="https://www.gstatic.com/firebasejs/7.1.0/firebase-analytics.js"></script>

<!-- Add Firebase products that you want to use -->
<script src="https://www.gstatic.com/firebasejs/7.1.0/firebase-auth.js"></script>
<script src="https://www.gstatic.com/firebasejs/7.1.0/firebase-firestore.js"></script>
<script>
	firebase.initializeApp({
		...
	});
	firebase.analytics()
</script>

While Firebase seems to load, and a new googletagmanager gets installed on the page, not analytics events seem to reach Firebase dashboard.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions