However, foam can also indicate other problems.
Foam may indicate the presence of phosphates in your spa water. If you have a significant level of phosphates (above 200 ppb, note this is billion, not million) you might also be noticing difficulty maintaining a proper sanitizer level. Phosphate removers are readily available, though you will find they are packaged for pools.
Foaming may also be the result of detergents and/or soaps in your water. The best way to prevent his is to wear the same clothes while using your spa and simply hanging them to dry (don’t wash them). Drain & refill your spa if this is the problem.
If you have been using suntan lotions before using your spa, these may be the source of foaming. Again, you will have to drain & refill your spa. Best practice here is to shower before using your spa.