Introduction Last updated: 2024-04-15

Kiy.li Analytics collects information about the user and the page being requested.

1.1 Purpose

Kiy.li Analytics tracks requests to sites to collect data and insights about the requests being made to sites. This can later be used for analytic insights or other purposes.

1.2 Privacy

Kiy.li Analytics does not track any private or directly personally identifiable information (PII). Kiy.li Analytics only logs page and general device information. Kiy.li Analytics does register the user's IP address.

Kiy.li Analytics also creates a user fingerprint, but only based on device information and your timezone. The user fingerprint cannot be used to indentify a person. The data on which the fingerprint is based, is hashed to create a numerical ID. This also means a User ID cannot be reverted to see the fingerprint information. Data used to generate the fingerprint may also be logged seperately without hashing.

Kiy.li Analytics will never sell your data to any third-party.

Tracking

Kiy.li Analytics tracks browser, device and request data on all Kiy.li Analytics affiliated sites, or everywhere using a browser extension.

2.1 Data

Below is an overview of all shortcodes and data collected using Kiy.li Analytics

Shortcode Data Description Gathered Introduced
v version Kiy.li Analytics Version Client-Side Payload v1
a analytic id Analytic ID Client-Side Payload v1
at analytic type Analytic Type Client-Side Payload v1
url url Full URL without any parameters or fragments Client-Side Payload v1
f full url Full URL including parameters Client-Side Payload v1
pp page path Page path after the domain Client-Side Payload v1
ul user language Preferred user language Client-Side Payload v1
de document encoding Document Encoding Client-Side Payload v1
pt page title Title of the page Client-Side Payload v1
sr screen resolution Width and height of the screen resolution Client-Side Payload v1
vp viewport Viewport Size Client-Side Payload v1
je java enabled Java Enabled? Client-Side Payload v1
u user id User ID (fingerprint) Client-Side Payload v1
c client id Client ID Client-Side Payload v1
pid page id ID based on url without params Client-Side Payload v1
sid session id Session ID Client-Side Payload v1
ua user agent User Agent Client-Side Payload v1
t timestamp Timestamp in UNIX Client-Side Payload v1
r referrer Referral Path Client-Side Payload v1
fr in iframe Is page in iframe? Client-Side Payload v6
cke cookies enabled Are cookies enabled? Client-Side Payload v7
tch touch support Is touchscreen? Client-Side Payload v7
ct connection type Effective Connection Type Client-Side Payload v7
tz timezone Local timezone of user Client-Side Payload v7
la languages Preferred languages, first = most preferred Client-Side Payload v7
lt local time User's local time Client-Side Payload v7
x custom data Optional extra data Client-Side Payload v1
z cache buster Cache buster Client-Side Payload v1
ip ip address User's IP Address Post-Request (on Endpoint) v1
ae analytics endpoint Endpoint used for tracking Post-Request (on Endpoint) v2

Below is an example of payload data sent to one of the endpoints to track

v: CE1
a: 536390281823
at: pagevisit
url: https://www.google.com/
f: https://www.google.com/?this=example
pu: https://www.google.com
pp: /
ul: nl-NL
de: UTF-8
pt: Google
sr: 1707x960
vp: 1217x825
je: 0
fr: 1
cke: 1
tch: 0
ct: 4g
tz: Europe/Amsterdam
la: nl-NL,nl,en-US,en
lt: 12:42
u: 244091225366
c: 4469155605
pid: 7656186659
sid: 598372625939
ua: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36
t: 1713175538
r: 
z: 848869

2.2 Endpoints

Below is an overview of all endpoints Kiy.li Analytics can use to send data to the database.

Due to tracker blocking, multiple endpoints are neccessary to ensure data is transmitted to the database.

Endpoint Use Type
track Tracking Primary URL
t Tracking Fallback URL 1
puppy Tracking Fallback URL 2

Integration

Integrating Kiy.li Analytics onto your site is super easy! The only thing you need is the line below in your HTML.

<script src="https://analytics.kiy.li/js/latest.js?c=<?php echo rand(1000,99999) ?>"></script>

This code adds a random number to the end of the script URL to avoid caching, so you always have the latest version.

Volunteer

Kiy.li Analytics offers a way to voluntarily provide data to the database by installing browser extensions.

Extensions can be downloaded at https://analytics.kiy.li/.

The extension does not send a request if Kiy.li Analytics is already integrated on the website.

4.1 Extensions

Browser Name Version Prefix Release Date
Google Chrome Chrome Extension CE 15-04-2024

Versions

Below is an overview of the version history for Kiy.li Analytics.

5.1 Kiy.li Analytics Versions

Version Type Changes Date
1 Regular Integration Introduced 'v, a, at, url, f, pu, pp, ul, de, pt, sr, vp, je, u, c, pid, sid, ua, t, r, x, z, ip' 11-04-2024
2 Regular Integration Added two fallback attempts if a request fails. Also switched from loading as image to XHR. Also updated backend at this time to accomodate new table column ‘endpoint'. This is used to log which analytic url was used like track, t or puppy. Assigned shortcode 'ae’ for this (Analytics Endpoint). 11-04-2024
3 Regular Integration Added more specific user fingerprint. Also added new analytic type ‘pageleave'. Triggered when user closes the page. This also uses 'x’ (Custom Data) to log how long the person was on the page. 12-04-2024
4 Regular Integration Small improvements 14-04-2024
CE1 Chrome Extension Released Kiy.li Analytics Chrome Extension 15-04-2024
5 Regular Integration Added optional 'noPageLeave' parameter to script url. Used for Kiy.li Shortener links so we only register the hit once, since the pageleave is guaranteed anyway. 09-07-2024
6 Regular Integration Added 'fr' (in iFrame) to log whether the page is loaded within a frame element. 03-08-2024
7 Regular Integration Added 'cke, tch, ct, tz, la, lt' 25-10-2024
8 Regular Integration Added dispatchEvent 'kiy-analytics-completed' to add support for addEventListener's for when the script is 'complete'. 10-12-2024

Pixels

Kiy.li Analytics offers tracking pixels (also known as web beacons) which can be created and used to track requests to your site.

These can be created and viewed in your Kiy.li Analytics Account at https://analytics.kiy.li/account/.

6.1 Kiy.li Analytics Pixel

Creation

Pixels can be created on your account dashboard at https://analytics.kiy.li/account/.

The account dashboard has a section called 'Your Pixels'. This consists of a table showing pixel name, pixel id, pixel hits (how many times the pixel was triggered) and a view button.

The view button opens a popup showing the code you need to use the pixel.

The 'Your Pixels' section also has a button called '+ New Pixel'. This opens a popup where you specify the pixel name. After creation, the popup shows the specifics of the pixel, including the code required to use it.

Usage

You can start using your pixel by putting the pixel's code on your webpage(s).

Everytime someone visits that page, the pixel is loaded. This does the following:

  • Increases the pixel_hits value in the database
  • Adds information about the user who visited your page to Kiy.li Analytics's main tracking table.

Examples

Example of pixel code

<img referrerpolicy="unsafe-url" src="https://analytics.kiy.li/p/z7RWzwGzcY6o?cb=<?=time()?> alt="Kiy.li Analytics Pixel" style="display: none;">

We use referrerpolicy="unsafe-url" to register the full url, not just the domain.

We also append the pixel URL https://analytics.kiy.li/p/z7RWzwGzcY6o with ?cb=<?=time()?> to avoid caching.

Example of tracked data

No data is sent from the page, it is all handled on the pixel.

v: 4
a: 536390281823
at: pixelhit
ul: nl-NL,nl;q
ua: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36
t: 1713175538
r: https://try.w3schools.com/try_php.php?x=0.19081656516004286
x: {"pixel_id":"z7RWzwGzcY6o"}
ip: 1.1.1.1
ae: p

Data not included in pixel tracking compared to integrated tracking:

url: https://www.google.com/
f: https://www.google.com/?this=example
pu: https://www.google.com
pp: /
de: UTF-8
pt: Google
sr: 1707x960
vp: 1217x825
je: 0
fr: 1
u: 244091225366
c: 4469155605
pid: 7656186659
sid: 598372625939
z: 848869

Developer Tools

Kiy.li Analytics aims to make the tracking services easy to use.

7.1 Communication from RIS

The Regular Integration Script communicates to allow actions to happen based on certain events.

kiy-analytics-completed

When the script execution is considered 'complete', the script will run window.dispatchEvent(new CustomEvent('kiy-analytics-completed'));.

This means the script essentially emits a message, which can be picked up from your page on which the script is externally embedded.
For example, if you want to redirect the user only when this message is sent, you can do:

// Listen for the custom event from the external script
window.addEventListener('kiy-analytics-completed', function() {
    // Redirect after the script has fully loaded and sent data
    window.location.href = "https://example.com/";
});

The kiy-analytics-completed event is sent on the following moments:

  • The primary endpoint or a fallback endpoint returns a 200 OK (logged successfully).
  • The primary endpoint and all available fallback endpoints failed (log failed, still returns the message).

So it is important to remember that kiy-analytics-completed does not mean the data was successfully logged. It also sends it if no endpoint works. This way, with the code shown above, it will still redirect the user even if the tracking data could not be transmitted, but not before trying all endpoints.

Below is a robust implementation. Note that if you depend on the kiy-analytics-completed message being sent, it will not run if the script fails to load (for example due to the server being down). The example below handles this correctly.

<script>
var script = document.createElement('script');
script.src = "https://analytics.kiy.li/js/latest.js?c=<?php echo rand(1000,99999) ?>&noPageLeave=true";
script.async = true;

document.head.appendChild(script);
    
// Error handler for script load failure
script.onerror = function() {
    // Redirect if the script fails to load
    window.location.href = "https://example.com/";
};

// Listen for the custom event from the external script
window.addEventListener('kiy-analytics-completed', function() {
    // Redirect after the script has fully loaded and sent data
    window.location.href = "https://example.com/";
});
</script>