Number validation for New Zealand


#1

Hello.

To make our campaign successful I need to ensure that I measure Conversions that have valid numbers.

How can I add validation to ensure that the phone numbers are real that are entered. I see validation for the a couple of countries but not New Zealand.


#2

Hi @Daniel_Melbye,

Valid numbers and real numbers are not necessarily the same thing.

You can have a valid number which is not a real number.

In order to validate numbers according to pre-determined rules, you’ll need a bit of JavaScript with some RegEx. This would get you a valid number. Example: All New Zealand numbers need to start with “64”.

This community post should point you in the right direction for custom validation with RegEx.

If you want to further make sure the number is real, you’ll need a 3rd party that can actually make the check for you and return a response.
There are a few 3rd party services that do this kind of check for the US and UK. There are probably some that do it for New Zealand as well.

Best,
Hristian


#3

Yes - I should have made that clear.

I want to add rules to make sure they are a valid format and so reduce fake numbers.

I dont know javascript so anyone who already has the code for validating to new zealand phone formats would be great.