That actually goes back a long way. Remember how E.T. was lured by Reeses Pieces because the producers couldn't get M&Ms to pay for the product placement. That one did wonders for Reeses market share. Up to then, they had been insignificant.
The space station scene in 2001 with the AT&T, Pan-Am, etc. Blatent.
Or Fred and Barney sneaking out back during the Flintstones to catch a Winston Cigarette.
Other than the Fred and Barney example, all of those examples, while blatent, were plausible given the time. i.e., AT&T still existed (although with a crappy network ) in 2001. But Nokia in the 23rd century? Over the top and not necessary. Plus it did something that they had NEVER done before in Star Trek. Very distasteful.
But all great examples. And I am glad Spielberg could not get M&Ms. Nothing in the world like Reeses pieces on a sundae.