How can you tell the game number on a scratch off you are about to purchase?

Unfortunately, you probably can’t.
If you’re buying from a retailer over the counter, just ask them.  They’ll look and tell you the game number.  Make sure they’re not telling you the ticket number on the front of the card.  Ask for the game number on the back of the card.
If you’re buying from a machine, it’s basically impossible.  You’ll need to buy one ticket and look on the back of that ticket to see the number.  It’s usually the very first or very last digits of the really long number at the top or bottom of the back of the card.
If there is more that ONE game number with the same Game Name (marked with an Asterisks (*) on our report, our experience has been that we’ve only ever found the lower ranked game in a machine.