Skip to content
Dericson Calari
Back to the blog
Capa do artigo: How to track the button of WhatsApp of a website without using a form

How to track the button of WhatsApp of a website without using a form

See how the visitor identifier accompanies the message, how automation locates the campaign, and how to distinguish click, conversation, lead qualified and sell.

Foto de Dericson Calari

Published on6 min read

You see ten clicks on the button of the WhatsApp. In the inbox, six conversations arrived. Which campaign brought each one? The click shows that the person has opened the WhatsApp. To answer where the conversation came from, I need to take the identification of the visit to the message that actually arrives at the service.

That's why I made two parts work together. The script of first-party data collection record the origin on the site. The button takes an identifier in the ready message. On the other side, an automation receives the message and uses the same identifier to search for the visit in the bank. The person is still able to talk to me without filling out the form.

See the flow on the screen

In Class 03 i open the map of the site button structure and explain how the origin crosses from the browser to the WhatsApp.

From the visit to the conversation in the WhatsApp

Record the origin of the visit
Take the key in the message
Receive the message on the webhook
Find the visit on your own base
Associate the conversation with the result

1. The site records the origin of the visit

Imagine that the person touches on a budget announcement from Meta. It arrives on the site with UTMs, the tags that indicate the origin, the type of traffic and the campaign. If the URL brings a click identifier that the operation can use, you can also save that reference in the visit record.

In my structure, Rastracking generates the identifier visitor_id. To follow the explanation, I will call a record of Visit 42. In the bank he has the Budget campaign, the entry page and the schedule. The reference that goes to the conversation is the key to the record. Campaign, URL and media identifiers stay on base.

2. In the click, the button takes the key to the message

When the person touches on Talk in the WhatsApp, my button reads the same visitor_id that Rastracking has already created. It prepares the link with a message like “Hello, I want a budget” and injects into the text a coded marker that carries the key of the visit. In the version I use, the brand stays inside the “Hello”. Automation will be able to read it when the conversation arrives.

This click can also be logged with the page, button and time. With the two entries saved, I can know which button was triggered and distinguish this action from the first message received.

3. The first message goes into the webhook

The WhatsApp open with the sentence ready. The person touches on Send. This is when the integration of WhatsApp Business delivers the message event to the webhook. The flow in the n8n reads the text received and decodes the key that the button placed there.

If the visit was a 42, automation seeks to 42 in the bank. The record of the conversation now points to the origin that was already stored when the person was on the site. The same phrase “Hello, I want a budget” can come from two campaigns. What differentiates the routes is the key present in the event received.

Treat the marker as a data of integration. Validate your format, search only for the correct scope of your account and keep the source open when the message comes without a corresponding key. So each report keeps separate the linked conversations and those that need other evidence.

4. The service records the next steps

The first message can already count as a conversation received. If the service qualifies that person, record the qualification. If the order is confirmed, record the purchase and associate the order with the right conversation. Your team can feed these steps by CRM, checkout or other automation already connected.

The first-party data collection record these steps at your base. The conversion tracking sends to the traffic platform the events it accepts and that you have set up. For each destination, check which action triggers the submission and which assignment identifier can track the event. Keep a stable identifier of the action so that two notifications of the same order do not see two purchases.

Stage

What I Use to Check

Campaign visit

visitor_id, origin, page and time at the base

Click the button

Action of the website linked to the visit

Conversation initiated

First message received and key found in webhook

Lead qualified

Change of stage recorded in attendance

Sale

Request confirmed and associated with the conversation

Informed conversion

Integration and conference response in the destination

When the ad opens directly in the WhatsApp

In direct campaign, the person enters the conversation without going through the page of your site. In this trail, the origin comes from the reference of the announcement that accompanies the message by the integration of the WhatsApp Business, when available. In the Meta, one of the fields of this reference is the ctwa_clid. The logic of following conversation, qualification and sale continues. The source key changes according to the route.

Take a test with a click and a conversation

  1. Open a test page with the campaign teste_botao in the URL. Confirm that the visit was recorded.
  2. Click the button and look at the full message. Check out the click on the base before submitting.
  3. Send the message to a test account. Compare the decoded key with the visit and see if the campaign appeared in attendance.
  4. Advance the conversation to a test stage. Check out the new record and track a single conversion attempt in the target test environment.

The test is complete when you can open the first message and return to the visit that brought the person. This is the path that turns a click count into a reading of the conversations and results.

Copy the prompt to map your structure

Prompt · 8 lines
Quero entender e testar o rastreamento do botão de WhatsApp no meu site.
Uso [plataforma do site], [provedor de WhatsApp Business] e [banco/CRM].
Desenhe o fluxo da visita com UTMs até a mensagem recebida. Explique como
usar um só ID da visita, colocar sua chave na mensagem, receber o webhook
e consultar o registro certo no banco. Separe clique, conversa, lead
qualificado e compra. Mostre o teste mínimo com dados de demonstração
e o que conferir para não registrar o mesmo evento duas vezes.
Quando faltar informação da minha instalação, pergunte antes de escrever código.

Learn how to assemble the structure in the Rastracking100

The training shows how to link the origin of the visit to the conversation received by the WhatsApp and how to use this information when the conversation turns lead qualified or sale. The button track on the site and that of direct campaigns to WhatsApp they start from different situations. You can start with what corresponds to your service.

Know the Rastracking100 and the available trails

Continue studying