def tracking_code(context): context.push() context["visitor_id"] = _get_visitor_id(context["request"]) try: return "".join([b.get_tracking_code(context) for b in get_backends()]) finally: context.pop()
def tracking_code(context): context.push() context['visitor_id'] = _get_visitor_id(context['request']) try: return ''.join([b.get_tracking_code(context) for b in get_backends()]) finally: context.pop()
def process_request(self, request): visitor_id = _get_visitor_id(request) request_log = { 'headers': self._get_headers(request), 'path': request.path, 'method': request.method, 'get': dict(request.GET) } register_request_event(request, 'request', request_log)
def process_request(self, request): visitor_id = _get_visitor_id(request) request_log = {'headers' : self._get_headers(request), 'path' : request.path, 'method' : request.method, 'get' : dict(request.GET)} register_request_event(request, 'request', request_log)
def process_request(self, request): visitor_id = _get_visitor_id(request) if request.user.is_authenticated(): try: rv = request.user.relvisitor if rv.visitor_id != visitor_id: deduplicate.delay(visitor_id, rv.visitor_id) request.session['visitor_id'] = rv.visitor_id except RelVisitor.DoesNotExist: RelVisitor.objects.create(user=request.user, visitor_id=visitor_id) set_user.delay(visitor_id, request.user.id)