Skip to content

Implementation on my site

ComputerElite edited this page Mar 6, 2022 · 3 revisions

This will explain how I implemented ComputerAnalytics on my site:

Requirements

  • Any Linux, Windows or MacOS Computer (I use a raspberry pi)
  • An website
  • (optional but recommended) an domain

Implementation

Server-side

I deployed ComputerAnalytics on a raspberry pi which runs Ubuntu with the Dotnet runtime. Then I went through the setup (desribed in the home page).

client-side script

Code: https://github.com/ComputerElite/ComputerElite.github.io/blob/cbd6383245840ddea3aa35aacedb392c1f0bbdd4/js/standard.js#L146 Lines: 146 - 148

var script = document.createElement("script") // Create a script element
script.src = "https://analytics.rui2015.me/analytics.js?origin=" + location.origin // Add the ComputerAnalytics server as source with the query parameter origin set to the origin (in this case: 'https://computerelite.github.io')
document.head.appendChild(script) // Add the script to the head so it loads even after the page has loaded

Viewing the analytics

I simply put in my private token to view the analytics on https://analytics.rui2015.me/ and can then view everything

Clone this wiki locally