Want to add form counter

I have a form in my website that i did it with wix form.
i want a counter on my home page to everyone see how much has submitted form so i did code below am i doing something wrong ?

let submissionCounter = 0;

$w(‘#MyFormID’).onAfterSave(() => {
submissionCounter++;
$w(‘#MyTextElementID’).text = submissionCounter;
});

Currently, every time the page is loaded, it’s setting a new variable back to 0 and then when the form is submitted on that users device, it will increase the variable and set the text with the value.

From what I understand, you’ll want to either: