Tag demulsifier dose optimization