Commits

Branko Vukelic committed 59b8d7f

Added GA_TRACK_SUPERUSER setting

  • Participants
  • Parent commits 5360c21

Comments (0)

Files changed (2)

File ga_tracking/context_processors.py

 from . import settings
 
 def ga_tracking_id(request):
+    is_super = request.user.is_authenticated() and request.user.is_superuser
     return dict(
         GA_TRACKING_ID=settings.GA_TRACKING_ID,
         GA_DOMAIN=settings.GA_DOMAIN,
+        GA_USER_TRACKABLE=settings.GA_TRACK_SUPERUSER and is_super
     )

File ga_tracking/settings.py

 
 GA_TRACKING_ID = getattr(settings, 'GA_TRACKING_ID')
 GA_DOMAIN = getattr(settings, 'GA_DOMAIN')
+GA_TRACK_SUPERUSER = getattr(settings, 'GA_TRACK_SUPERUSER', True)