If you imagine, say, a hotel, it has plumbing that makes the toilets flush, and an accounting department that pays the bills and stuff, but none of those are an important driver of how people choose their hotels. Upgrading the plumbing will not lead to more guests, but if the plumbing breaks, that can lead to a negative experience and needs to be fixed quickly by a competent plumber.
It's the same with software - you need to figure out what the actual end goal is (more sales? attract a new client? more reliability?), and then the productivity of the developers measures how their software changes contribute to that outcome.
This would be like trying to build a skyscraper but having to keep up on a dozen changes to the raw materials every year. Each time something materially changes you rebuild the entire thing with that change.
All you can reasonably measure is how well the process is going, which is why you have efforts like DORA and SPACE. They effectively try to measure the state of flow that developers need to be most productive.