def ip
      ip = request.remote_ip
      if ip && Ahoy.mask_ips
        Ahoy.mask_ip(ip)
      else
        ip
      end
    end
def ip
      ip = request.remote_ip
      if ip && Ahoy.mask_ips
        Ahoy.mask_ip(ip)
      else
        ip
      end
    end
masking based on Google Analytics anonymization
 https://support.google.com/analytics/answer/2763052