feat(analytics): enhedsmodel-kohorte som Matomo custom dimension (2)

This commit is contained in:
Asger Geel Weirsøe
2026-06-15 13:44:34 +02:00
parent 2b8e0506d9
commit da43c1bdc0
3 changed files with 30 additions and 0 deletions
+26
View File
@@ -73,6 +73,32 @@ const graphs = [baseGraph, ...jsonLd];
_paq.push(['setDomains', ['*.weirsoe.dk', '*.xn--weirse-fya.dk']]);
_paq.push(['setVisitorCookieTimeout', 31536000]); // visitor-cookie lever 1 år (sekunder)
_paq.push(['enableLinkTracking']);
// Enhedsmodel (Custom Dimension 2): grov enheds-kohorte ud fra skaerm (logiske pt) + DPR.
// Apple maskerer GPU-strengen, saa 6,1-tommer-generationen kan ikke splittes finere end gruppe.
(function () {
try {
var w = screen.width, h = screen.height, dpr = Math.round(window.devicePixelRatio || 1);
var k = Math.min(w, h) + 'x' + Math.max(w, h) + '@' + dpr;
var ua = navigator.userAgent || '';
var isApple = /iPhone|iPad|iPod/.test(ua) || (/Macintosh/.test(ua) && navigator.maxTouchPoints > 1);
var iphone = {
'320x568@2': 'iPhone SE(1)/5s',
'375x667@2': 'iPhone SE(2/3)/6/7/8',
'414x736@3': 'iPhone 6+/7+/8+ Plus',
'375x812@3': 'iPhone X/XS/11Pro/12mini/13mini',
'390x844@3': 'iPhone 12/13/14/16e (6,1 tomme notch)',
'393x852@3': 'iPhone 14Pro/15/15Pro/16',
'402x874@3': 'iPhone 16Pro',
'414x896@2': 'iPhone XR/11',
'414x896@3': 'iPhone XSMax/11ProMax',
'428x926@3': 'iPhone 12ProMax/13ProMax/14Plus',
'430x932@3': 'iPhone 14ProMax/15Plus/15ProMax/16Plus',
'440x956@3': 'iPhone 16ProMax'
};
var model = iphone[k] ? iphone[k] : (isApple ? ('Apple ukendt ' + k) : ('Andet ' + k + ' ' + (navigator.platform || '?')));
_paq.push(['setCustomDimension', 2, model]);
} catch (e) {}
})();
_paq.push(['trackPageView']);
(function () {
var u = '/_a/';