For most people gc.zgo.at/count.js
should be fine, but there are also
stable versions if you want to use subresource integrity (SRI). This will verify
the integrity of the script to ensure there are no changes, and browsers will
refuse to run it if there are.
You won’t get any updates, with this – the versioned script will always remain
the same. Any existing version of count.js
is guaranteed to remain compatible,
but you may need to update it in the future for new features.
No changes
<script data-goatcounter="https://MYCODE.goatcounter.com/count"
async src="//gc.zgo.at/count.v5.js"
crossorigin="anonymous"
integrity="sha384-atnOLvQb9t+jTSipvd75X2yginT4PjVbqDdlJAmxMm+wYElFmeR6EmLP5bYeoRVQ"></script>
Use <img>
-based fallback if navigator.sendBeacon
fails, for example due to
Content-Security-Policy errors.
Expose window.goatcounter.filter()
and window.goatcounter.get_data()
.
No longer check for window.goatcounter.vars
and window.counter
These were
changed a week or so after the initial release over five years ago. AFAIK no
one is using them. If you do, then use window.goatcounter
(or
data-goatcounter-settings
) instead of window.goatcounter.vars
and
data-goatcounter="url"
on the script tag instead of window.counter
.
<script data-goatcounter="https://MYCODE.goatcounter.com/count"
async src="//gc.zgo.at/count.v4.js"
crossorigin="anonymous"
integrity="sha384-nRw6qfbWyJha9LhsOtSb2YJDyZdKvvCFh0fJYlkquSFjUxp9FVNugbfy8q1jdxI+"></script>
navigator.sendBeacon
when available.<script data-goatcounter="https://MYCODE.goatcounter.com/count"
async src="//gc.zgo.at/count.v3.js"
crossorigin="anonymous"
integrity="sha384-QGgNMMRFTi8ul5kHJ+vXysPe8gySvSA/Y3rpXZiRLzKPIw8CWY+a3ObKmQsyDr+a"></script>
start
and end
in the visitor counter.0.0.0.0
<script data-goatcounter="https://MYCODE.goatcounter.com/count"
async src="//gc.zgo.at/count.v2.js"
crossorigin="anonymous"
integrity="sha384-PeYXrhTyEaBBz91ANMgpSbfN1kjioQNPHNDbMvevUVLJoWrVEjDCpKb71TehNAlj"></script>
data-goatcounter-settings
on the script
tag.if
since some minifiers can’t deal with “dangling else”
well (the code is correct, it’s the minifier that’s broken).<script data-goatcounter="https://MYCODE.goatcounter.com/count"
async src="//gc.zgo.at/count.v1.js"
crossorigin="anonymous"
integrity="sha384-RD/1OXO6tEoPGqxhwMKSsVlE5Y1g/pv/Pf2ZOcsIONjNf1O+HPABMM4MmHd3l5x4"></script>
Feel free to get in touch if you’ve got any questions or having any problems; a lot of times they can be resolved without too much problems.
Ways to contact me: show