  In this study, we present the measurement of the intrinsic hadronic
contamination at the CERN SPS H4 beamline configured to transport electrons and
positrons at 100 GeV/c momentum. The analysis was performed using data
collected by the NA64-$e$ experiment in 2022. Our study is based on
calorimetric measurements, exploiting the different interaction mechanisms of
electrons and hadrons in the NA64-ECAL and NA64-HCAL detectors. We determined
the intrinsic hadronic contamination by comparing the results obtained using
the nominal electron/positron beamline configuration with those obtained in a
dedicated setup, in which only hadrons impinged on the detector. The
significant differences in the experimental signatures of electrons and hadrons
motivated our approach, resulting in a small and well-controlled systematic
uncertainty for the measurement. Our study allowed us to precisely determine
the intrinsic hadronic contamination, which represents a crucial parameter for
the NA64 experiment in which the hadron contaminants may result in non-trivial
backgrounds. Moreover, we performed dedicated Monte Carlo simulations for the
hadron production induced by the primary T2 target. We found a good agreement
between measurements and simulation results, confirming the validity of the
applied methodology and our evaluation of the intrinsic hadronic contamination.
