To integrate your website with Galytics.net, you need to update the HTML code of the site you want to track. Insert the Galytics.net tracking script code into the <head>
section of your site. Place the script within the <head> ... </head>
tags.
The Galytics.net tracking script code will look something like this (your exact token will be shown on the website settings page):
<script id="galytics-script"
data-token="XXX"
src="https://galytics.net/js/galytics.js" async defer>
</script>
You can find your javascript snippet by logging into your Galytics.net account. Here, you'll see the list of websites you've added.
Click on the "Settings" icon next to the website you want the snippet for. Then, scroll down to the "Analytics Token" section on the following page.
The complete galytics.js
script includes all features: page loads, custom events, and session recordings. If you only need page loads and custom events, you can use the slim script instead:
<script id="galytics-script"
data-token="XXX"
src="https://galytics.net/js/galytics.slim.js" async defer>
</script>
By default, the tracking script initiates a pageview as soon as it loads. It also attaches listeners to the History API, automatically triggering pageviews when history.pushState
is used. This functionality suits most websites, but we also provide a manual mode for those who prefer to have complete control over when pageviews are triggered.
<script id="galytics-script"
data-token="XXX"
src="https://galytics.net/js/galytics.manual.js" async defer>
</script>
Yes, you can use the same Galytics.net snippet on multiple sites and subdomains. However, there are two drawbacks to this approach:
{info} There are no limits on the number of websites you can create, so if you want separate stats for each subdomain, feel free to create individual websites for each.