def METHOD_NAME(data_dir: Path, should_submit: bool) -> None:
    if not is_production():
        return None  # only submit analytics for production
    if should_submit is False:
        return None
    analytics = create_usage_analytics(data_dir)
    try:
        response = requests.put(
            url='https://rotki.com/api/1/usage_analytics',
            json=analytics,
            timeout=CachedSettings().get_timeout_tuple(),
        )
    except requests.exceptions.RequestException:
        return None
    if response.status_code == HTTPStatus.NO_CONTENT:
        # Succesfully submitted
        log.info('Submitted usage analytics')
    return None