Hi Charlotte, I actually used an HTML embed to get this method to work, not a Text Block. When you put in the HTML embed, you just need a span with the class you’re using for the counter, and you can use the “Add Field” function to place in the number from your CMS collection.
I can’t see from your read-only link where you’ve put the javascript, presumably you’ve put it in your site settings and not the page settings?
Hope that helps!