Once mere merchants, ecommerce operators are turning their virtual shelf space into ad space and their customer data into targeting attributes.