Madagascar is a lovely destination for shopping. The arts and crafts are varied, unusual and often of high quality, making for wonderful souvenirs and gifts. If possible, try to buy directly from the producer, or from a local association, to ensure your money goes where it's most needed.
The purchase of some souvenirs, however, should be weighed carefully. Many gemstones and gold, for instance, are illegally mined, in dreadful health and safety conditions, often by children, and with no environmental safeguards, so try to buy from a well-established business that can guarantee the provenance of the minerals and obtain an export certificate.
The same note of caution goes for souvenirs made of precious hardwoods such as palisander, rosewood and ebony. All three species are seriously threatened by large-scale deforestation and illegal logging and are listed by CITES (the Convention on International Trade in Endangered Species of Wild Fauna and Flora). It's not the few sculptures and carvings in souvenir shops that are driving deforestation (and these activities do support livelihoods), but they are part of the big picture. Whatever you choose to do, you will need an export certificate.