Documentation / Third party
Categorise third parties #
There are two ways two categorise first/third parties. If you use
--firstParty all requests will be categorised as either first/third party and you can see % of them. This is the old implementation and we also have a newer one where we use the Third party web project to categorise requests so you as user know what kind of tools the web page is using.
One thing to remember is that a tool can have multiple categories. For example, it can be both a analytics tool AND a surveillance tool.
By default the third party information will be sent to Graphite/InfluxDb and if you are a Graphite user you can upgrade the page summary dashboard to the latest version. You will then get two new graphs.
The first graph shows you third party requests by category. Here can you see how many requests each category generates.
The next graph shows how many tools the page use by category. This graph will will help you see when your content team adds a new analytics tool to the site (but they promised they wouldn’t!). What’s really cool is that you can add alerts to these metrics too, as to all metrics from sitespeed.io.
If you look at the HTML result pages, you can also see the same information per URL.
And then also see the exact tools that are used.
At the moment we are very liberate on categorising tools as surveillance and need your help to get it right. Do a PR to help us help by changing https://github.com/sitespeedio/sitespeed.io/blob/main/lib/plugins/thirdparty/index.js#L34-L38.
The new categorisation happens automatically.
Requests per page #
There’s a lot of discussion blaming 3rd parties for performance and it’s now easier for you track them. However you need to remember that third parties is also used to share private data of what your user is doing to other companies. Remember that privacy is important for your users. That’s why made it easy to see how many third party request each page do:
It's easy to see the amount of third party requests.
CPU spent per tool/third party #
You can also track CPU spent per tool/third party. It’s turned off by default and enable it with
--thirdParty.cpu when you use Chrome. Then you can have a graph like this:
Block all 3rd parties #
We have two ways to block requests when you use sitespeed.io. Either you can use block
--block that blocks a specific request and request patterns (works in Chrome/Edge) or domain (works in Chrome/Edge/Firefox) or you can use
--chrome.blockDomainsExcept (Chrome/Edge) to block all domains except the ones you choose (you can use wildcard like *.sitespeed.io). You can use both multiple times to keep multiple domains/block multiple requests.
docker run --rm -v "$(pwd):/sitespeed.io" sitespeedio/sitespeed.io:27.8.0 --block "https://en.wikipedia.org/w/load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector" https://en.wikipedia.org/wiki/Barack_Obama
Block all requests that ends with .js:
docker run --rm -v "$(pwd):/sitespeed.io" sitespeedio/sitespeed.io:27.8.0 https://www.sitespeed.io -n 1 -o --browsertime.block "*.js"
Here’s an example from a user that use WebPageReplay and want to block all domains except one:
docker run --cap-add=NET_ADMIN --rm -v "$(pwd):/sitespeed.io" -e REPLAY=true -e LATENCY=100 sitespeedio/sitespeed.io:27.8.0 --firstParty ".*(move.com|realtor.com|moveaws.com|rdcpix.com).*" --browsertime.chrome.blockDomainsExcept "*.realtor.com" https://www.realtor.com/