{"id":54,"date":"2019-07-16T12:44:55","date_gmt":"2019-07-16T12:44:55","guid":{"rendered":"http:\/\/holithemes.com\/plugins\/click-to-chat\/?p=54"},"modified":"2025-11-26T18:24:57","modified_gmt":"2025-11-26T12:54:57","slug":"google-analytics","status":"publish","type":"post","link":"https:\/\/holithemes.com\/plugins\/click-to-chat\/google-analytics\/","title":{"rendered":"Event Tracking for WhatsApp Button with Click to Chat Plugin in Google Analytics"},"content":{"rendered":"\n<p>The Click to Chat plugin seamlessly integrates with our existing Google Analytics setup to track user interactions effectively. When a user clicks on the WhatsApp button, an event is triggered and sent to Google Analytics. Please note that the plugin itself does not install Google Analytics, but it is fully compatible and works with any pre-configured setup.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Customizing Event Tracking<\/strong><\/h4>\n\n\n\n<p>We can customize the events directly from the plugin settings to modify the tracking based on our specific requirements.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Event Configuration<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Event Name:<\/strong> <code>click to chat<\/code> <\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<p>This is the identifier under which the event will appear in our Google Analytics reports.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Event Parameters<\/strong><\/h4>\n\n\n\n<p>Event parameters provide additional context about the event, helping us better understand user behavior.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Common Parameters:<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>{title}<\/code> \u2013 Page title where the event was triggered<\/li>\n\n\n\n<li><code>{url}<\/code> \u2013 Current page URL<\/li>\n\n\n\n<li><code>{number}<\/code> \u2013 WhatsApp number used in the widget<\/li>\n\n\n\n<li><code>[gclid]<\/code> \u2013 Google Ads click ID, fetched from the URL<\/li>\n\n\n\n<li><code>[[ _ga ]]<\/code> \u2013 Google Analytics client ID, fetched from the browser cookies<\/li>\n<\/ul>\n\n\n\n<p>These placeholders can be used in our event label or value fields to dynamically capture useful data during each interaction.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Fetch URL Parameter Values<\/strong><\/h4>\n\n\n\n<p>We can capture values from URL parameters to add more tracking data.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Syntax:<\/p>\n\n\n\n<p><code>[parameter_name]<\/code> (enclose the parameter name in square brackets)<\/p>\n\n\n\n<p>Behavior:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Returns the value of the specified parameter if found<\/li>\n\n\n\n<li>Returns an empty string if the parameter is not present<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Example Table for URL Parameters<\/h4>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th><strong>Scenario<\/strong><\/th><th><strong>URL<\/strong><\/th><th><strong>Input (Query Params to Extract)<\/strong><\/th><th><strong>Expected Output<\/strong><\/th><th><strong>Explanation<\/strong><\/th><\/tr><\/thead><tbody><tr><td>Example<\/td><td><code>https:\/\/example.com?gclid=123abc&amp;utm_source=google<\/code><\/td><td><code>[gclid], [utm_source]<\/code><\/td><td><code>123abc, google<\/code><\/td><td>Both parameters are present in the URL, so their values are returned.<\/td><\/tr><tr><td>Edge Case<\/td><td><code>https:\/\/example.com?utm_source=google<\/code><\/td><td><code>[gclid]<\/code><\/td><td><code>\"\"<\/code> (empty string)<\/td><td><code>gclid<\/code> is missing from the URL, so an empty string is returned.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Fetch Cookie Values<\/strong><\/h4>\n\n\n\n<p>We can also fetch values directly from cookies for persistent tracking.<\/p>\n\n\n\n<p>Syntax:<\/p>\n\n\n\n<p><code>[[cookie_name]]<\/code> (enclose the cookie name in double square brackets)<\/p>\n\n\n\n<p>Behavior:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Returns the cookie value if available<\/li>\n\n\n\n<li>Returns a blank string if the cookie does not exist<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Example Table for Cookie Values<\/h4>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><strong>Scenario<\/strong><\/td><td><strong>Cookie Present in Browser<\/strong><\/td><td><strong>Input (Cookie Name to Extract)<\/strong><\/td><td><strong>Expected Output<\/strong><\/td><td>Explanation<\/td><\/tr><tr><td>Example<\/td><td><code>_ga=GA1.2.987654321.1678901234<\/code><\/td><td><code>[[ _ga ]]<\/code><\/td><td><code>GA1.2.987654321.1678901234<\/code><\/td><td><code>_ga<\/code> cookie is present, so the value is returned.<\/td><\/tr><tr><td>Edge Case<\/td><td>_ga cookie not present<\/td><td><code>[[ _ga ]]<\/code><\/td><td><code>\"\"<\/code> (empty string)<\/td><td><code>_ga<\/code> cookie is missing, so a blank string is returned.<\/td><\/tr><tr><td>Custom<\/td><td><code>user_id=45872<\/code>, <code>_ga=GA1.2.987654321.1678901234<\/code><\/td><td><code>[[ user_id ]]<\/code><\/td><td><code>45872<\/code><\/td><td>Custom cookie <code>user_id<\/code> is present and successfully retrieved.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>By implementing this setup, all relevant data related to the &#8220;Click to Chat&#8221; event will be captured, providing valuable insights into user interactions.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Real-Time Event Monitoring<\/strong><\/h4>\n\n\n\n<p>To monitor user activity as it happens:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Log in to our Google Analytics dashboard.<\/li>\n\n\n\n<li>Navigate to <strong>Reports<\/strong> \u2192 <strong>Realtime overview \u2192 Events(Event Count &amp; Key Events)<\/strong>.<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"415\" src=\"https:\/\/holithemes.com\/plugins\/click-to-chat\/wp-content\/uploads\/2019\/07\/ga-1024x415.webp\" alt=\"\" class=\"wp-image-6697\" srcset=\"https:\/\/holithemes.com\/plugins\/click-to-chat\/wp-content\/uploads\/2019\/07\/ga-1024x415.webp 1024w, https:\/\/holithemes.com\/plugins\/click-to-chat\/wp-content\/uploads\/2019\/07\/ga-300x122.webp 300w, https:\/\/holithemes.com\/plugins\/click-to-chat\/wp-content\/uploads\/2019\/07\/ga-768x312.webp 768w, https:\/\/holithemes.com\/plugins\/click-to-chat\/wp-content\/uploads\/2019\/07\/ga-1536x623.webp 1536w, https:\/\/holithemes.com\/plugins\/click-to-chat\/wp-content\/uploads\/2019\/07\/ga.webp 1878w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>We will see live event triggers when users click the WhatsApp button on our site.<\/li>\n\n\n\n<li>Clicking on the <strong>Click to Chat<\/strong> event will navigate us to the detailed Click to Chat Analytics view.<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img decoding=\"async\" width=\"295\" height=\"394\" src=\"https:\/\/holithemes.com\/plugins\/click-to-chat\/wp-content\/uploads\/2019\/07\/Click-to-Chat-Analytics-image.webp\" alt=\"\" class=\"wp-image-7080\" style=\"width:236px;height:auto\" srcset=\"https:\/\/holithemes.com\/plugins\/click-to-chat\/wp-content\/uploads\/2019\/07\/Click-to-Chat-Analytics-image.webp 295w, https:\/\/holithemes.com\/plugins\/click-to-chat\/wp-content\/uploads\/2019\/07\/Click-to-Chat-Analytics-image-225x300.webp 225w\" sizes=\"(max-width: 295px) 100vw, 295px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>By configuring event tracking with Click to Chat and Google Analytics, we can gather valuable insights into user behavior, campaign performance, and conversion opportunities\u2014without writing custom code. This allows for smarter decisions and better engagement strategies using accurate real-time and historical data.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Additional Resources<\/strong><\/h4>\n\n\n\n<p><a href=\"https:\/\/holithemes.com\/plugins\/click-to-chat\/create-event-from-google-tag-manager-using-datalayer-send-to-google-analytics\/\">Create Event from Google Tag Manager using dataLayer &#8211; send to Google analytics &#8211; Click to Chat<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/holithemes.com\/plugins\/click-to-chat\/google-ads-conversion\/\">Google Ads Conversion for Click to Chat Plugin<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/holithemes.com\/plugins\/click-to-chat\/facebook-pixel\/\">Setting up Meta Pixel Event Tracking with \u2018Click to Chat\u2019<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/holithemes.com\/plugins\/click-to-chat\/webhooks\/\">Webhooks<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Click to Chat plugin seamlessly integrates with our existing Google Analytics setup to track user interactions effectively. When a user clicks on the WhatsApp button, an event is triggered and sent to Google Analytics. Please note that the plugin itself does not install Google Analytics, but it is fully compatible and works with any [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":"","_htd2_assets":[]},"categories":[46],"tags":[],"class_list":["post-54","post","type-post","status-publish","format-standard","hentry","category-analytics"],"_links":{"self":[{"href":"https:\/\/holithemes.com\/plugins\/click-to-chat\/wp-json\/wp\/v2\/posts\/54","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/holithemes.com\/plugins\/click-to-chat\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/holithemes.com\/plugins\/click-to-chat\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/holithemes.com\/plugins\/click-to-chat\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/holithemes.com\/plugins\/click-to-chat\/wp-json\/wp\/v2\/comments?post=54"}],"version-history":[{"count":0,"href":"https:\/\/holithemes.com\/plugins\/click-to-chat\/wp-json\/wp\/v2\/posts\/54\/revisions"}],"wp:attachment":[{"href":"https:\/\/holithemes.com\/plugins\/click-to-chat\/wp-json\/wp\/v2\/media?parent=54"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/holithemes.com\/plugins\/click-to-chat\/wp-json\/wp\/v2\/categories?post=54"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/holithemes.com\/plugins\/click-to-chat\/wp-json\/wp\/v2\/tags?post=54"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}