Radio programs.
One example would be Lux Radio Theater, sponsored by Lux, a brand of soap. The Jack Benny Show featured ads from its sponsor, Jell-O. Advertising agencies worked to target sponsorship and ads at the target audience of the programs.
Television, by the way, was just beginning in the late 1920s and didn't really become a dominant media until after World War II.