The measure, which comes into force in September, complies with new European Union rules meant to ensure that all member states use the same methodology to estimate the size of their economy.
Standardising how the figures are calculated matters because gross domestic product (GDP) data are used to assess a member state’s contribution to the EU budget.
Britain and Italy caused a stir last month when they announced they would start including revenues from drug trafficking and prostitution in their GDP calculations.
Britain’s statistics office estimated the inclusion of such illegal activities in national accounts would add about 10 billion pounds (12.3 billion euros, $16.7 billion) to economic output.
The changes are expected to boost growth figures from the Europe as many of its members struggle to emerge from years of grinding recession.
Some experts estimate Europe’s “shadow economy” could be worth almost a fifth of its economic output this year.
But the decision to include the figures in national accounts has also sparked outrage among politicians and rights groups.
The French minister for women’s rights, Najat Vallaud-Belkacem, and Belgium’s Interior Minister Joelle Milquet, have both written to the European Commission to express their “astonishment” over the proposals.
Spain’s statistics office admitted the “inherent difficulty” of estimating illegal revenues, but said the change would make its figures “comparable with those of all the advanced economies of the world”.
Spain’s proximity to north Africa, a major source of hashish, and its close ties with its former colonies in Latin America, a key cocaine producing region, have made it a major gateway into Europe for drug traffickers.
Spain’s economy, the eurozone’s fourth-largest, grew at a quarterly pace of 0.4 percent in the first three months of 2014, its fastest pace since a 2008 property crash that wiped out millions of jobs.