where is swetrix.js located in the self hosted version?
i installed the self hosted version, but when i click on the link to get the javascript tracking code i see the following output:
<script src="https://swetrix.org/swetrix.js" defer></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
swetrix.init('xxxxxxxxxxxxxx')
swetrix.trackViews()
})
</script>
<noscript>
<img
src="https://api.swetrix.com/log/noscript?pid= xxxxxxxxxxxxxx"
alt=""
referrerpolicy="no-referrer-when-downgrade"
/>
</noscript>
where can I set my own url? and where is the swetrix.js located in the self hosted version?
Hi @rolikeusch, the swetrix.js is not a part of standard selfhosted releases and can be:
- Installed from our Cloud CDN (https://swetrix.org/swetrix.js) which will redirect you to https://cdn.jsdelivr.net/gh/Swetrix/swetrix-js@latest/dist/swetrix.js (if you want, you can replace
@latestin that URL to any specific version from swetrix-js releases). - Instaled from NPM via
npm i swetrix.
In both of these scripts you can configure your selfhosted API URL using apiURL parameter of the swetrix.init function, see more docs on this here: https://docs.swetrix.com/swetrix-js-reference
I hope this helps, let me know if you have any more questions.
You can also proxy our Swetrix.JS CDN via your domain if needed.
thanks for the information. I am using the Docker version, it looks like this will be a little more complicated.
thanks for the information. I am using the Docker version, it looks like this will be a little more complicated.
Do you have instructions on how you did it?