A novel synthesis of a sol-gel precursor for WO3 thin films is presented. Through addition of oxalic acid dihydrate to the precursor solution, films with different microstructures may be obtained; and these microstructures are characterized using TEM, FESEM, and SAXS. Without the additive, the films are relatively homogeneous and amorphous; with the additive, the films are multiphase, containing amorphous and crystalline regions. In addition, the latter films contain numerous small regions of apparently much higher electron density, which likely correspond to a dispersed W-rich phase. Optoelectrochemical analysis of the films under galvanostatic conditions demonstrates that the homogeneous, amorphous films display a pronounced cycling effect in both the response of the electrode potential and the optical efficiency. In contrast, the multiphase films show no significant cycling effect.