In beam counting, a sensor sends an infra-red beam to a reflector on the the opposite side of the doorway. As someone passes through the doorway, the beam breaks and a person is counted.
Accuracy tends to decrease with wide or busy entrances. If two people cross a beam together, for instance, only one count will be recorded. Direct sunlight onto the beam will also affect the system.
Beam counters were in demand some years ago - now higher accuracy and more comprehensive information is generally demanded.