After 15 years, music-discovery company Shazam Entertainment Ltd. finally is turning an operating profit—but not thanks to music.

Shazam, which counts hundreds of millions of active users and an app that is been downloaded 1 billion times, is earning most of its revenue from advertisers, who pay to use Shazam’s image-recognition and sound-recognition technology in their marketing campaigns.

That...