Select 2 get the data id from option and return the url

Hi May I ask

How can I pass the existing data ID on the option element since I have existing dropdown with different data-id which is redirecting to specific url per location . but when the location is select by select2 the data-id is not being carry and it will not redirect to the right url location with this data-id