-
Notifications
You must be signed in to change notification settings - Fork 912
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
Deprecate analytics function setCurrentScreen #6269
Conversation
|
Size Report 1Affected ProductsTest Logs |
Size Analysis Report 1Affected ProductsNo changes between base commit (aa44d52) and merge commit (b7397d0).Test Logs |
packages/analytics/src/functions.ts
Outdated
@@ -53,6 +53,8 @@ export async function logEvent( | |||
/** | |||
* Set screen_name parameter for this Google Analytics ID. | |||
* | |||
* @deprecated Use logEvent with eventName as 'screen_view' and add relevant eventParams. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add backticks to function and variable names (logEvent, eventName, eventParams)? I think screen_view makes sense with single quotes since it's a string. Actually I think you can link directly to them if they're documented with {@link logEvent}
, see https://github.com/firebase/firebase-js-sdk/blob/master/packages/analytics/src/api.ts#L85 You can generate the docs and double check the links work.
I think only logEvent and eventParams warrant a link.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the {@links logEvent}
and added backticks where necessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, slipped my mind we can actually link guide docs. Can you add a second line
* See {@link https://firebase.google.com/docs/analytics/screenviews
* | Track Screenviews}.
That's from the doc comment for the logEvent overload for 'screen_view' but since we can't link to that overload might as well put it right here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the documentation link for Track Screenviews
packages/firebase/compat/index.d.ts
Outdated
@@ -5215,6 +5215,8 @@ declare namespace firebase.analytics { | |||
|
|||
/** | |||
* Use gtag 'config' command to set 'screen_name'. | |||
* | |||
* @deprecated Use logEvent with eventName as 'screen_view' and add relevant eventParams. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above. Unfortunately links work a little differently in this file as you have to specify the namespace and you're allowed to customize the link text I guess. Search for "@link" in this file for examples, one example is {@link firebase.analytics.Analytics Analytics
} Again, generate docs and make sure the link looks right.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the {@links logEvent}
and added backticks where necessary. The logEvent
link here auto resolves to the compat version firebase.analytics.Analytics.logEvent
in vscode and in the resulting html files post docgen:compat
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Mark setCurrentScreen function within analytics as deprecated. Users should utilize logEvent with eventName as 'screen_view' and add the relevant eventParams. For more information, see https://firebase.google.com/docs/analytics/screenviews#web-version-9