'GoatCounter invalid URL for tracking domain

I got a basic static website that I want to implement Goatcounter on. I put the following tracking script on the index page.

<script data-goatcounter="https://MY_SITE.goatcounter.com/count" async src="//gc.zgo.at/count.js"></script>

But when trying to load the file locally, (not on a sever, just as a file) Firefox and Chromium both fail to load it, with the error:

GET file://gc.zgo.at/count.js net::ERR_INVALID_URL

Maybe the issue lies in running it locally?

Edit: I've disabled all ad/tracking blockers in my browser for testing.



Solution 1:[1]

The protocol in the script was missing. The wrong way:

<script data-goatcounter="https://MY_SITE.goatcounter.com/count" async src="//gc.zgo.at/count.js"></script>

The right way:

<script data-goatcounter="https://MY_SITE.goatcounter.com/count" async src="https://gc.zgo.at/count.js"></script>

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 ketchup_eater