diff --git a/community/context_processors.py b/community/context_processors.py index 3081a4b5..217ec561 100644 --- a/community/context_processors.py +++ b/community/context_processors.py @@ -1,4 +1,7 @@ def pyar_wiki_url(request): from django.conf import settings # return the value you want as a dictionnary. you may add multiple values in there. - return {'PYAR_WIKI_URL': settings.PYAR_WIKI_URL} + return { + 'PYAR_WIKI_URL': settings.PYAR_WIKI_URL, + 'GOOGLE_TRACKING_ID': settings.GOOGLE_TRACKING_ID, + } diff --git a/community/templates/base.html b/community/templates/base.html index 2570a5aa..a23c7b66 100644 --- a/community/templates/base.html +++ b/community/templates/base.html @@ -28,8 +28,18 @@ {% block extra_head %}{% endblock %} + + {% if GOOGLE_TRACKING_ID %} + + + + {% endif %} diff --git a/pyarweb/settings/base.py b/pyarweb/settings/base.py index 2f0b84bf..29e605f1 100644 --- a/pyarweb/settings/base.py +++ b/pyarweb/settings/base.py @@ -224,3 +224,5 @@ 'font-size', ] TAGGIT_CASE_INSENSITIVE = True + +GOOGLE_TRACKING_ID = os.environ.get('GOOGLE_TRACKING_ID', '')