Statistic on clicks

Would be great to see how many user click on an badge or how many user has seen it.

1 Like

Hi there, @Philipp_Wittenbrink :waving_hand:

Many thanks for sharing your thoughts with us!

Unfortunately, there is no way to track the unique views, but the number of the widget’s installation code loads (views stats) is available right in your dashboard:

As for the click stats, I agree that it would be amazing to see this info right in the editor/dashboard. We’ll try to consider this opportunity, especially if more users upvote this request :slightly_smiling_face:

As for now, you can track the click stats using the Google Analytics code. Please add this part of the code to your website <head>:

<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.

And then just add the rest of the script to the Custom JS field on the Settings tab of your widget’s settings (this code works only with Badge layouts):

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*="BadgeContainer__Inner-sc"]', {
      action: 'click',
      category: 'Elfsight Badge click',
      label: 'Click to Elfsight Review Badge',
    });
  },
  true
);

This article explains, where you can find the info about clicks - Google Analytics 4 (GA4): Where to find my events - Elfsight Help Center

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

Friends, this request is now marked as ‘Planned’, which means we’re currently exploring possible development options, so it’s on our radar :muscle:t2:

Please note that we can’t provide any specifics at this stage, as we’re still in the process of estimating potential solutions. Let’s hope we’ll see it in the “In Progress” status, though! :blush:

1 Like

Status Update: the feature moved to the Design stage! :tada:

We’ll keep you posted on the further progress :slight_smile:

Update: the feature moved to development! :tada:

Hey everyone!

We’re happy to share that the Google Analytics integration is already available in the Reviews :tada:

Find more details in this post and share your feedback in the post thread :wink:- Reviews: Track user interactions with your widget using Google Analytics integration

1 Like