Make componetName == extension (name)
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
This commit is contained in:
+3
-3
@@ -51,7 +51,7 @@ describe('GoogleAnalytics', () => {
|
||||
|
||||
describe('integration', () => {
|
||||
const context = {
|
||||
componentName: 'App',
|
||||
extension: 'App',
|
||||
pluginId: 'some-plugin',
|
||||
releaseNum: 1337,
|
||||
};
|
||||
@@ -125,7 +125,7 @@ describe('GoogleAnalytics', () => {
|
||||
expect(command).toBe('send');
|
||||
expect(data).toMatchObject({
|
||||
hitType: 'event',
|
||||
eventCategory: context.componentName,
|
||||
eventCategory: context.extension,
|
||||
eventAction: expectedAction,
|
||||
eventLabel: expectedLabel,
|
||||
eventValue: expectedValue,
|
||||
@@ -178,7 +178,7 @@ describe('GoogleAnalytics', () => {
|
||||
expect(command).toBe('send');
|
||||
expect(data).toMatchObject({
|
||||
hitType: 'event',
|
||||
eventCategory: context.componentName,
|
||||
eventCategory: context.extension,
|
||||
eventAction: expectedAction,
|
||||
eventLabel: expectedLabel,
|
||||
eventValue: expectedValue,
|
||||
|
||||
+2
-2
@@ -106,7 +106,7 @@ export class GoogleAnalytics implements AnalyticsApi {
|
||||
}: AnalyticsEvent) {
|
||||
const customMetadata = this.getCustomDimensionMetrics(context, attributes);
|
||||
|
||||
if (action === 'navigate' && context?.componentName === 'App') {
|
||||
if (action === 'navigate' && context?.extension === 'App') {
|
||||
// Set any/all custom dimensions.
|
||||
if (Object.keys(customMetadata).length) {
|
||||
ReactGA.set(customMetadata);
|
||||
@@ -117,7 +117,7 @@ export class GoogleAnalytics implements AnalyticsApi {
|
||||
}
|
||||
|
||||
ReactGA.event({
|
||||
category: context.componentName || 'App',
|
||||
category: context.extension || 'App',
|
||||
action,
|
||||
label: subject,
|
||||
value,
|
||||
|
||||
Reference in New Issue
Block a user