Skip to content

Commit

Permalink
Merge pull request #4019 from esl/GA4_new_instance_ids
Browse files Browse the repository at this point in the history
Adding new production and CI instance id
  • Loading branch information
chrzaszcz authored May 9, 2023
2 parents b12d6d6 + 9feac2a commit 1d6b370
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions big_tests/tests/service_mongoose_system_metrics_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
-define(SERVER_URL, "http://localhost:8765").
-define(ETS_TABLE, qs).
-define(TRACKING_ID, #{id => "G-7KQE4W9SVJ", secret => "Secret"}).
-define(TRACKING_ID_CI, #{id => "G-7KQE4W9SVJ", secret => "Secret2"}).
-define(TRACKING_ID_CI, #{id => "G-VB91V60SKT", secret => "Secret2"}).
-define(TRACKING_ID_EXTRA, #{id => "UA-EXTRA-TRACKING-ID", secret => "Secret3"}).

-record(event, {
Expand Down Expand Up @@ -193,13 +193,13 @@ all_clustered_mongooses_report_the_same_client_id(_Config) ->
system_metrics_are_reported_to_google_analytics_when_mim_starts(_Config) ->
mongoose_helper:wait_until(fun is_host_count_reported/0, true),
mongoose_helper:wait_until(fun are_modules_reported/0, true),
events_are_reported_to_primary_tracking_id(),
mongoose_helper:wait_until(fun events_are_reported_to_primary_tracking_id/0, true),
all_event_have_the_same_client_id().

system_metrics_are_reported_to_configurable_google_analytics(_Config) ->
mongoose_helper:wait_until(fun is_host_count_reported/0, true),
mongoose_helper:wait_until(fun are_modules_reported/0, true),
events_are_reported_to_both_tracking_ids(),
mongoose_helper:wait_until(fun events_are_reported_to_both_tracking_ids/0, true),
all_event_have_the_same_client_id().

system_metrics_are_reported_to_a_json_file(_Config) ->
Expand Down Expand Up @@ -466,7 +466,7 @@ events_are_reported_to_tracking_ids(ConfiguredTrackingIds) ->
Tab = ets:tab2list(?ETS_TABLE),
ActualTrackingIds = lists:usort([InstanceId || #event{instance_id = InstanceId} <- Tab]),
ExpectedTrackingIds = lists:sort([list_to_binary(Tid) || #{id := Tid} <- ConfiguredTrackingIds]),
?assertEqual(ExpectedTrackingIds, ActualTrackingIds).
ExpectedTrackingIds =:= ActualTrackingIds.

is_feature_reported(EventName, Key) ->
length(match_events(EventName, Key)) > 0.
Expand Down
8 changes: 4 additions & 4 deletions src/system_metrics/service_mongoose_system_metrics.erl
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
-ifdef(PROD_NODE).
% The value "Secret" here is an app id from Google Analytics.
% We refer to it as "Secret" because it is named there that way.
-define(TRACKING_ID, #{id => "G-7KQE4W9SVJ",
secret => "8P4wQIkwSV6zay22uKsnLg"}).
-define(TRACKING_ID, #{id => "G-B4S18X6KY5",
secret => "Rj6lopOLQZ2HPLj50QtYeQ"}).
-else.
-define(TRACKING_ID, #{id => "G-7KQE4W9SVJ",
secret => "8P4wQIkwSV6zay22uKsnLg"}).
-endif.
-define(TRACKING_ID_CI, #{id => "G-7KQE4W9SVJ",
secret => "8P4wQIkwSV6zay22uKsnLg"}).
-define(TRACKING_ID_CI, #{id => "G-VB91V60SKT",
secret => "LFxdCgDsSa-OAPtBnLDqpQ"}).

-include("mongoose.hrl").

Expand Down

0 comments on commit 1d6b370

Please sign in to comment.