From f77f1f5a63cfc233c8fcde5bb87f98808a65acad Mon Sep 17 00:00:00 2001 From: Matt Riley Date: Tue, 11 Feb 2025 15:58:15 -0500 Subject: [PATCH 1/2] Slight tweaks to the domain analytics value --- corehq/apps/analytics/templates/analytics/initial/gtm.html | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/corehq/apps/analytics/templates/analytics/initial/gtm.html b/corehq/apps/analytics/templates/analytics/initial/gtm.html index 10f905a2f1af..a0513ab4ab64 100644 --- a/corehq/apps/analytics/templates/analytics/initial/gtm.html +++ b/corehq/apps/analytics/templates/analytics/initial/gtm.html @@ -6,10 +6,9 @@ {% initial_analytics_data 'gtm.userIsCommCareUser' request.couch_user.is_commcare_user %} {% initial_analytics_data 'gtm.isNewUser' request.couch_user|is_new_user %} {% endif %} -{% if request.domain %} - {% initial_analytics_data 'gtm.domain' request.domain %} -{% elif domain %} - {% initial_analytics_data 'gtm.domain' domain %} +{% if request.domain or domain %} + {% firstof request.domain domain as metrics_domain %} + {% initial_analytics_data 'gtm.domain' metrics_domain %} {% endif %} {% if ANALYTICS_CONFIG.HQ_INSTANCE %} {% initial_analytics_data 'gtm.hqInstance' ANALYTICS_CONFIG.HQ_INSTANCE %} From 6437f81f65982b65e0c91d662a646745c2c8af18 Mon Sep 17 00:00:00 2001 From: Matt Riley Date: Wed, 12 Feb 2025 13:39:18 -0500 Subject: [PATCH 2/2] Fixed failing tests --- corehq/apps/app_manager/tests/test_views.py | 26 ++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/corehq/apps/app_manager/tests/test_views.py b/corehq/apps/app_manager/tests/test_views.py index f7ffc69005aa..5027fc47b981 100644 --- a/corehq/apps/app_manager/tests/test_views.py +++ b/corehq/apps/app_manager/tests/test_views.py @@ -682,22 +682,22 @@ def test_view_form_legacy(self, mock1): 'INVOICING_CONTACT_EMAIL', 'False', 'show_mobile_ux_warning', 'IS_DOMAIN_BILLING_ADMIN', 'translations', 'hq', 'SALES_EMAIL', 'linked_version', 'confirm', 'show_report_modules', 'lang', 'can_view_cloudcare', 'title_block', 'CUSTOM_LOGO_URL', 'items', 'request', 'messages', 'build_profile_access', 'form', 'error', - 'alerts', 'prompt_settings_form', 'submenu', 'domain', 'enable_update_prompts', 'show_shadow_modules', - 'sentry', 'bulk_ui_translation_upload', 'toggles_dict', 'True', 'full_name', 'latest_build_id', - 'previews_dict', 'copy_app_form', 'show_status_page', 'is_linked_app', 'show_shadow_module_v1', - 'use_bootstrap5', 'limit_to_linked_domains', 'add_ons_privileges', 'LANGUAGE_BIDI', 'page_title_block', - 'LANGUAGES', 'underscore', 'analytics', 'block', 'app_subset', 'restrict_domain_creation', - 'login_template', 'enterprise_mode', 'mobile_ux_cookie_name', 'commcare_hq_names', 'langs', - 'title_context_block', 'timezone', 'helpers', 'has_mobile_workers', 'multimedia_state', - 'bulk_app_translation_upload', 'show_training_modules', 'forloop', 'secure_cookies', + 'alerts', 'prompt_settings_form', 'submenu', 'domain', 'metrics_domain', 'enable_update_prompts', + 'show_shadow_modules', 'sentry', 'bulk_ui_translation_upload', 'toggles_dict', 'True', 'full_name', + 'latest_build_id', 'previews_dict', 'copy_app_form', 'show_status_page', 'is_linked_app', + 'show_shadow_module_v1', 'use_bootstrap5', 'limit_to_linked_domains', 'add_ons_privileges', + 'LANGUAGE_BIDI', 'page_title_block', 'LANGUAGES', 'underscore', 'analytics', 'block', 'app_subset', + 'restrict_domain_creation', 'login_template', 'enterprise_mode', 'mobile_ux_cookie_name', + 'commcare_hq_names', 'langs', 'title_context_block', 'timezone', 'helpers', 'has_mobile_workers', + 'multimedia_state', 'bulk_app_translation_upload', 'show_training_modules', 'forloop', 'secure_cookies', 'IS_ANALYTICS_ENVIRONMENT', } expected_keys_module = { 'show_advanced', 'session_endpoints_enabled', 'show_advanced_settings', 'toggles_dict', 'show_release_mode', 'linked_name', 'linked_version', 'latest_commcare_version', - 'nav_menu_media_specifics', 'user', 'TIME_ZONE', 'domain', 'module_brief', 'timezone', 'active_tab', - 'data_registry_enabled', 'confirm', 'messages', 'releases_active', 'show_status_page', + 'nav_menu_media_specifics', 'user', 'TIME_ZONE', 'domain', 'metrics_domain', 'module_brief', 'timezone', + 'active_tab', 'data_registry_enabled', 'confirm', 'messages', 'releases_active', 'show_status_page', 'show_search_workflow', 'data_registries', 'label', 'underscore', 'forloop', 'show_shadow_modules', 'SUPPORT_EMAIL', 'valid_parents_for_child_module', 'parent_case_modules', 'current_url_name', 'LANGUAGE_BIDI', 'DEFAULT_MESSAGE_LEVELS', 'show_report_modules', 'BASE_MAIN', @@ -723,9 +723,9 @@ def test_view_form_legacy(self, mock1): expected_keys_form = { 'show_advanced', 'is_module_filter_enabled', 'session_endpoints_enabled', 'toggles_dict', 'show_release_mode', 'linked_name', 'linked_version', 'latest_commcare_version', - 'nav_menu_media_specifics', 'user', 'TIME_ZONE', 'domain', 'case_config_options', 'timezone', - 'root_requires_same_case', 'active_tab', 'confirm', 'messages', 'releases_active', 'show_status_page', - 'form_filter_patterns', 'form_workflows', 'label', 'underscore', 'forloop', + 'nav_menu_media_specifics', 'user', 'TIME_ZONE', 'domain', 'metrics_domain', 'case_config_options', + 'timezone', 'root_requires_same_case', 'active_tab', 'confirm', 'messages', 'releases_active', + 'show_status_page', 'form_filter_patterns', 'form_workflows', 'label', 'underscore', 'forloop', 'SUPPORT_EMAIL', 'current_url_name', 'LANGUAGE_BIDI', 'DEFAULT_MESSAGE_LEVELS', 'show_report_modules', 'BASE_MAIN', 'xform_languages', 'app_id', 'request', 'allow_usercase', 'MINIMUM_PASSWORD_LENGTH', 'type', 'is_saas_environment', 'show_all_projects_link', 'enterprise_mode', 'module_is_multi_select', 'csrf_token',