# Analytics for Tools

**URL:** https://community.elfsight.com/t/analytics-for-tools/57321
**Category:** General Questions
**Tags:** form-builder
**Created:** [June 17, 2024, 2:34pm UTC](https://community.elfsight.com/t/analytics-for-tools/57321 "2024-06-17T14:34:04Z")
**Posts on this page:** 1
**Showing post:** 3

<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: [June 17, 2024, 2:58pm UTC](https://community.elfsight.com/t/analytics-for-tools/57321/3 "2024-06-17T14:58:28Z")

</div>

Hi there @user12934 👋

Views statistics is available in your dashboard. Here is how you can find it:

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

Also, you can track clicks on the Submit button via Google Analytics and GTM.

**Google Analytics:**

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 tag:

```auto
<script>
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
    });
  }
}

document.addEventListener('click', function (event) {
  function isHitClass(e, selector) {
    return e.target && e.target.closest(selector);
  }

  if (isHitClass(event, '[class*="ButtonBase__ButtonContainer"][aria-label="Submit"]')) {
    const requiredFields = document.querySelectorAll('[class*="FormLayout__Container-sc"] input[aria-required="true"]');
    const isFieldsFilled = [...requiredFields].every(field => field.value);

    if (isFieldsFilled) {
      sendEvent({
        action: 'click',
        category: 'Elfsight Form Submit Button',
        label: 'Submit Button Click'
      });
    }
  }
}, true);
</script>

```

  

> **In order to see the statistics on clicks, please go to the \*\*Reports\*\* tab of your Google Analytics dashboard**
>
> ![1.png](https://us1.discourse-cdn.com/flex020/uploads/elfsight/original/3X/7/b/7bccc1ba78f0fc5c2a4e040da8483631ef475d27.png)

  

> **Here you can choose the report type: Realtime Report or Reports Snapshot**
>
> ![2.png](https://us1.discourse-cdn.com/flex020/uploads/elfsight/original/3X/9/3/93193de2947a720ea5f2552fe99af072724429cb.png)

  

Just in case, we have an article that describes how to work with each of them - [Google Analytics 4 (GA4): Where to find my events](https://help.elfsight.com/article/1235-google-analytics-4-ga4-where-to-check-my-statistics).

  

**GTM:**

In this [thread](https://community.elfsight.com/t/analytics-on-forms-submitted/51522/3) you’ll see how to track the number of delivered submissions.

  

Feel free to check it out and let me know how it worked 🙂

---

_[View the full topic](https://community.elfsight.com/t/analytics-for-tools/57321)._
