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
@@ -585,7 +585,7 @@ describe('GoogleAnalytics', () => {
|
||||
expect(data).toMatchObject({
|
||||
hitType: 'event',
|
||||
// expect to use the new default category
|
||||
eventCategory: 'app',
|
||||
eventCategory: 'App',
|
||||
eventAction: 'click',
|
||||
eventLabel: 'on something',
|
||||
eventValue: 42,
|
||||
|
||||
+5
-2
@@ -167,10 +167,13 @@ export class GoogleAnalytics implements AnalyticsApi, NewAnalyticsApi {
|
||||
const customMetadata = this.getCustomDimensionMetrics(context, attributes);
|
||||
|
||||
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.pageview(subject, customMetadata);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user