I don’t see any analytics for each of my forms, is this currently available? It would be nice to see how many views,uniques, vs. interactions, vs. leads captured, etc.
Hi there @user12934
Views statistics is available in your dashboard. Here is how you can find it:
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>
:
<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 - Find your Google tag ID.
And then just add the rest of the script right before closing tag:
<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
Here you can choose the report type: Realtime Report or Reports Snapshot
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.
GTM:
In this thread you’ll see how to track the number of delivered submissions.
Feel free to check it out and let me know how it worked
Hey Max, does this work for squarespace sites?
Hi there, @jvmproperty
Yep, it should work for all platforms. If any questions or issues come up, please send me a link to your website. I’ll gladly look into this for you