Ammonia is analyzed by chemical titration. The method used in most test kits is called the salicylate method. Always measure pH and temperature when you measure ammonia. Without these other measurements it will be difficult to know the toxicity of the ammonia.
Typically, ammonia is detected by the Berthelot method (or indophenol method), a water-based colorimetric analysis. This method is well-established, widely used, and allows for low ammonia detection limit, but it is heavily dependent on experimental conditions such as pH and the presence of other species in solution.
You can test for ammonium ions either in a solid or in solution by adding sodium hydroxide solution and warming gently.
Prem is correct about the salicylate colorimetric method but there are also highly selective electrodes based on pH change across a gas permeable membrane
Prem and Paul are correct. You can measure or detect ammonia in different places using different devices or methods. You can tell if it is in dissolution or reaction using titration as Prem and Paul said. If you want to detect in the air, you can go where there is a lot of ammonia and use this device as a "Colorimetric tube" to detect or measure. Ammonia (NH3) is lighter than air (composed of approximately 80% nitrogen, N2). Hence, if you want to know NH3 using Colorimetric tubes, you can go where there are a lot of birds or chicks and detect it. See further this paper (https://extension.psu.edu/detecting-ammonia-in-poultry-housing-using-inexpensive-instruments).@barudebtera