Seems like you have everything set up correctly. You have what is called a beer chilled system. Somewhere at the shank and faucet area this hardware is picking up heat and your beer is chilling it as it passes through. The initial pour is foam from the beer degassing and then the cold beer from the keg is cooling it and the beer then pours fine. You need to find out if there is a heat source somewhere, even check outside by the faucet, and eliminate. Otherwise, when you pour out the foam in the glass, stop immediately and dump out. Start again with the clear beer. It is impossible to pour clear beer on top of foam in the glass. Also, check for pressure leaks.
Scott Zuhse, Instructor
Micro Matic Dispense Institute