# Statistic-Feature All-in-One Chat

**URL:** <https://community.elfsight.com/t/statistic-feature-all-in-one-chat/75515>\
**Category:** General Questions\
**Tags:** all-in-one-chat\
**Created:** [October 14, 2024, 9:14am UTC](https://community.elfsight.com/t/statistic-feature-all-in-one-chat/75515 "2024-10-14T09:14:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![user15803](https://avatars.discourse-cdn.com/v4/letter/u/ed655f/32.png) [@user15803](https://community.elfsight.com/u/user15803)\
**Post date:** [October 14, 2024, 9:14am UTC](https://community.elfsight.com/t/statistic-feature-all-in-one-chat/75515/1 "2024-10-14T09:14:23Z")

</div>

Would be great to se which links were clicked how often.  
something small linke: 5.000 Views - Link 1: 50 clicks, Link 2: …

---

<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:** [October 14, 2024, 5:54pm UTC](https://community.elfsight.com/t/statistic-feature-all-in-one-chat/75515/3 "2024-10-14T17:54:03Z")

</div>

Hey there, @user15803 👋

The views statistics is available in your dashboard:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/elfsight/original/3X/8/f/8ff86c2b8bf90f78b2a909b0bd37cdfa70971429.png)

As for tracking clicks, you can do this using the Google Analytics code. Please add this part of the code to your website `<head>`:

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

```

  

In the code above, you need to replace **UA-ID** with your actual website ID for Google Analytics. If you are using Google Analytics 4, you need to use **G-ID** instead of UA-ID (see [screenshot](https://take.ms/yMfjJP)). 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 or Close All-in-one Widget',
        label: 'Open or Close All-in-one Widget'
    });
    eappsDispatchAnalyticsEvent(event, "button[title='WhatsApp']", {
        action: 'click',
        category: 'Click WhatsApp Chat',
        label: 'Click WhatsApp Chat'
    });
    eappsDispatchAnalyticsEvent(event, "button[title='Call']", {
        action: 'click',
        category: 'Click Call',
        label: 'Click Call'
    });
   eappsDispatchAnalyticsEvent(event, "button[title='Anfrage senden']", {
        action: 'click',
        category: 'Click Anfrage senden',
        label: 'Anfrage senden'
    });
}, true);
</script>

```

  

Test it out and let me know if it helped 🙂
