Mr. Feldstein and other critics, some of whom raised the issue at the recent meeting of the American Economic Association, are quick to point out that government economists who calculate a nation’s G.D.P. do an extremely difficult job well with the tools available.

They are constantly adjusting and fine-tuning for quality, trying to account not only for the better-built mousetrap, but also the new mousetrap app, its upgrades and sometimes even the version sold on the black market. (When the European Union decided to include recreational drugs and paid sex work in 2013, Britain’s G.D.P. grew by 0.7 percent.)

Economists seek to attach values to specific improvements, whether faster internet speed, less pollution or a medical treatment that leaves you healthy enough to water ski instead of stuck in a hospital bed. And they look at ad revenue that free services like Google and Facebook rack up and jobs they create.

Still, given how much of people’s time and activity has migrated online, there remains a sizable chunk of “digital dark matter” that is not counted. At the same time, measuring the increased value to consumers can be even more difficult when it comes to services and experience than it is with goods.

“It’s hard to evaluate consumer preferences,” said Richard Freeman, an economist at Harvard, and it may be even harder to figure for “things where knowledge is involved and for some kind of qualitative changes.”

The best biology textbook in the 1950s, for example, would still not have the accuracy, depth and complexity of one published in 2017. “A doctor who graduates today knows and learns many more techniques and medicines than someone who graduated years ago,” Mr. Freeman said. “And we don’t really build that in.”

Mr. Feldstein likes to illustrate his argument about G.D.P. by referring to the widespread use of statins, the cholesterol drugs that have reduced deaths from heart attacks. Between 2000 and 2007, he noted, the death rate from heart disease among those over 65 fell by one-third.