From bf304f9493e769419da5d34b936417abb89d9470 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Thu, 24 Aug 2017 16:10:53 +0200 Subject: [PATCH] Fixed obtaining ga code from dict --- utils/context_processor.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/context_processor.py b/utils/context_processor.py index 37544962..a271ace8 100644 --- a/utils/context_processor.py +++ b/utils/context_processor.py @@ -13,7 +13,8 @@ def google_analytics(request): # Try checking if we have a www in host, if yes we remove # that and check in the dict again if host.startswith('www.'): - ga_prop_id = host[4:] + ga_prop_id = getattr(settings, 'GOOGLE_ANALYTICS_PROPERTY_IDS', + False).get(host[4:]) if not settings.DEBUG and ga_prop_id: return { 'GOOGLE_ANALYTICS_PROPERTY_ID': ga_prop_id