Type "ping" in network tab
Asked Answered
L

1

5

When consulting network tabs I saw some Google analytics calls: enter image description here

Some have the type "ping". I know the ping attribute but it's when a link is clicked and the payload is "PING".

Here I didn't click on anything and the payload is not "PING" (it contains some info for analytics).

The response content/type is "plain/text".

The question What is text/ping and is this a new standard? Is it browser dependent? looks like the same but in that case it has the "PING" payload.

Lanugo answered 7/3, 2023 at 19:31 Comment(0)
H
11

The requests whose type show up as ping in Chrome network tab are those that are sent using navigator.sendBeacon().

It's intended to be used for sending analytics data to a web server, and avoids some of the problems with legacy techniques for sending analytics, such as the use of XMLHttpRequest.

Haymes answered 9/3, 2023 at 13:29 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.