The secret subpoena is known as a national security letter and, as The Intercept notes it does not require court approval. Instead, investigators only needed to prove that the information they're trying to get out of Google was "relevant to an authorized investigation to protect against international terrorism or clandestine intelligence activities." The fact that the letter is only now coming to light is a result of the USA Freedom Act, which modified the Patriot Act to make sure that such letters are periodically reviewed to ensure they are still required. Still, Google has not yet disclosed the contents of the letter itself, which implies that the gag may still be partially in place or Google may be challenging it in a closed court.
Earlier this month, the ACLU and Open Whisper Systems, the company behind end-to-end encrypted messaging app Signal, revealed that OWS had also received a national security letter along with a request for information about two Signal users. In that case, the ACLU and OWS successfully argued that the Justice Department overstepped with their broad gag order and were allowed to go public with their story. Even though these two letters have now been (somewhat) publicized, because of their nature, ACLU staff attorney Brett Max Kaufman wrote during the Signal case that, "there are many more like it, hiding in the filing cabinets in the U.S. attorney's offices across the country."