{"id":1213,"date":"2026-11-04T16:04:51","date_gmt":"2026-11-04T16:04:51","guid":{"rendered":"https:\/\/vectalk.com.br\/blog\/whatsapp-button-website-ga4\/"},"modified":"2026-11-04T16:04:57","modified_gmt":"2026-11-04T16:04:57","slug":"whatsapp-button-website-ga4","status":"publish","type":"post","link":"https:\/\/vectalk.com.br\/blog\/en\/whatsapp-button-website-ga4\/","title":{"rendered":"WhatsApp button on your website with GA4 tracking"},"content":{"rendered":"\n<p><em>Updated on November 4, 2026<\/em><\/p>\n\n\n\n<p>To add a WhatsApp button to your website and track it in GA4, use a <code>https:\/\/wa.me\/<\/code> link with your number and a prefilled message, style it as a floating button with CSS and fire the gtag <code>generate_lead<\/code> event on click. GA4 then shows how many WhatsApp clicks each page, channel and campaign produced. To tie the click to the conversation that reaches your system, add a short reference code to the message.<\/p>\n\n\n\n<p>Below you&#8217;ll find the full code (HTML, CSS and JavaScript), the GA4 setup and how to match the code with the official API webhook.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How the wa.me link works<\/h2>\n\n\n\n<p>The WhatsApp click-to-chat link follows the format described in the <a href=\"https:\/\/faq.whatsapp.com\/5913398998672934\" target=\"_blank\" rel=\"noreferrer noopener\">WhatsApp Help Center<\/a>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>https:\/\/wa.me\/5584999999999<\/code> opens a chat with the number.<\/li>\n\n\n<li><code>https:\/\/wa.me\/5584999999999?text=Hi%2C%20I%20came%20from%20your%20website<\/code> opens the chat with the text already typed.<\/li>\n\n<\/ul>\n\n\n\n<p>Number rules: full international format (country code + area code + number), digits only, no <code>+<\/code>, no brackets, dashes or leading zeros. The examples use a Brazilian number (country code 55); replace it with your own. The message must be URL-encoded (a space becomes <code>%20<\/code>, accented characters become <code>%C3%...<\/code> sequences). In JavaScript, <code>encodeURIComponent()<\/code> does it.<\/p>\n\n\n\n<p>If you don&#8217;t want to build it by hand, Vectalk&#8217;s <a href=\"https:\/\/vectalk.com.br\/en\/whatsapp-link-generator.html\">WhatsApp link generator<\/a> creates the link with a message and a QR code right in your browser.<\/p>\n\n\n\n<p>Two important points: the link doesn&#8217;t send anything by itself (the visitor taps &#8220;send&#8221;) and the text can be edited or deleted before sending. That&#8217;s why tracking has two halves: the click, measured by GA4, and the received message, measured by your system.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Floating button in HTML and CSS<\/h2>\n\n\n\n<p>A button fixed to the bottom-right corner, no library needed:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"language-html\">&lt;a id=\"btn-whatsapp\"\n   class=\"btn-whatsapp\"\n   href=\"https:\/\/wa.me\/5584999999999\"\n   target=\"_blank\"\n   rel=\"noopener\"\n   aria-label=\"Chat on WhatsApp\"&gt;\n  Chat on WhatsApp\n&lt;\/a&gt;<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"language-css\">.btn-whatsapp {\n  position: fixed;\n  right: 20px;\n  bottom: 20px;\n  z-index: 9999;\n  padding: 14px 20px;\n  border-radius: 999px;\n  background: #25d366;\n  color: #fff;\n  font: 600 16px\/1 system-ui, sans-serif;\n  text-decoration: none;\n  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);\n}\n.btn-whatsapp:hover { filter: brightness(0.95); }\n@media (max-width: 480px) {\n  .btn-whatsapp { right: 12px; bottom: 12px; padding: 12px 16px; font-size: 15px; }\n}<\/code><\/pre>\n\n\n\n<p>Details that prevent problems:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><code>target=\"_blank\"<\/code><\/strong> opens WhatsApp in another tab and keeps your page open, which gives the GA4 event time to go out.<\/li>\n\n\n<li><strong>Visible text<\/strong> (&#8220;Chat on WhatsApp&#8221;) makes it clear what the button does and helps screen readers. If you use only an icon, keep the <code>aria-label<\/code>.<\/li>\n\n\n<li><strong>Don&#8217;t cover other elements.<\/strong> Check on mobile that the button doesn&#8217;t hide the buy button, the cookie banner or another tool&#8217;s chat widget.<\/li>\n\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Prefilled message with page context<\/h2>\n\n\n\n<p>The prefilled message helps your agent know what the person wants. Build the text from the page and the visit&#8217;s UTM parameters:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"language-js\">const NUMBER = '5584999999999';\n\nfunction utm(name) {\n  const value = new URLSearchParams(location.search).get(name);\n  if (value) sessionStorage.setItem(name, value);\n  return sessionStorage.getItem(name) || '';\n}\n\nfunction refCode() {\n  \/\/ Short code, no personal data. E.g. S-7K2QX\n  let ref = sessionStorage.getItem('wa_ref');\n  if (!ref) {\n    ref = 'S-' + Math.random().toString(36).slice(2, 7).toUpperCase();\n    sessionStorage.setItem('wa_ref', ref);\n  }\n  return ref;\n}\n\nfunction whatsappLink() {\n  const topic = document.title.split('|')[0].trim();\n  const text = `Hi! I came from your website and I'd like to know about: ${topic}. (ref ${refCode()})`;\n  return `https:\/\/wa.me\/${NUMBER}?text=${encodeURIComponent(text)}`;\n}<\/code><\/pre>\n\n\n\n<p>Why a code instead of the full UTM in the message: <code>utm_source=google&amp;utm_medium=cpc&amp;utm_campaign=...<\/code> makes the text long and odd for the customer, who may delete it. A code like <code>ref S-7K2QX<\/code> is short, discreet and points to a record on your server with all the visit details.<\/p>\n\n\n\n<p>Never put the visitor&#8217;s name, email or any personal data in the message.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The generate_lead event in GA4<\/h2>\n\n\n\n<p><code>generate_lead<\/code> is an event from the <a href=\"https:\/\/developers.google.com\/analytics\/devguides\/collection\/ga4\/reference\/events?client_type=gtag#generate_lead\" target=\"_blank\" rel=\"noreferrer noopener\">GA4 event reference<\/a> for when a lead is generated. It accepts <code>currency<\/code> and <code>value<\/code> (if you send <code>value<\/code>, <code>currency<\/code> is required) and <code>lead_source<\/code>. With gtag already installed on the site:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"language-js\">const button = document.getElementById('btn-whatsapp');\n\nbutton.addEventListener('click', () =&gt; {\n  button.href = whatsappLink();\n  const ref = refCode();\n\n  gtag('event', 'generate_lead', {\n    lead_source: 'whatsapp_button',\n    lead_ref: ref,\n  });\n\n  \/\/ Optional: store the source on your server to match with the webhook\n  navigator.sendBeacon('\/api\/wa-ref', JSON.stringify({\n    ref,\n    page: location.pathname,\n    utm_source: utm('utm_source'),\n    utm_medium: utm('utm_medium'),\n    utm_campaign: utm('utm_campaign'),\n    created_at: new Date().toISOString(),\n  }));\n});<\/code><\/pre>\n\n\n\n<p>Call <code>utm()<\/code> once on page load too, to store the landing parameters before the visitor moves to another page of the site.<\/p>\n\n\n\n<p>If you use Google Tag Manager, the logic is the same: a click trigger on links containing <code>wa.me<\/code> and a GA4 event tag named <code>generate_lead<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">GA4 setup<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Mark it as a key event.<\/strong> In GA4 Admin, on the key events page, mark <code>generate_lead<\/code>. Google calls actions that matter to your business <em>key events<\/em>; &#8220;conversion&#8221; is now the term used for Google Ads campaigns (<a href=\"https:\/\/support.google.com\/analytics\/answer\/13965727\" target=\"_blank\" rel=\"noreferrer noopener\">about key events<\/a>).<\/li>\n\n\n<li><strong>Register custom parameters.<\/strong> To analyze <code>lead_source<\/code> and <code>lead_ref<\/code> in reports, create event-scoped custom dimensions. Data shows up after 24 to 48 hours (<a href=\"https:\/\/support.google.com\/analytics\/answer\/14240153\" target=\"_blank\" rel=\"noreferrer noopener\">custom dimensions and metrics<\/a>).<\/li>\n\n\n<li><strong>Value, if it makes sense.<\/strong> If you know what a WhatsApp lead is worth on average, send <code>value<\/code> and <code>currency<\/code>. If you don&#8217;t, don&#8217;t make it up: leave it without a value.<\/li>\n\n\n<li><strong>Test in DebugView<\/strong> before publishing and check that the event fires once per click.<\/li>\n\n<\/ol>\n\n\n\n<p>With that, GA4 answers which pages, sources and campaigns drive the most WhatsApp clicks.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Closing the loop: from click to conversation<\/h2>\n\n\n\n<p>GA4 measures the click. The conversation reaches your system through the <a href=\"https:\/\/vectalk.com.br\/blog\/en\/official-whatsapp-api\/\">official WhatsApp API<\/a> webhook. The reference code connects the two ends:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"language-js\">\/\/ Webhook: look for the code in the contact's first message\nexport async function handleMessage(msg, db) {\n  if (msg.type !== 'text') return;\n  const m = msg.text.body.match(\/ref (S-[A-Z0-9]{5})\/);\n  if (!m) return;\n\n  const source = await db.findRef(m[1]); \/\/ stored by \/api\/wa-ref\n  if (source) {\n    await db.updateContact(msg.from, {\n      site_source: source.page,\n      utm_source: source.utm_source,\n      utm_campaign: source.utm_campaign,\n    });\n  }\n}<\/code><\/pre>\n\n\n\n<p>From there, your CRM knows that this contact came, for example, from the pricing page through the search campaign. If a sale happens, you credit the right channel. The article on <a href=\"https:\/\/vectalk.com.br\/blog\/en\/whatsapp-api-crm-integration\/\">WhatsApp API CRM integration<\/a> shows where to store these fields.<\/p>\n\n\n\n<p>A match rate below 100% is normal: some people delete the text, others message the number directly without using the button.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">What about ads that open WhatsApp?<\/h3>\n\n\n\n<p>If traffic comes from Meta click-to-WhatsApp ads, the webhook already includes a <code>referral<\/code> object with ad data, with no need for a code in the message. See <a href=\"https:\/\/vectalk.com.br\/blog\/en\/track-click-to-whatsapp-ads\/\">how to track click-to-WhatsApp ads<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Reply fast after the click<\/h2>\n\n\n\n<p>The button works with the WhatsApp Business app, with coexistence or with the API only. What changes is what happens after the click. With the API, the customer&#8217;s first message opens the 24-hour customer service window and reaches your system via webhook. You can reply automatically, route to the right agent and set up a <a href=\"https:\/\/vectalk.com.br\/blog\/en\/whatsapp-api-welcome-away-message\/\">welcome and away message<\/a>.<\/p>\n\n\n\n<p>Since October 1, 2026, each number has an allowance of 1,000 service messages per month; from the 1,001st on, a reply inside the window costs BRL 0.0350 for recipients in Brazil.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to do it with Vectalk<\/h2>\n\n\n\n<p>The button and the GA4 event run on your site and don&#8217;t depend on your provider. Vectalk&#8217;s part is receiving the conversation: the number runs on the official API (with coexistence if you want to keep using the app), webhooks arrive in Meta&#8217;s format and your system reads the reference code. Vectalk also exposes Meta&#8217;s prefilled-message QR codes, which generate a short <code>wa.me\/message\/...<\/code> link per campaign, described in the <a href=\"https:\/\/docs.vectalk.com.br\/api-reference\/qr-codes\/create\">documentation<\/a>.<\/p>\n\n\n\n<p>Vectalk has no customer service inbox in its dashboard: conversations go to your system, CRM or the support tool connected to the API. To start, see <a href=\"https:\/\/vectalk.com.br\/blog\/en\/getting-started-vectalk\/\">getting started with Vectalk<\/a> or <a href=\"https:\/\/apps.vectalk.com.br\/register\">create your account<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Frequently asked questions<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Can GA4 tell whether the person actually sent the message?<\/h3>\n\n\n\n<p>No. GA4 sees the button click. Sending happens inside WhatsApp, outside your site. To know who sent it, match the reference code with the message received via webhook.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Should I use wa.me or api.whatsapp.com?<\/h3>\n\n\n\n<p>The WhatsApp Help Center documents the <code>wa.me<\/code> format. Use it, with digits only in the number and a URL-encoded message.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Can I use generate_lead for other forms too?<\/h3>\n\n\n\n<p>Yes. To tell them apart in reports, use different <code>lead_source<\/code> values (<code>whatsapp_button<\/code>, <code>contact_form<\/code>). GA4 also has <code>qualify_lead<\/code> and <code>close_convert_lead<\/code> for later funnel stages.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Does the button slow down my site?<\/h3>\n\n\n\n<p>The example above loads no library or external image: it&#8217;s a link with CSS. Button plugins may load extra scripts and icons; check the impact before installing one.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Does the reference code work with coexistence?<\/h3>\n\n\n\n<p>Yes, as long as incoming messages reach your system through the API webhook. See <a href=\"https:\/\/vectalk.com.br\/blog\/en\/whatsapp-coexistence-what-syncs\/\">what syncs in WhatsApp coexistence<\/a>.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><strong>Official sources checked on November 4, 2026:<\/strong> <a href=\"https:\/\/faq.whatsapp.com\/5913398998672934\" target=\"_blank\" rel=\"noreferrer noopener\">WhatsApp: how to use click to chat<\/a>, <a href=\"https:\/\/developers.google.com\/analytics\/devguides\/collection\/ga4\/reference\/events?client_type=gtag#generate_lead\" target=\"_blank\" rel=\"noreferrer noopener\">GA4 event reference (generate_lead)<\/a>, <a href=\"https:\/\/support.google.com\/analytics\/answer\/13965727\" target=\"_blank\" rel=\"noreferrer noopener\">GA4: about key events<\/a>, <a href=\"https:\/\/support.google.com\/analytics\/answer\/14240153\" target=\"_blank\" rel=\"noreferrer noopener\">GA4: custom dimensions and metrics<\/a>, <a href=\"https:\/\/developers.facebook.com\/documentation\/business-messaging\/whatsapp\/pricing\" target=\"_blank\" rel=\"noreferrer noopener\">WhatsApp API pricing<\/a>, <a href=\"https:\/\/docs.vectalk.com.br\/api-reference\/qr-codes\/create\">Vectalk: Create QR Code<\/a>, <a href=\"https:\/\/docs.vectalk.com.br\/concepts\/webhooks\">Vectalk: Webhooks<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ready-to-use floating WhatsApp button code, a wa.me link with a prefilled message, the GA4 generate_lead event and a reference code that shows where each lead came from.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[1],"tags":[],"class_list":["post-1213","post","type-post","status-publish","format-standard","hentry","category-blog"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>WhatsApp Button for Website with GA4 Tracking | Vectalk<\/title>\n<meta name=\"description\" content=\"WhatsApp button for website: floating button HTML and CSS, wa.me link with a message, GA4 generate_lead event and a ref code that ties click to lead.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/vectalk.com.br\/blog\/en\/whatsapp-button-website-ga4\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"WhatsApp Button for Website with GA4 Tracking | Vectalk\" \/>\n<meta property=\"og:description\" content=\"WhatsApp button for website: floating button HTML and CSS, wa.me link with a message, GA4 generate_lead event and a ref code that ties click to lead.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/vectalk.com.br\/blog\/en\/whatsapp-button-website-ga4\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog Vectalk\" \/>\n<meta property=\"article:published_time\" content=\"2026-11-04T16:04:51+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-11-04T16:04:57+00:00\" \/>\n<meta name=\"author\" content=\"wanderleyfcunha\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"wanderleyfcunha\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/vectalk.com.br\\\/blog\\\/en\\\/whatsapp-button-website-ga4\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/vectalk.com.br\\\/blog\\\/en\\\/whatsapp-button-website-ga4\\\/\"},\"author\":{\"name\":\"wanderleyfcunha\",\"@id\":\"https:\\\/\\\/vectalk.com.br\\\/blog\\\/#\\\/schema\\\/person\\\/ff36ecd9d8257856f227f8e5d639db2b\"},\"headline\":\"WhatsApp button on your website with GA4 tracking\",\"datePublished\":\"2026-11-04T16:04:51+00:00\",\"dateModified\":\"2026-11-04T16:04:57+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/vectalk.com.br\\\/blog\\\/en\\\/whatsapp-button-website-ga4\\\/\"},\"wordCount\":1162,\"articleSection\":[\"Blog\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/vectalk.com.br\\\/blog\\\/en\\\/whatsapp-button-website-ga4\\\/\",\"url\":\"https:\\\/\\\/vectalk.com.br\\\/blog\\\/en\\\/whatsapp-button-website-ga4\\\/\",\"name\":\"WhatsApp Button for Website with GA4 Tracking | Vectalk\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/vectalk.com.br\\\/blog\\\/#website\"},\"datePublished\":\"2026-11-04T16:04:51+00:00\",\"dateModified\":\"2026-11-04T16:04:57+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/vectalk.com.br\\\/blog\\\/#\\\/schema\\\/person\\\/ff36ecd9d8257856f227f8e5d639db2b\"},\"description\":\"WhatsApp button for website: floating button HTML and CSS, wa.me link with a message, GA4 generate_lead event and a ref code that ties click to lead.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/vectalk.com.br\\\/blog\\\/en\\\/whatsapp-button-website-ga4\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/vectalk.com.br\\\/blog\\\/en\\\/whatsapp-button-website-ga4\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/vectalk.com.br\\\/blog\\\/en\\\/whatsapp-button-website-ga4\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/vectalk.com.br\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"WhatsApp button on your website with GA4 tracking\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/vectalk.com.br\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/vectalk.com.br\\\/blog\\\/\",\"name\":\"Blog Vectalk\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/vectalk.com.br\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/vectalk.com.br\\\/blog\\\/#\\\/schema\\\/person\\\/ff36ecd9d8257856f227f8e5d639db2b\",\"name\":\"wanderleyfcunha\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/21c37077f1731eb558973f27a7b647d55f72fde5200a843ac5f5345b247ea725?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/21c37077f1731eb558973f27a7b647d55f72fde5200a843ac5f5345b247ea725?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/21c37077f1731eb558973f27a7b647d55f72fde5200a843ac5f5345b247ea725?s=96&d=mm&r=g\",\"caption\":\"wanderleyfcunha\"},\"sameAs\":[\"https:\\\/\\\/vectalk.com.br\\\/blog\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"WhatsApp Button for Website with GA4 Tracking | Vectalk","description":"WhatsApp button for website: floating button HTML and CSS, wa.me link with a message, GA4 generate_lead event and a ref code that ties click to lead.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/vectalk.com.br\/blog\/en\/whatsapp-button-website-ga4\/","og_locale":"en_US","og_type":"article","og_title":"WhatsApp Button for Website with GA4 Tracking | Vectalk","og_description":"WhatsApp button for website: floating button HTML and CSS, wa.me link with a message, GA4 generate_lead event and a ref code that ties click to lead.","og_url":"https:\/\/vectalk.com.br\/blog\/en\/whatsapp-button-website-ga4\/","og_site_name":"Blog Vectalk","article_published_time":"2026-11-04T16:04:51+00:00","article_modified_time":"2026-11-04T16:04:57+00:00","author":"wanderleyfcunha","twitter_card":"summary_large_image","twitter_misc":{"Written by":"wanderleyfcunha","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/vectalk.com.br\/blog\/en\/whatsapp-button-website-ga4\/#article","isPartOf":{"@id":"https:\/\/vectalk.com.br\/blog\/en\/whatsapp-button-website-ga4\/"},"author":{"name":"wanderleyfcunha","@id":"https:\/\/vectalk.com.br\/blog\/#\/schema\/person\/ff36ecd9d8257856f227f8e5d639db2b"},"headline":"WhatsApp button on your website with GA4 tracking","datePublished":"2026-11-04T16:04:51+00:00","dateModified":"2026-11-04T16:04:57+00:00","mainEntityOfPage":{"@id":"https:\/\/vectalk.com.br\/blog\/en\/whatsapp-button-website-ga4\/"},"wordCount":1162,"articleSection":["Blog"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/vectalk.com.br\/blog\/en\/whatsapp-button-website-ga4\/","url":"https:\/\/vectalk.com.br\/blog\/en\/whatsapp-button-website-ga4\/","name":"WhatsApp Button for Website with GA4 Tracking | Vectalk","isPartOf":{"@id":"https:\/\/vectalk.com.br\/blog\/#website"},"datePublished":"2026-11-04T16:04:51+00:00","dateModified":"2026-11-04T16:04:57+00:00","author":{"@id":"https:\/\/vectalk.com.br\/blog\/#\/schema\/person\/ff36ecd9d8257856f227f8e5d639db2b"},"description":"WhatsApp button for website: floating button HTML and CSS, wa.me link with a message, GA4 generate_lead event and a ref code that ties click to lead.","breadcrumb":{"@id":"https:\/\/vectalk.com.br\/blog\/en\/whatsapp-button-website-ga4\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/vectalk.com.br\/blog\/en\/whatsapp-button-website-ga4\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/vectalk.com.br\/blog\/en\/whatsapp-button-website-ga4\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/vectalk.com.br\/blog\/"},{"@type":"ListItem","position":2,"name":"WhatsApp button on your website with GA4 tracking"}]},{"@type":"WebSite","@id":"https:\/\/vectalk.com.br\/blog\/#website","url":"https:\/\/vectalk.com.br\/blog\/","name":"Blog Vectalk","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/vectalk.com.br\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/vectalk.com.br\/blog\/#\/schema\/person\/ff36ecd9d8257856f227f8e5d639db2b","name":"wanderleyfcunha","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/21c37077f1731eb558973f27a7b647d55f72fde5200a843ac5f5345b247ea725?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/21c37077f1731eb558973f27a7b647d55f72fde5200a843ac5f5345b247ea725?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/21c37077f1731eb558973f27a7b647d55f72fde5200a843ac5f5345b247ea725?s=96&d=mm&r=g","caption":"wanderleyfcunha"},"sameAs":["https:\/\/vectalk.com.br\/blog"]}]}},"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/vectalk.com.br\/blog\/wp-json\/wp\/v2\/posts\/1213","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vectalk.com.br\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vectalk.com.br\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vectalk.com.br\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vectalk.com.br\/blog\/wp-json\/wp\/v2\/comments?post=1213"}],"version-history":[{"count":1,"href":"https:\/\/vectalk.com.br\/blog\/wp-json\/wp\/v2\/posts\/1213\/revisions"}],"predecessor-version":[{"id":1216,"href":"https:\/\/vectalk.com.br\/blog\/wp-json\/wp\/v2\/posts\/1213\/revisions\/1216"}],"wp:attachment":[{"href":"https:\/\/vectalk.com.br\/blog\/wp-json\/wp\/v2\/media?parent=1213"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vectalk.com.br\/blog\/wp-json\/wp\/v2\/categories?post=1213"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vectalk.com.br\/blog\/wp-json\/wp\/v2\/tags?post=1213"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}