# Add a counter to see how often a popup has been clicked

**URL:** <https://community.elfsight.com/t/add-a-counter-to-see-how-often-a-popup-has-been-clicked/6795>\
**Category:** Popup\
**Tags:** Released\
**Created:** [November 27, 2019, 1:03am UTC](https://community.elfsight.com/t/add-a-counter-to-see-how-often-a-popup-has-been-clicked/6795 "2019-11-27T01:03:13Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Info96](https://sea2.discourse-cdn.com/flex020/user_avatar/community.elfsight.com/info96/32/1113_2.png) [@Info96](https://community.elfsight.com/u/Info96)\
**Post date:** [November 27, 2019, 1:03am UTC](https://community.elfsight.com/t/add-a-counter-to-see-how-often-a-popup-has-been-clicked/6795/1 "2019-11-27T01:03:13Z")

</div>

A simple counter next to each popup in the dashboard would be helpful. It would be even cooler if it would also show the impressions, so that the impression/click ratio can be calculated (similar to eg Thrive Leads)

---

<div class="post-metadata">

**Author:** ![Helga](https://sea2.discourse-cdn.com/flex020/user_avatar/community.elfsight.com/helga/32/1155_2.png) [@Helga](https://community.elfsight.com/u/Helga)\
**Post date:** [October 11, 2022, 12:00am UTC](https://community.elfsight.com/t/add-a-counter-to-see-how-often-a-popup-has-been-clicked/6795/2 "2022-10-11T00:00:00Z")

</div>

Folks, our former Wishlist portal, where our users shared their requests and suggestions, was transferred to this forum. You’re most welcome to vote, add new ideas, and leave your comments here — we surely will consider them all! 🤩

Original Votes: 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:** [September 4, 2023, 1:59pm UTC](https://community.elfsight.com/t/add-a-counter-to-see-how-often-a-popup-has-been-clicked/6795/3 "2023-09-04T13:59:10Z")

</div>

Hi @Info96 👋

We are happy to tell you that you can track the number of popup clicks with the help of 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*="Content__Container-sc"]', {
    action: 'click',
    category: 'Popup',
    label: 'Click on Elfsight Popup'
  });
}, true);
</script>

```

---

<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:** [September 16, 2024, 11:37am UTC](https://community.elfsight.com/t/add-a-counter-to-see-how-often-a-popup-has-been-clicked/6795/4 "2024-09-16T11:37:31Z")

</div>

A post was split to a new topic: [Google Analytics for Popup doesn’t work](https://community.elfsight.com/t/google-analytics-for-popup-doesnt-work/70594)

---

<div class="post-metadata">

**Author:** ![Shubham\_Shubh\_Gupta](https://sea2.discourse-cdn.com/flex020/user_avatar/community.elfsight.com/shubham_shubh_gupta/32/50101_2.png) [@Shubham\_Shubh\_Gupta](https://community.elfsight.com/u/Shubham_Shubh_Gupta)\
**Post date:** [January 8, 2025, 12:04pm UTC](https://community.elfsight.com/t/add-a-counter-to-see-how-often-a-popup-has-been-clicked/6795/5 "2025-01-08T12:04:42Z")

</div>

This feture is very important for our website [SocialKing.in](https://www.socialking.in/)

---

<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:** [January 10, 2025, 12:32pm UTC](https://community.elfsight.com/t/add-a-counter-to-see-how-often-a-popup-has-been-clicked/6795/6 "2025-01-10T12:32:12Z")

</div>

Welcome to the Community and thanks for upvoting the idea, @Shubham_Shubh_Gupta 👋

We agree that it would be amazing to have such a counter right in the dashboard, but as a workaround, you can track clicks using the Google Analytics code from the message above.

Feel free to test it out 😉

---

<div class="post-metadata">

**Author:** ![Allegheny\_County](https://sea2.discourse-cdn.com/flex020/user_avatar/community.elfsight.com/allegheny_county/32/37747_2.png) [@Allegheny\_County](https://community.elfsight.com/u/Allegheny_County)\
**Post date:** [March 26, 2025, 6:46pm UTC](https://community.elfsight.com/t/add-a-counter-to-see-how-often-a-popup-has-been-clicked/6795/7 "2025-03-26T18:46:23Z")

</div>

Where on a website is this tracking code supposed to be input? How do you differentiate between popup widgets? Ex. I want to track performance of a certain popup (call it P1), how will that code being entered track clicks or views of P1 specifically?

Is there any development on additional analytics for this tool? Another user requested an internal dashboard or something similar.

---

<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 28, 2025, 1:53pm UTC](https://community.elfsight.com/t/add-a-counter-to-see-how-often-a-popup-has-been-clicked/6795/8 "2025-03-28T13:53:04Z")

</div>

Apologies for missing that!

The 1st part of the code should be added to your website `<head>`, and the 2nd part before closing` </body>` tag.

If you have several widgets on your website, this code will count the total number of clicks for all widgets. However, we can create a new code, if you’d like to track clicks separately for each widget. For this, please send me a link to the page, where your popups are installed 🙂

As for the development, of the dashboard analytics, unfortunately we haven’t got any news yet. If we receive any updates from the dev team, we’ll inform you here right away!

---

<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:** [September 8, 2025, 2:06pm UTC](https://community.elfsight.com/t/add-a-counter-to-see-how-often-a-popup-has-been-clicked/6795/9 "2025-09-08T14:06:11Z")

</div>

Status Update: the feature moved to the **Design** stage! 🎉

We’ll keep you posted on the further progress 🙂

---

<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:** [September 23, 2025, 11:41am UTC](https://community.elfsight.com/t/add-a-counter-to-see-how-often-a-popup-has-been-clicked/6795/10 "2025-09-23T11:41:23Z")

</div>

Quick update: the feature was moved to the development! 🎉

---

<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 16, 2025, 10:46am UTC](https://community.elfsight.com/t/add-a-counter-to-see-how-often-a-popup-has-been-clicked/6795/11 "2025-10-16T10:46:24Z")

</div>

A post was split to a new topic: [Adobe Analytics for Popup](https://community.elfsight.com/t/adobe-analytics-for-popup/140649)

---

<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 27, 2025, 9:55am UTC](https://community.elfsight.com/t/add-a-counter-to-see-how-often-a-popup-has-been-clicked/6795/12 "2025-10-27T09:55:06Z")

</div>

Hey everyone!

We’re happy to announce that now you can track clicks using the Google Analytics integration:

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

  

Check this post for more details - [Popup: Track user interactions with your widget using Google Analytics integration](https://community.elfsight.com/t/popup-track-user-interactions-with-your-widget-using-google-analytics-integration/140910)
