El Ni\~no exhibits distinct Eastern Pacific (EP) and Central Pacific (CP) types which are commonly, but not always consistently, distinguished from each other by different signatures in equatorial climate variability. Here, we propose an index based on evolving climate networks to objectively discriminate between both flavors by utilizing a scalar-valued evolving climate network measure that quantifies spatial localization and dispersion in El Ni\~no's associated teleconnections. Our index displays a sharp peak (high localization) during EP events, whereas during CP events (larger dispersion) it remains close to the baseline observed during normal periods. In contrast to previous classification schemes, our approach specifically account for El Ni\~no's global impacts. We confirm recent El Ni\~no classifications for the years 1951 to 2014 and assign types to those cases were former works yielded ambiguous results. Ultimately, we study La Ni\~na episodes and demonstrate that our index provides a similar discrimination into two types.