Show the right phone number to each website visitor
Add a free script to your website that automatically shows the right local phone number for each website visitor.
Do you have multiple phone numbers in different countries that customers can reach you at?
Use a free script to automatically show the right local phone number to each visitor. The script automatically shows the number that is in the same country as your website visitor.
The script can be pasted anywhere on any web page where you want a phone number to appear. The phone number will be shown in the local number format that the visitor is used to.
The script works out-of-the-box and is configurable.
How can I add this to my website?
Here are the steps you need to follow.
- Copy the code
Sign-in to your account and go to Website > Tools to copy the code
- Optionally, change the numbers to be displayed
You can change the default number or add any other numbers you own outside Sonetel.
- Add to your website
Paste this code on each page of your website at the exact location where the number should be displayed.
What exactly does the script do?
The script will do the following, each time someone visits any page at your website where the script is added.
- Identifies the country of your visitor
The script will take the IP address of your website visitor and do a search in a global IP-address database, to find the country of your visitor.
- Finds the best phone number
The script will then fetch all your Sonetel phone numbers, and exclude those that you don’t want to show. It will then add any other non-Sonetel phone numbers that you want added to the mix. It will thereafter check if you have any phone number in the country of the visitor. If you have many, it will give priority to Sonetel numbers and pick the oldest number. If no numbers match the country of the visitor, it will instead pick your default phone number.
- Formats the number
The number will be formatted in accordance with the local standards for showing phone numbers. A US number 134712345678 will be shown as (347) 123-45678 to US visitors.
- Shows the number at your web page
The formatted phone number will be returned to your web page, and will be displayed at the location of the script in your web page. The number will be shown in whatever color and style that you have defined for your website.
Which phone numbers do the script use?
The phone number to be displayed is selected in the following order.
- Sonetel numbers
If you have a Sonetel phone number in the country of the visitor, we will show that number. If you have multiple matching numbers, we will pick the oldest.
- Other numbers you provide
If there are no matching Sonetel numbers, we will check if you have provided any other numbers (see below) that match the country of the visitor.
- The Default number
If no number is available from the country of the visitor, we will show the Default number, which is added automatically to the script but that can be changed by you.
How to add other numbers
If you have other numbers that are not from Sonetel, you can include them into the mix by using the add-numbers function in the script.
You can add multiple numbers separated by a space. Numbers should include the country code and be added without “+”.
add-numbers="4420555666 46852525260 91823456789"
How to prevent numbers from being shown
If you have Sonetel numbers that you do not want to be shown, you can exclude from the mix by listing them in the exclude-numbers setting in the script.
Multiple numbers should be separated by space.
exclude-numbers="13475679876 1347856123456 46852526090"
How to change the default number
When you copy the script from your account, the default number is automatically set to the oldest phone number that you purchased.
You can replace this with any other number using the default-number setting in the script.
When adding your own phone numbers, please add them in the international format without the leading ‘+’.
Frequently asked questions
Here are the answers to some common questions. If you have any other questions or need help, please write to us at firstname.lastname@example.org.
1. Where will the number be shown?
The phone number is shown wherever you place the following code:
The script & div tags can be placed at different locations on the web page if needed. For example, the script can be added to the HTML header section and the div in the body.
2. Can I use any other tag instead of <div>?
Yes. You can use a <span> or <p> tag if you wish as long as the ID of the tag is set to sntlNumDisplay.
3. Should the <script> and <div> tags always be placed together?
No, they can be placed separately as long as they are both present on the page. For example, you can place <script> at the bottom of the page, just before the closing <body> tag and <div> anywhere else on the page where the number should be displayed.
4. Do you apply any custom CSS to the number?
No. We do not apply any custom styles to the number. You are free to style it as per your requirement.
5. Do I have to own a Sonetel number?
No. The script will work even if none of the phone numbers are from us. But we would naturally love if you moved your numbers to us – or purchased new numbers from us.