def track_request_googleanalytics(request):  # type: ignore[no-untyped-def]
    """
    Utility function to track a request to the API with the specified URI

    :param request: (HttpRequest) the request being made
    """
    pageview_data = DEFAULT_DATA + "t=pageview&dp=" + quote(request.path, safe="")
    # send pageview request
    requests.post(GOOGLE_ANALYTICS_COLLECT_URL, data=pageview_data)

    resource = get_resource_from_uri(request.path)

    if resource and resource.is_tracked:
        environment = Environment.get_from_cache(
            request.headers.get("X-Environment-Key")
        )
        if environment is None:
            return

        track_event(environment.project.organisation.get_unique_slug(), resource)  # type: ignore[no-untyped-call]

    Utility function to track a request to the API with the specified URI

    :param request: (HttpRequest) the request being made
    
api/app_analytics/track.py