Arduino controlled Amplifier - I need ideas!

Mechanical pot shown in the first link has 3 leads, 1-st to input, 2-nd ground and 3-rd (wiper) to PA IC. The only difference when you replacing it with digital one, you ' d need DC offset about 2.5 V.
I'd connect PxA to input, PxW (wiper) to PA IC - similar to mechanical , only PxB instead of ground to +3.3V on board arduino (UNO or any other 5V version).
Audio Gain Control Using Digital Potentiometers | Analog Devices Figure 5 or 9.