Start with good socialization by introducing the pup to many new and varied locations - but not the gun range. Take the pup with you where ever you can so it acclimated to many different places as well as travel in the car. This is why I like getting a pup in April or early May as the weather is still pretty cool and there is little stress on the pup tooling around town. One can do the noise thing when feeding and such but the pup gets enough noise stimulus traveling around that I don't think it necessary.

Around 14 weeks when the pup has "come" down well and it has some confidence to range a bit from me I'll start introducing gunfire. I use a crimped cap such as used in starter pistols. I put the gun behind by back and fire a round when the pup is headed away a good 15 yards from me.I keep walking as if nothing happened with no interaction with the pup, especially if the pup reacts in any way. One round per session is all until the pup ignores the sound as much as I do.
When this occurs, I'll fire off caps a couple times per outing and do the same. If no reaction from the pup, two shots instead of one is fired. When there is no reaction from the pup and the pup ranges further out, I'll move up to 22 blanks then shotshells.

I don't take the pup to the range as the possibility of too much stimuli is there. If the pup reacts negatively to any degree, "reassuring" the pup is teaching it to react in a negative manner to the noise as is removing the pup from the scene. I want the dog to not react to loud noises at this stage, then I can teach it to react as I want it to at a later point. I like going in individual steps as one is only introducing a single component which is easier to control.