Working on a website, I use Google Tag Manager and push some info with the dataLayer in Javascript. So far so good. However there are some information that should not be see
In 2020 Google has released Google Tag Manager for server-side tracking, where you run a container in a cloud environment that then distributes the requests.
https://developers.google.com/tag-manager/serverside
Facebook and Google Analytics Support this now. So you can move tracking to server side.