The City has a nice explanation of what you need to consider if you’re looking at putting in a fence: https://www.cityofmadison.com/development-services-center/1-2-family-residential/repairs-replacements/fence-or-hedge
If you are in the Sandstone Ridge subdivisions, there are additional approvals required, due to the neighborhood covenants. You can see those requirements here: https://www.cityofmadison.com/development-services-center/documents/Sandstone%20PD%20-%20Fences%20Handout.pdf