Tag demulsifier dosage optimization