-
Notifications
You must be signed in to change notification settings - Fork 930
Firebase Analytics not sending events on Chrome when embaded inside of iframe #4046
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I found a few problems with this issue:
|
(2) would be really helpful if possible because Firebase Analytics is just a wrapper around gtag.js, so if gtag.js works by itself, we can narrow it down to a problem in our wrapper code that I can further look at. If gtag.js does not work by itself, it indicates something about the Facebook iframe is preventing gtag from doing its thing. |
|
I replaced firebase analytics with gtag. Results are the same. https://tagmanager.google.com/ - works only when hosted localy. Do not work when app is placed in facebook iframe on both Chrome and Firefox. |
I think I found a solution. The problem is with this year Chrome cross-site cookie handling. |
Thanks for figuring this out. Considering a separate use case for setting config mentioned in #3988 , perhaps it is worth providing a method for setting gtag config params before Analytics initialization (on |
hi @arczewski would be grateful if you share on how do you override that gtag inizialization and push this setting? did you do it after this code? thank you |
I was struggling with this issue for days. We were losing a lot of data from desktop browsers on the analytics for our Facebook Instant Game (it was reflected on Facebook Analytics, but not on Firebase) and it was very hard to tell why. Adding
Just after |
Thank you so much for pointing me in the right direction! For anyone else wondering how to fix this on the NodeJS library, just initialize it like so: Edit: As pointed out, this is for any browser context. I was using NodeJS for my backend, so I got mixed up there.
|
Not sure about the Node comment as Analytics isn't supported in Node, but in any browser context, that's the correct syntax. Now that this feature's been added I will close this issue with a link to the reference documentation for https://firebase.google.com/docs/reference/js/analytics#initializeanalytics |
[REQUIRED] Describe your environment
Operating System version: Windows
Browser version: Chrome 86
Firebase SDK version: 8.0.0
Firebase Product: Analytics
[REQUIRED] Describe the problem
Application build with Unity WebGL and binded with js sdk don't send statistic when hosted in facebook iframe.
Localy hosted build is working properly and is able to connect to Google Tag Manager.
When launched from Facebook we can see (using Google Analytics extension) analytics logs in console but proxy/browser network tab doesn't show anything.
This problem doesn't occur on Chrome 80, Firefox and Edge(currently only noticed on Chrome 86).
Steps to reproduce:
Unity WebGL app with Firebase JS SDK published on Facebook.
Initialize sdk and publish any event.
We can provide access to app with this problem on facebook.
The text was updated successfully, but these errors were encountered: