Tag tracking / TDD / alerting

Does anyone have good suggestions for TDD of tag development and/or tracking tags for errors?

We are logging errors, and do staging before prod, but looking to the community for suggestions on how to spot breaking changes.

Example 1: we are tagging a site generated by a wysiwig, and there are no unique ids, so we scrape for nth-child to attach doc listener. Team generates a new landing page with new content and selector no longer exists.

I would like to build some alert system for an error rate on a per tag basis.

Any input appreciated!

Primary use case right now is the JS tracker, which I see has functional tests using intern - but doesn’t capture example (maybe I’m thinking of it wrong?)

Also would like to eventually expand out to server side tracking as well.