diff --git a/app/helpers/common_helper.rb b/app/helpers/common_helper.rb index 3176ef629bf..78b5c8716e5 100644 --- a/app/helpers/common_helper.rb +++ b/app/helpers/common_helper.rb @@ -14,4 +14,10 @@ module CommonHelper def render_google_tag_manager_body_code render partial: "common/google_tag_manager_body" if SiteSetting.gtm_container_id.present? end + + def render_adobe_analytics_tags_code + if SiteSetting.adobe_analytics_tags_url.present? + content_tag(:script, "", src: SiteSetting.adobe_analytics_tags_url, async: true) + end + end end diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 29465b6de57..0412f3e85b0 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -59,6 +59,8 @@ <%= render_google_tag_manager_head_code %> <%= render_google_universal_analytics_code %> + <%= render_adobe_analytics_tags_code %> + crossorigin="use-credentials"> <%- if include_ios_native_app_banner? %> diff --git a/app/views/layouts/publish.html.erb b/app/views/layouts/publish.html.erb index c934229dc1e..64fd148b763 100644 --- a/app/views/layouts/publish.html.erb +++ b/app/views/layouts/publish.html.erb @@ -7,6 +7,7 @@ <%= render partial: "common/discourse_publish_stylesheet" %> <%= render_google_tag_manager_head_code %> <%= render_google_universal_analytics_code %> + <%= render_adobe_analytics_tags_code %> <%= preload_script 'publish' %> <%= preload_script 'pageview' %> diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index cd042d530a5..8ad436802cf 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -2741,6 +2741,7 @@ en: page_loading_indicator: "Configure the loading indicator which appears during page navigations within Discourse. 'Spinner' is a full page indicator. 'Slider' shows a narrow bar at the top of the screen." show_user_menu_avatars: "Show user avatars in the user menu" about_page_hidden_groups: "Do not show members of specific groups on the /about page." + adobe_analytics_tags_url: "Adobe Analytics tags URL (`https://assets.adobedtm.com/...`)" view_raw_email_allowed_groups: "Groups which can view the raw email content of a post if it was created by an incoming email. This includes email headers and other technical information." errors: invalid_css_color: "Invalid color. Enter a color name or hex value." diff --git a/config/site_settings.yml b/config/site_settings.yml index 40b377239ff..ce57933fabf 100644 --- a/config/site_settings.yml +++ b/config/site_settings.yml @@ -423,6 +423,9 @@ basic: about_page_hidden_groups: default: "" type: group_list + adobe_analytics_tags_url: + default: "" + regex: "assets.adobedtm.com" extended_site_description: default: "" max: 10_000 @@ -446,6 +449,7 @@ basic: default: false hidden: true client: true + login: invite_only: refresh: true