You could ship a sample out to get a liquid chromatography mass spectrometry analysis done.
Usually only a few aromatics will make up the bulk of the flavor and they’re well known molecules, especially if they’re synthetic.
Most soda is sugar water with a few well known synthetic flavors added so it’s easy to identify. Secret recipes like Coca Cola are far more complex to make without easy synthetic alternatives. Any recipe that caramelizes sugar, for example, is hard to reverse engineer.