We prove a formula for the cycle class of the supersingular locus in the Chow ring with rational coefficients of the moduli space of principally polarized abelian varieties in characteristic $p$. This formula determines this class as a monomial in the Chern classes of the Hodge bundle up to a factor that is a polynomial in $p$. This factor is known for $g\leq 3$. We determine the factor for $g=4$.