Would that it were so. And if it were indeed as you say, then it wouldn't be too hard. But I think there are a couple of assumptions that you make that are in error.
First, "virtually every person walks the same path". Unfortunately, this is not the case. Because there is not one path that is the Camino. There are multiple paths, as we all know, stretching across Europe. As you point out, these do tend to converge. But they don't all converge until you get to the Plaza de Obradoiro. Even the first and second most walked routes don't share a path into that plaza, as I can say from experience (having walked both the Portugues and the Frances).
Second, that "Everyone that passes through the beam is counted" and can be presumed to be a pilgrim. As "sun is shining" notes, not everyone on a Camino path is necessarily a pilgrim. This is especially true in the Plaza de Obradoiro (which, as has been noted above, is the only place where all of the main routes converge). You'd need a way to filter all of the non-pilgrims from pilgrims and, if in the Plaza, filter out people crossing your beam of light multiple times (I usually visit the Plaza multiple times after any Camino).
If you go your alternate route and get various donativa stops to count the pilgrims that pass, you run the risk of errors due to faulty counts when groups pass or they are distracted (perhaps talking to pilgrims who actually stop) and miss passing pilgrims. If they count the ones that stop (easier to expect them to do accurately) you run the challenge that not everyone stops at every donativo. If donativo A reports 5 pilgrims and donativo reports 7, all you know is that a minimum of 7 walked that route that day. You don't know how many stopped at both or neither.
I think if it were that easy, someone would be doing so, either from the Galician Ministry of Tourism and Economic Development (or whatever the appropriate government department) or for academic research. But unfortunately, it isn't.