CoAPO-34 co-crystallizes easily with CoAPO-5. Factors directing the structure of the final product are the cobalt and template content of the gel, the mixing temperature of the gel and the synthesis temperature. Gel compositions for CoAPO-5 are expressed as r triethylamine-CoxAl1-xP1-w H2O with r=0.6-0.75, w=20-100, x=0.01-0.08. Mixing the reagents at 273 K and high synthesis temperature (473 K) are favorable. Gel compositions leading to CoAPO-34 are r>1.2, w=80, x greater than or equal to 0.08. Low synthesis temperatures are favorable. To understand these observations at the level of gel chemistry, wet and dried precursor gels were characterized by diffuse reflectance spectroscopy (DRS). At the gel stage, triethylamine has in the first place a pH-regulating effect. It influences the nature of the surface of pseudoboehmite and the complexing behavior of cobalt. The crystallization of CoAPO-5 and CoAPO-34 involves completely different precursor species. The former proceeds over an octahedral and hydrated intermediate which requires high temperatures for stabilization and transformation to tetrahedral cobalt. CoAPO-34 proceeds over a tetrahedrally coordinated cobalt precursor, already formed at the gel stage.