flutterfire icon indicating copy to clipboard operation
flutterfire copied to clipboard

[firebase_analytics]: Analytics does not sends any events from iframe

Open NickNevzorov opened this issue 8 months ago • 12 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues.

Which plugins are affected?

Analytics

Which platforms are affected?

Web

Description

Standard code (from example):

  try {

    await Firebase.initializeApp(options: firebaseOptions);
    analytics = FirebaseAnalytics.instance;
    observer = FirebaseAnalyticsObserver(analytics: analytics!);
    await analytics?.logEvent(name: 'initialize_app', parameters: {
      'app_name': appName.toLowerCase(),
      'app_version': appVersion.toLowerCase(),
      'app_platform': getPlatformName(),
    } );

  } catch (e) {
    print('initFirebaseAnalytics: ' + e.toString());
  }

If app running from direct address, all working. If app running in iframe tag, analytics does not sends any events (and no errors reported)

Reproducing the issue

http://webshop.vsgroup.ua/ - full version http://webshop.vsgroup.ua/test.html - iframe tag

Firebase Core version

2.32.0

Flutter Version

3.22.01

Relevant Log Output

No response

Flutter dependencies

No response

Additional context and comments

No response

NickNevzorov avatar Jun 03 '24 13:06 NickNevzorov