Fingerprinting. That's what I do for Pirsch (https://pirsch.io/) and I think they do it in a similar manner. You can check out our source code here: https://github.com/pirsch-analytics/pirsch/blob/master/finge... or take a look at the Plausible repo.