diff --git a/app/app/settings.py b/app/app/settings.py index 63107917..a5027bd3 100644 --- a/app/app/settings.py +++ b/app/app/settings.py @@ -274,6 +274,7 @@ GOOGLE_TRACKING_ID = env('GOOGLE_TRACKING_ID', 'UA-125643874-2') AZURE_APPINSIGHTS_IKEY = env('AZURE_APPINSIGHTS_IKEY', None) APPLICATION_INSIGHTS = { 'ikey': AZURE_APPINSIGHTS_IKEY if AZURE_APPINSIGHTS_IKEY else None, + 'endpoint': env('AZURE_APPINSIGHTS_ENDPOINT', None), } ## necessary for email verification setup diff --git a/app/server/templates/tags/azure_appinsights.html b/app/server/templates/tags/azure_appinsights.html index 951e906b..d3152f57 100644 --- a/app/server/templates/tags/azure_appinsights.html +++ b/app/server/templates/tags/azure_appinsights.html @@ -7,6 +7,9 @@ var appInsights=window.appInsights||function(a){ {% if DEBUG %} enableDebug: true, {% endif %} + {% if azure_appinsights_endpoint %} + endpointUrl: "{{ azure_appinsights_endpoint }}", + {% endif %} instrumentationKey: "{{ azure_appinsights_ikey }}" }); window.appInsights=appInsights,appInsights.queue&&0===appInsights.queue.length&&appInsights.trackPageView(); diff --git a/app/server/templatetags/analytics.py b/app/server/templatetags/analytics.py index c1fa1a50..2e6be2bf 100644 --- a/app/server/templatetags/analytics.py +++ b/app/server/templatetags/analytics.py @@ -15,4 +15,5 @@ def azure_appinsights(): return { 'DEBUG': settings.DEBUG, 'azure_appinsights_ikey': settings.APPLICATION_INSIGHTS['ikey'], + 'azure_appinsights_endpoint': settings.APPLICATION_INSIGHTS['endpoint'], }