- Blog
- Web Development
Creating A WhatsApp Link: HTML And Prefilled Message Examples
To create a WhatsApp link, you add the phone number together with its country code to the end of the https://wa.me/ address. The text parameter is used for a prefilled message. The link opens the chat; it does not send the message for you.
How Is A Turkish Number Written?
For example, the number 0532 729 18 01 is written in the link like this:
https://wa.me/905327291801
This example is HSNCRC’s contact number. On your own site, be sure to replace it with your own WhatsApp number. For Türkiye you start with the country code 90; the local 0 at the start of the number, the plus sign, spaces and parentheses are not added. The other zeros inside the number are not removed.
The number has to be linked to an active WhatsApp account. Try the link separately on a phone and on a computer; the opening experience can differ depending on the app and the session on the device.
A WhatsApp Link With HTML
<a href="https://wa.me/905327291801">
Message On WhatsApp
</a>
Using a real link to go to a page is clearer than a box that only listens for clicks. The visitor should be able to open the link with the keyboard as well.
How Do You Add A Prefilled Message?
A short example:
<a href="https://wa.me/905327291801?text=Hello%2C%20I%20would%20like%20some%20information.">
Get Information
</a>
For messages with Turkish characters or long messages, you can use JavaScript instead of encoding the text by hand:
<a id="whatsapp-linki" href="https://wa.me/905327291801">
Let’s Talk About Your Project
</a>
<script>
const numara = '905327291801'; // Enter your own number.
const mesaj = 'Hello, I would like some information about a website.';
const baglanti = document.querySelector('#whatsapp-linki');
baglanti.href =
'https://wa.me/' + numara + '?text=' + encodeURIComponent(mesaj);
</script>
Here encodeURIComponent encodes only the message. Do not put the whole link, encoded again, into the message parameter.
Where Should You Place The Button?
I recommend putting the contact button in the places where the visitor is ready to ask a question: the end of the service description, the contact section and, where needed, the product page.
Instead of adding the same button next to every paragraph, explain what will happen next. A label like “Ask About The Price And Scope” gives more information than the phrase “Click Here.”
If you use a fixed mobile button, check that it does not cover the last lines of the page, the cookie area or another button.
An Important Distinction In Measurement
A click on the WhatsApp link does not show that the message was sent. Click, chat, qualified inquiry and sale are different stages. Do not lump them all together as “customers” in your report.
Frequently Asked Questions
Does The Message Send Automatically When The Link Is Clicked?
No. The prefilled text opens in the message field; the user completes the sending themselves.
Does This Link Connect An AI Assistant?
No. A chat link and an integration that reads and answers messages are different pieces of work.
Do You Need To Save The Phone Number To Your Contacts?
The purpose of the click-to-chat feature is to be able to start a chat without adding the number to your contacts.
Related Guides
You can look at the HTML link examples and the distinctions in conversion tracking.