fix: analytics catagory locale
Signed-off-by: Camila Belo <camilaibs@gmail.com> Co-authored-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
+1
-1
@@ -526,7 +526,7 @@ describe('GoogleAnalytics4', () => {
|
||||
expect(fnEvent).toHaveBeenCalledWith('page_view', {
|
||||
action: 'page_view',
|
||||
label: '/',
|
||||
category: 'app',
|
||||
category: 'App',
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
+5
-2
@@ -171,10 +171,13 @@ export class GoogleAnalytics4 implements AnalyticsApi, NewAnalyticsApi {
|
||||
}
|
||||
|
||||
const extensionId = context.extensionId || context.extension;
|
||||
const category = extensionId ? String(extensionId) : 'app';
|
||||
const category = extensionId ? String(extensionId) : 'App';
|
||||
|
||||
// The legacy default extension was 'App' and the new one is 'app'
|
||||
if (action === 'navigate' && category.toLocaleLowerCase() === 'app') {
|
||||
if (
|
||||
action === 'navigate' &&
|
||||
category.toLocaleLowerCase('en-US').startsWith('app')
|
||||
) {
|
||||
this.capture.event(
|
||||
{
|
||||
category,
|
||||
|
||||
Reference in New Issue
Block a user