Skip to content
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

[firebaseAnalytics]: logScreenView doesn't send the name and class to GA4 in flutter web #12751

Closed
1 task done
JgomesAT opened this issue May 7, 2024 · 17 comments
Closed
1 task done
Assignees
Labels
platform: web Issues / PRs which are specifically for web. plugin: analytics resolution: user This was a user issue, e.g. invalid configuration or code. type: bug Something isn't working

Comments

@JgomesAT
Copy link

JgomesAT commented May 7, 2024

Is there an existing issue for this?

  • I have searched the existing issues.

Which plugins are affected?

Analytics

Which platforms are affected?

Web

Description

I have this code FirebaseAnalytics.instance.logScreenView(screenName: screenName, screenClass: className);
to send the event to screenView, and in the Ga4 I can see the events of screenView but without screenName and screenClass,
this only happened with Flutter Web in Android and iOS work perfectly.
other events in the web dork fine like purchase ¡, in this case, I can see all parameters of the event.

Reproducing the issue

Create an event with this faclility FirebaseAnalytics.instance.logScreenView(screenName: screenName, screenClass: className);

Firebase Core version

2.30.1

Flutter Version

3.19.6

Relevant Log Output

No response

Flutter dependencies

Expand Flutter dependencies snippet
Replace this line with the contents of your `flutter pub deps -- --style=compact`.

Additional context and comments

No response

@JgomesAT JgomesAT added Needs Attention This issue needs maintainer attention. type: bug Something isn't working labels May 7, 2024
@TarekkMA TarekkMA added plugin: analytics platform: web Issues / PRs which are specifically for web. and removed Needs Attention This issue needs maintainer attention. labels May 7, 2024
@TarekkMA
Copy link
Contributor

TarekkMA commented May 7, 2024

Hello @JgomesAT, Can you try this code instead of logScreenView(......) for web.

   analytics.logEvent(
      name: 'screen_view',
      parameters: {
        'firebase_screen': screen_name,
        'firebase_screen_class': screen_name_class,
      },
    );

@TarekkMA TarekkMA added the blocked: customer-response Waiting for customer response, e.g. more information was requested. label May 7, 2024
@JgomesAT
Copy link
Author

JgomesAT commented May 7, 2024

I just found this option and since the last week I have this code:

static void logScreenView(String screenName, String className, {Map<String, dynamic>? parameters}) {
logEvent(
'screen_view',
parameters: <String, dynamic>{
'screen_name': screenName,
'screen_class': className,
"cookie_consent": CookieUtils.getCookieValue(CookieUtils.kCookieIdCookieGprd, encripted: false) == "true" ? "granted" : "denied",
},
);

but the behavior is the same

in your example you put
parameters: {
'firebase_screen': screen_name,
'firebase_screen_class': screen_name_class,
},

I will change my code with your feedback and I'll say something

@google-oss-bot google-oss-bot added Needs Attention This issue needs maintainer attention. and removed blocked: customer-response Waiting for customer response, e.g. more information was requested. labels May 7, 2024
@TarekkMA TarekkMA added blocked: customer-response Waiting for customer response, e.g. more information was requested. and removed Needs Attention This issue needs maintainer attention. labels May 7, 2024
@TarekkMA
Copy link
Contributor

TarekkMA commented May 8, 2024

@JgomesAT Okay waiting for your reply.

@JgomesAT
Copy link
Author

JgomesAT commented May 8, 2024

I think isn't working, in GA4 I can see events of screen_view on web but with out screenNAme, and in Android and iOS its OK

event event_1

@google-oss-bot google-oss-bot added Needs Attention This issue needs maintainer attention. and removed blocked: customer-response Waiting for customer response, e.g. more information was requested. labels May 8, 2024
@TarekkMA
Copy link
Contributor

TarekkMA commented May 8, 2024

Does it work on the firebase console?

@TarekkMA TarekkMA added blocked: customer-response Waiting for customer response, e.g. more information was requested. and removed Needs Attention This issue needs maintainer attention. labels May 8, 2024
@JgomesAT
Copy link
Author

JgomesAT commented May 9, 2024

HOw Can I Prove it in the firebase console?

@google-oss-bot google-oss-bot added Needs Attention This issue needs maintainer attention. and removed blocked: customer-response Waiting for customer response, e.g. more information was requested. labels May 9, 2024
@russellwheatley russellwheatley changed the title [firebaseAnalytics]: logScreenView dont's edn the name and class to GA4 in flutter web [firebaseAnalytics]: logScreenView doesn't send the name and class to GA4 in flutter web May 9, 2024
@JgomesAT
Copy link
Author

JgomesAT commented May 9, 2024

In the firebase console I see the same info,
firebase_conole

@TarekkMA
Copy link
Contributor

I've tested using this chrome extension and I found that data is being sent correctly via the SDK. Can you please try and see if that's the case for you also?

https://chromewebstore.google.com/detail/taghound-analyticsgtmpixe/canpneabbfipaelecfibpmmjbdkiaolf

@TarekkMA TarekkMA added blocked: customer-response Waiting for customer response, e.g. more information was requested. and removed Needs Attention This issue needs maintainer attention. labels May 10, 2024
@JgomesAT
Copy link
Author

OK, thanks I will try this extension

@google-oss-bot google-oss-bot added Needs Attention This issue needs maintainer attention. and removed blocked: customer-response Waiting for customer response, e.g. more information was requested. labels May 10, 2024
@TarekkMA TarekkMA added blocked: customer-response Waiting for customer response, e.g. more information was requested. and removed Needs Attention This issue needs maintainer attention. labels May 10, 2024
@TarekkMA TarekkMA self-assigned this May 10, 2024
@JgomesAT
Copy link
Author

I can see this:

Event Data 10
Language
es-es

Page Location
https://www.andorratelecom.ad/botiga/

Page Title
Andorra Telecom

Screen Resolution
1920x1080
Session Count
1

Session ID
1715330811

ep.cookie_consent
granted

ep.firebase_screen
Dashboard_Particular

ep.firebase_screen_class
minified:DE

ep.origin
firebase

these two events are related to the name and class of screen_view:

ep.firebase_screen
Dashboard_Particular

ep.firebase_screen_class
minified:DE

I don't understand the class minified:DE this Is not a class of my project

@google-oss-bot google-oss-bot added Needs Attention This issue needs maintainer attention. and removed blocked: customer-response Waiting for customer response, e.g. more information was requested. labels May 10, 2024
@JgomesAT
Copy link
Author

In the screen_class I set the same value as screen_name and now I Can see values the problem was the value of screen_class

@TarekkMA
Copy link
Contributor

TarekkMA commented May 10, 2024

Based on the snippet you've shared, it seems like it correctly reports screen_view to GA, but the issue might be on the backend side.

Does the issue still happens?

@TarekkMA TarekkMA added blocked: customer-response Waiting for customer response, e.g. more information was requested. and removed Needs Attention This issue needs maintainer attention. labels May 10, 2024
@JgomesAT
Copy link
Author

It seems that is now working, I can see the screen's name in the GA4 for the web, I force for now in the attribute screenClass the same value of screenName

@google-oss-bot google-oss-bot added Needs Attention This issue needs maintainer attention. and removed blocked: customer-response Waiting for customer response, e.g. more information was requested. labels May 13, 2024
@TarekkMA
Copy link
Contributor

What snippet of cope you used the one with firebase_screen_class and firebase_screen_class?

If so can you please confirm again if logScreenView is working or not?

Thank you

@TarekkMA TarekkMA added the blocked: customer-response Waiting for customer response, e.g. more information was requested. label May 13, 2024
@JgomesAT
Copy link
Author

I've just prepared a version of my code to rollback to the initial logScreenView , I will try and notify the behavior
THX

@google-oss-bot google-oss-bot removed the blocked: customer-response Waiting for customer response, e.g. more information was requested. label May 13, 2024
@TarekkMA TarekkMA added blocked: customer-response Waiting for customer response, e.g. more information was requested. and removed Needs Attention This issue needs maintainer attention. labels May 13, 2024
@JgomesAT
Copy link
Author

I have data in GA4!,

I think all the problems were related to the codification of screenClass

thanks for the support

@TarekkMA
Copy link
Contributor

Glad to hear that the issue have been resolved 🥳

@TarekkMA TarekkMA added resolution: user This was a user issue, e.g. invalid configuration or code. and removed blocked: customer-response Waiting for customer response, e.g. more information was requested. labels May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: web Issues / PRs which are specifically for web. plugin: analytics resolution: user This was a user issue, e.g. invalid configuration or code. type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants