ammonia based algaecides also are notorious for foaming.

Once you have an algae bloom, you have to fight it with chlorine. You have to keep the free chlorine at shock level constantly, but shock level is dependent on how much stabilizer you have.

You now also have to fight the foaming, which the chlorine will do.

You'll need to post your numbers:
FC,
CC
pH
Tot Alk
Stabilizer (CYA)
and
Calcium.