The 25-year-old arrives on a season-long loan from Juventus.
The Hammers will pay £5m up front, which will become a permanent £17m deal after he plays a certain number of games.
The news was revealed by Jack Sullivan, the son of chairman David Sullivan, on Twitter.
Sullivan tweeted: “5m loan fee, if he plays a small number of games it becomes a permanent 5 year deal and we pay another 20m euro plus additional add ons
“ZAZA signed, full details on WHU website tomorrow. One of the toughest deals ever to get across the line. #COYI.”