From 9433b0abcce14bc175bddf5f1b4a56d74035905c Mon Sep 17 00:00:00 2001 From: Oscar Reyes Date: Wed, 4 May 2022 15:12:48 -0500 Subject: [PATCH] 395 updating the event names (#423) --- server/http/controller.go | 14 +++++++------- server/main.go | 2 +- web/src/services/Analytics/Analytics.service.ts | 1 + .../services/Analytics/TestAnalytics.service.ts | 2 +- .../services/Analytics/TraceAnalytics.service.ts | 4 ++-- .../Analytics/TraceDiagramAnalytics.service.ts | 2 +- 6 files changed, 13 insertions(+), 12 deletions(-) diff --git a/server/http/controller.go b/server/http/controller.go index 92d991c18a..c18adf360a 100644 --- a/server/http/controller.go +++ b/server/http/controller.go @@ -32,7 +32,7 @@ func (s *controller) CreateTest(ctx context.Context, test openapi.Test) (openapi return openapi.Response(http.StatusInternalServerError, err.Error()), err } - analytics.CreateAndSendEvent("test_created", "test") + analytics.CreateAndSendEvent("test-created-backend", "test") test.TestId = id return openapi.Response(200, test), nil @@ -56,7 +56,7 @@ func (s *controller) UpdateTest(ctx context.Context, testid string, updated open return openapi.Response(http.StatusInternalServerError, err.Error()), err } - analytics.CreateAndSendEvent("test_updated", "test") + analytics.CreateAndSendEvent("test-updated-backend", "test") return openapi.Response(204, nil), nil } @@ -77,7 +77,7 @@ func (s *controller) DeleteTest(ctx context.Context, testid string) (openapi.Imp return openapi.Response(http.StatusInternalServerError, err.Error()), err } - analytics.CreateAndSendEvent("test_deleted", "test") + analytics.CreateAndSendEvent("test-deleted-backend", "test") return openapi.Response(204, nil), nil } @@ -126,7 +126,7 @@ func (s *controller) RunTest(ctx context.Context, testid string) (openapi.ImplRe result := s.runner.Run(*test) - analytics.CreateAndSendEvent("test_run", "test") + analytics.CreateAndSendEvent("test-run-backend", "test") return openapi.Response(200, result), nil } @@ -201,7 +201,7 @@ func (s *controller) CreateAssertion(ctx context.Context, testID string, asserti return openapi.Response(http.StatusInternalServerError, err.Error()), err } - analytics.CreateAndSendEvent("assertion_created", "test") + analytics.CreateAndSendEvent("assertion-created-backend", "test") return openapi.Response(http.StatusOK, assertion), nil } @@ -219,7 +219,7 @@ func (s *controller) UpdateAssertion(ctx context.Context, testID string, asserti return openapi.Response(http.StatusInternalServerError, err.Error()), err } - analytics.CreateAndSendEvent("assertion_updated", "test") + analytics.CreateAndSendEvent("assertion-updated-backend", "test") return openapi.Response(http.StatusNoContent, nil), nil } @@ -235,7 +235,7 @@ func (s *controller) DeleteAssertion(ctx context.Context, testID string, asserti return openapi.Response(http.StatusInternalServerError, err.Error()), err } - analytics.CreateAndSendEvent("assertion_deleted", "test") + analytics.CreateAndSendEvent("assertion-deleted-backend", "test") return openapi.Response(http.StatusNoContent, nil), nil } diff --git a/server/main.go b/server/main.go index 98129006a3..47290e19f5 100644 --- a/server/main.go +++ b/server/main.go @@ -94,7 +94,7 @@ func main() { } }) - err = analytics.CreateAndSendEvent("server_started", "beacon") + err = analytics.CreateAndSendEvent("server-started-backend", "beacon") if err != nil { log.Fatal(err) } diff --git a/web/src/services/Analytics/Analytics.service.ts b/web/src/services/Analytics/Analytics.service.ts index 90bebda96b..388d4b7721 100644 --- a/web/src/services/Analytics/Analytics.service.ts +++ b/web/src/services/Analytics/Analytics.service.ts @@ -18,6 +18,7 @@ export enum Labels { Modal = 'modal', Table = 'table', Form = 'form', + Tab = 'tab', } export const instance = new GA4React(measurementId); diff --git a/web/src/services/Analytics/TestAnalytics.service.ts b/web/src/services/Analytics/TestAnalytics.service.ts index 7cddb71876..ec626b640c 100644 --- a/web/src/services/Analytics/TestAnalytics.service.ts +++ b/web/src/services/Analytics/TestAnalytics.service.ts @@ -2,7 +2,7 @@ import AnalyticsService, {Categories} from './Analytics.service'; enum Actions { RunTest = 'run-test-button-click', - TestRunClick = 'test-run-click', + TestRunClick = 'test-run-result-click', } type TTestAnalytics = { diff --git a/web/src/services/Analytics/TraceAnalytics.service.ts b/web/src/services/Analytics/TraceAnalytics.service.ts index 4e74d78645..0f71d4deb6 100644 --- a/web/src/services/Analytics/TraceAnalytics.service.ts +++ b/web/src/services/Analytics/TraceAnalytics.service.ts @@ -1,4 +1,4 @@ -import AnalyticsService, { Categories, Labels } from "./Analytics.service"; +import AnalyticsService, {Categories, Labels} from './Analytics.service'; enum Actions { ChangeTab = 'change-tab', @@ -16,7 +16,7 @@ const {event} = AnalyticsService(Categories.Trace); const TraceAnalyticsService = (): TTraceAnalytics => { const onChangeTab = (tabName: string) => { - event(Actions.ChangeTab, tabName); + event(`${Actions.ChangeTab}-${tabName}`, Labels.Table); }; const onAddAssertionButtonClick = () => { diff --git a/web/src/services/Analytics/TraceDiagramAnalytics.service.ts b/web/src/services/Analytics/TraceDiagramAnalytics.service.ts index 6aa6270b0d..3f6d57ab28 100644 --- a/web/src/services/Analytics/TraceDiagramAnalytics.service.ts +++ b/web/src/services/Analytics/TraceDiagramAnalytics.service.ts @@ -1,7 +1,7 @@ import AnalyticsService, {Categories} from './Analytics.service'; enum Actions { - ClickSpan = 'click-span-node', + ClickSpan = 'span-node-click', } type TTraceDiagramAnalytics = {