def get_ga_query_dict(self):
        """
        Adds user agent and IP to the default hit parameters
        """
        query_dict = super(GARequestErrorReportingMixin, self).get_ga_query_dict()
        request = self.get_ga_request()
        if not request:
            return query_dict
        user_ip = request.META.get('HTTP_X_FORWARDED_FOR', request.META.get('REMOTE_ADDR', ''))
        user_ip = user_ip.split(',')[0].strip()
        user_agent = request.META.get('HTTP_USER_AGENT')
        user_language = request.META.get('HTTP_ACCEPT_LANGUAGE')
        if user_ip:
            query_dict['uip'] = user_ip
        if user_agent:
            query_dict['ua'] = user_agent
        if user_language:
            query_dict['ul'] = user_language
        return query_dict
def get_ga_query_dict ( self ) : query_dict = super ( GARequestErrorReportingMixin , self ) . get_ga_query_dict ( ) request = self . get_ga_request ( ) if not request : return query_dict user_ip = request . META . get ( 'HTTP_X_FORWARDED_FOR' , request . META . get ( 'REMOTE_ADDR' , '' ) ) user_ip = user_ip . split ( ',' ) [ 0 ] . strip ( ) user_agent = request . META . get ( 'HTTP_USER_AGENT' ) user_language = request . META . get ( 'HTTP_ACCEPT_LANGUAGE' ) if user_ip : query_dict [ 'uip' ] = user_ip if user_agent : query_dict [ 'ua' ] = user_agent if user_language : query_dict [ 'ul' ] = user_language return query_dict
Adds user agent and IP to the default hit parameters