Statistics for Calendar clicks?

Is there a way to track how many people click each of the “events” on the calendar? For ours we are using it as a daily holidays calendar and would like to know how many people are engaging with it. If you have any data tracking options or data in general, we would love to know where to find it. I tried clicking the icon on the homepage thinking maybe it would show stats, but it gives a 404 error

1 Like

Hi @cbrown77 :wave:

Please let me talk to our devs and check if it’s possible to track click on the events. I’ll let you know once any news come up :slightly_smiling_face:

As for the 404 error, could you please share a screenshot of the Developer Console?

This article explains how you can do that - How to take a screenshot of the Developer Console.

Thank you for waiting @cbrown77 :wave:

You can track click on events with the help of Google Analytics.

If you haven’t got a Google Analytics account yet, you need to create it here using your Google email.

After that, please add this part of the code to your website <head>:

<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). This article will help you find your ID - [GA4] Find your Google tag ID - Analytics Help

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

<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, '.fc-event', {
            action: 'click',
            category: 'Elfsight Event Calendar',
            label: 'Click Event'
        });
    }, true);
</script>

You’ll find all the statistics in Elfsight Event Calendar category with the label Click Event.

Check it out and let me know how it worked :slightly_smiling_face:

1 Like