# Clicks, not views

**URL:** https://community.elfsight.com/t/clicks-not-views/109498
**Category:** General Questions
**Tags:** whatsapp-chat
**Created:** [March 26, 2025, 6:03pm UTC](https://community.elfsight.com/t/clicks-not-views/109498 "2025-03-26T18:03:37Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Emiliano](https://sea2.discourse-cdn.com/flex020/user_avatar/community.elfsight.com/emiliano/32/8151_2.png) [@Emiliano](https://community.elfsight.com/u/Emiliano)
#### Post date: [March 26, 2025, 6:03pm UTC](https://community.elfsight.com/t/clicks-not-views/109498/1 "2025-03-26T18:03:37Z")

</div>

I would like to see how many clicks the WhasApp button has, so I can separate it from other sources. The view stats is not useful, because it´s the exact stats as the page views number.

---

<div class="post-metadata">

### Author: ![Max](https://sea2.discourse-cdn.com/flex020/user_avatar/community.elfsight.com/max/32/710_2.png) [@Max](https://community.elfsight.com/u/Max)
#### Post date: [March 27, 2025, 6:51pm UTC](https://community.elfsight.com/t/clicks-not-views/109498/3 "2025-03-27T18:51:54Z")

</div>

Hi there, @Emiliano and welcome aboard 👋

Happy to say that you can track clicks on the WhatsApp Chat button using the Google Analytics code. For this, please add this part of the code to your website’s `<head>`:

```auto
<script async src="https://www.googletagmanager.com/gtag/js?id=G-ID"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-ID');
</script>

```

  

In the code above, you need to replace **G-ID** with your actual website ID for Google Analytics. This article will help you find your ID - [Find your Google tag ID](https://support.google.com/analytics/answer/9539598?hl=en).

And then just add the rest of the script right before closing `</body>` tag:

```auto
<script>
function eappsDispatchAnalyticsEvent(event, selector, config) {
    function sendEvent(config) {
        if (typeof ga !== "undefined") {
            ga('send', 'event', {
                eventAction: config.action,
                eventCategory: config.category,
                eventLabel: config.label
            });
        }
        if (typeof gtag !== "undefined") {
            gtag('event', config.action, {
                'event_category': config.category,
                'event_label': config.label
            });
        }
    }
    function isHitClass(e, selector) {
        return e.target && e.target.closest(selector)
    }
    if (isHitClass(event, selector)) {
        sendEvent(config);
    }
}
document.addEventListener('click', function (event) {
    eappsDispatchAnalyticsEvent(event, '[class*="Bubble__BubbleComponent"]', {
        action: 'click',
        category: 'Open/Close WhatsApp Chat Widget',
        label: 'Open/Close WhatsApp Chat Widget'
    });
    eappsDispatchAnalyticsEvent(event, "button[title='WhatsApp']", {
        action: 'click',
        category: 'Click WhatsAppChat',
        label: 'Click WhatsAppChat'
    });
}, true);
</script>

```

  

This article explains where you can find the info about clicks - [Google Analytics 4 (GA4): Where to find my events - Elfsight Help Center](https://help.elfsight.com/article/1235-google-analytics-4-ga4-where-to-check-my-statistics)

Please let me know if it helps and if you have any other questions 🙂
