We present a new method for detection of the integrated Sachs-Wolfe (ISW) imprints of cosmic superstructures on the cosmic microwave background, based on a matched filtering approach. The expected signal-to-noise ratio for this method is comparable to that obtained from the full cross-correlation, and unlike other stacked filtering techniques it is not subject to an a posteriori bias. We apply this method to Planck CMB data using voids and superclusters identified in the CMASS galaxy data from the Sloan Digital Sky Survey Data Release 12, and measure the ISW amplitude to be $A_mathrm{ISW}=1.64pm0.53$ relative to the $Lambda$CDM expectation, corresponding to a $3.1sigma$ detection. In contrast to some previous measurements of the ISW effect of superstructures, our result is in agreement with the $Lambda$CDM model.