There are some nice examples in that post. One other example would be to respect the DoNotTrack setting of your browser. You don't need to load any tracking scripts if DNT is enabled. That saves bandwidth and has a small effect on your page's loading times.
We recently blogged about that on the example of Matomo (Google Analytics alternative). The main part is the following code:
if (navigator.doNotTrack !== '1') { /* load script */ }
Here is the link if you are interested in the details: https://frontaid.io/blog/matomo-dnt-do-not-track/