This starts with knowing the carbonation level of the bought beer.
Knowing that, and knowing the temperature of the beer inside the kegerator, you use
our friendly carbonation table to set your gas pressure to keep the beer at the original carbonation level.
For instance, if your bought beer was carbed to 2.8 volumes of CO2, and your kegerator is holding it at 40°F, you'd locate the temperature on the Y-axis, scan across the corresponding row to the closest value to 2.8, then go up that column to find the proper CO2 pressure.
And knowing the proper CO2 pressure, you then go to
the only beer line length calculator worth using to find the proper length of beer line to handle that pressure.
After all that, if your beer line ID and length are within spec, and you have the CO2 pressure set properly, the remaining factor to manage is temperature differential between the bottom of your keg (where the dip tube draws the beer) and the top of your plumbing) mainly, the beer lines and faucets).
The carbonation table illustrates the two factors that determine how much CO2 can be dissolved in beer, and that higher temperatures require higher pressure to achieve the same carbonation level. So if you keep the pressure constant but raise the temperature, CO2 will come out of solution and form bubbles.
A small PC fan, 80mm or larger, running constantly will help prevent temperature stratification inside a kegerator or keezer that can contribute to that "first pour" problem. And if you're in a warm environment you might also want to add a tower cooler to blow cold air up into the tower...
Cheers!