[{"data":1,"prerenderedAt":2480},["ShallowReactive",2],{"article-alternates":3,"article-\u002Fit\u002Fdata\u002Fanalytics-privacy-first-plausible-aggregazione-lato-server":13},{"i18nKey":4,"paths":5},"data-006-2026-07",{"de":6,"en":7,"es":8,"fr":9,"it":10,"ru":11,"tr":12},"\u002Fde\u002Fdata\u002Fprivacy-first-analytics-plausible-server-side","\u002Fen\u002Fdata\u002Fprivacy-first-analytics-plausible-server-side-aggregation","\u002Fes\u002Fdata\u002Fprivacidad-first-analytics-plausible-agregacion-servidor","\u002Ffr\u002Fdata\u002Fprivacy-first-analytics-plausible-server-side-aggregation","\u002Fit\u002Fdata\u002Fanalytics-privacy-first-plausible-aggregazione-lato-server","\u002Fru\u002Fdata\u002Fprivacy-first-analytics-plausible-serverside-aggregation","\u002Ftr\u002Fdata\u002Fprivacy-first-analytics-plausible-ve-sunucu-tarafi-aggregation",{"_path":10,"_dir":14,"_draft":15,"_partial":15,"_locale":16,"title":17,"description":18,"publishedAt":19,"modifiedAt":19,"category":14,"i18nKey":4,"tags":20,"readingTime":26,"author":27,"body":28,"_type":2474,"_id":2475,"_source":2476,"_file":2477,"_stem":2478,"_extension":2479},"data",false,"","Privacy-First Analytics: Plausible e Aggregazione Lato Server","Tracciamento senza cookie, conformità GDPR\u002FKVKK e alternativa a GA4: architettura Plausible + server-side aggregation per reinventare il monitoraggio degli utenti.","2026-07-26",[21,22,23,24,25],"privacy-first-analytics","plausible","cookieless-tracking","conformita-gdpr","server-side-aggregation",9,"Roibase",{"type":29,"children":30,"toc":2465},"root",[31,39,46,51,56,61,67,72,81,591,612,622,866,871,877,888,901,947,959,1435,1468,1723,1728,1734,1739,1764,1769,1792,1797,1820,1825,1843,1851,1874,1879,1885,1897,1910,2161,2177,2183,2203,2208,2351,2356,2424,2429,2434,2440,2445,2459],{"type":32,"tag":33,"props":34,"children":35},"element","p",{},[36],{"type":37,"value":38},"text","Il limite di conservazione dell'ID utente di GA4 di \"360 giorni\" annunciato a metà 2024, e l'obbligo del Consent Mode v2 nel marzo 2024, ha posto i team di marketing di fronte a due scelte: perdere tassi di accettazione dei banner dei cookie fino al 40% e abbandonare l'infrastruttura di segmentazione costruita da UA, oppure trovare il modo di costruire un nuovo measurement stack che funzioni senza cookie. L'integrazione di strumenti di analytics privacy-first come Plausible con un'architettura di aggregazione lato server è diventata la soluzione tecnica di questo scenario.",{"type":32,"tag":40,"props":41,"children":43},"h2",{"id":42},"il-blocco-dei-cookie-supera-il-60",[44],{"type":37,"value":45},"Il Blocco dei Cookie Supera il 60%",{"type":32,"tag":33,"props":47,"children":48},{},[49],{"type":37,"value":50},"Apple blocca i cookie di terze parti in Safari con Intelligent Tracking Prevention dal 2017; Chrome ha reso Privacy Sandbox predefinito nell'ultimo trimestre del 2024; Firefox ha la Protezione dal Tracciamento attiva per impostazione predefinita. Secondo il rapporto Mozilla 2025, l'utente europeo medio clicca su \"Rifiuta\" nel banner dei cookie o lo chiude nel 62% dei casi. In una proprietà GA4, il numero di sessioni segnate come consent_status=denied si è stabilizzato tra il 55-65% nelle proprietà B2C a partire dal Q4 2024.",{"type":32,"tag":33,"props":52,"children":53},{},[54],{"type":37,"value":55},"Questo significa che i pixel lato client classici (gtag.js, fbq) stanno perdendo più della metà del traffico. La funzione \"modeled conversion\" di GA4 tenta di colmare questo vuoto, ma i dati modellati significano costruire segment di audience con regressioni predittive anziché con eventi reali. Nei test di incrementality, i dataset di modeled conversion mostrano una deviazione media del 18-22% rispetto alle conversioni reali (documentazione beta di Google Marketing Platform 2025).",{"type":32,"tag":33,"props":57,"children":58},{},[59],{"type":37,"value":60},"Il tracciamento senza cookie poggia in questo punto su due architetture: una raccoglie completamente gli event lato server (server-side GTM, Segment, RudderStack), l'altra crea un identificativo temporaneo lato client utilizzando sessionStorage\u002FlocalStorage anziché cookie e lo trasmette al server. Plausible Analytics utilizza il secondo approccio, ma l'identificativo non è persistente — ogni sessione genera un nuovo hash. In apparenza, sembra impossibile tracciare il \"percorso dell'utente\"; in realtà, al livello di aggregazione diventa possibile fare analisi di coorte e misurare il retention.",{"type":32,"tag":40,"props":62,"children":64},{"id":63},"architettura-di-plausible-event-stream-tramite-beacon-post",[65],{"type":37,"value":66},"Architettura di Plausible: Event Stream tramite Beacon POST",{"type":32,"tag":33,"props":68,"children":69},{},[70],{"type":37,"value":71},"Plausible è una piattaforma di web analytics open source con licenza MIT (plausible.io). La dimensione dello script è 1,4 KB (GA4 è 43 KB, Segment 28 KB); non scrive cookie; la conformità GDPR\u002FKVKK\u002FCCPA è predefinita. Come funziona?",{"type":32,"tag":33,"props":73,"children":74},{},[75],{"type":32,"tag":76,"props":77,"children":78},"strong",{},[79],{"type":37,"value":80},"Script lato client:",{"type":32,"tag":82,"props":83,"children":87},"pre",{"className":84,"code":85,"language":86,"meta":16,"style":16},"language-javascript shiki shiki-themes github-dark","\u002F\u002F implementazione minimale di plausible.js\n(function(){\n  const endpoint = 'https:\u002F\u002Fanalytics.example.com\u002Fapi\u002Fevent';\n  const sessionHash = btoa(navigator.userAgent + performance.timing.navigationStart).substring(0,16);\n  \n  function sendEvent(name, props = {}) {\n    navigator.sendBeacon(endpoint, JSON.stringify({\n      n: name,              \u002F\u002F nome dell'evento\n      u: location.href,     \u002F\u002F URL della pagina\n      d: document.domain,\n      r: document.referrer,\n      w: window.innerWidth,\n      h: sessionHash,       \u002F\u002F identificativo di sessione temporaneo\n      p: props              \u002F\u002F proprietà personalizzate\n    }));\n  }\n  \n  sendEvent('pageview');\n  \n  \u002F\u002F tracciamento dei clic\n  document.addEventListener('click', (e) => {\n    if (e.target.matches('[data-track]')) {\n      sendEvent('click', { element: e.target.dataset.track });\n    }\n  });\n})();\n","javascript",[88],{"type":32,"tag":89,"props":90,"children":91},"code",{"__ignoreMap":16},[92,104,125,156,223,232,275,314,328,341,350,359,368,382,396,405,414,422,444,452,461,509,542,564,573,582],{"type":32,"tag":93,"props":94,"children":97},"span",{"class":95,"line":96},"line",1,[98],{"type":32,"tag":93,"props":99,"children":101},{"style":100},"--shiki-default:#6A737D",[102],{"type":37,"value":103},"\u002F\u002F implementazione minimale di plausible.js\n",{"type":32,"tag":93,"props":105,"children":107},{"class":95,"line":106},2,[108,114,120],{"type":32,"tag":93,"props":109,"children":111},{"style":110},"--shiki-default:#E1E4E8",[112],{"type":37,"value":113},"(",{"type":32,"tag":93,"props":115,"children":117},{"style":116},"--shiki-default:#F97583",[118],{"type":37,"value":119},"function",{"type":32,"tag":93,"props":121,"children":122},{"style":110},[123],{"type":37,"value":124},"(){\n",{"type":32,"tag":93,"props":126,"children":128},{"class":95,"line":127},3,[129,134,140,145,151],{"type":32,"tag":93,"props":130,"children":131},{"style":116},[132],{"type":37,"value":133},"  const",{"type":32,"tag":93,"props":135,"children":137},{"style":136},"--shiki-default:#79B8FF",[138],{"type":37,"value":139}," endpoint",{"type":32,"tag":93,"props":141,"children":142},{"style":116},[143],{"type":37,"value":144}," =",{"type":32,"tag":93,"props":146,"children":148},{"style":147},"--shiki-default:#9ECBFF",[149],{"type":37,"value":150}," 'https:\u002F\u002Fanalytics.example.com\u002Fapi\u002Fevent'",{"type":32,"tag":93,"props":152,"children":153},{"style":110},[154],{"type":37,"value":155},";\n",{"type":32,"tag":93,"props":157,"children":159},{"class":95,"line":158},4,[160,164,169,173,179,184,189,194,199,203,208,213,218],{"type":32,"tag":93,"props":161,"children":162},{"style":116},[163],{"type":37,"value":133},{"type":32,"tag":93,"props":165,"children":166},{"style":136},[167],{"type":37,"value":168}," sessionHash",{"type":32,"tag":93,"props":170,"children":171},{"style":116},[172],{"type":37,"value":144},{"type":32,"tag":93,"props":174,"children":176},{"style":175},"--shiki-default:#B392F0",[177],{"type":37,"value":178}," btoa",{"type":32,"tag":93,"props":180,"children":181},{"style":110},[182],{"type":37,"value":183},"(navigator.userAgent ",{"type":32,"tag":93,"props":185,"children":186},{"style":116},[187],{"type":37,"value":188},"+",{"type":32,"tag":93,"props":190,"children":191},{"style":110},[192],{"type":37,"value":193}," performance.timing.navigationStart).",{"type":32,"tag":93,"props":195,"children":196},{"style":175},[197],{"type":37,"value":198},"substring",{"type":32,"tag":93,"props":200,"children":201},{"style":110},[202],{"type":37,"value":113},{"type":32,"tag":93,"props":204,"children":205},{"style":136},[206],{"type":37,"value":207},"0",{"type":32,"tag":93,"props":209,"children":210},{"style":110},[211],{"type":37,"value":212},",",{"type":32,"tag":93,"props":214,"children":215},{"style":136},[216],{"type":37,"value":217},"16",{"type":32,"tag":93,"props":219,"children":220},{"style":110},[221],{"type":37,"value":222},");\n",{"type":32,"tag":93,"props":224,"children":226},{"class":95,"line":225},5,[227],{"type":32,"tag":93,"props":228,"children":229},{"style":110},[230],{"type":37,"value":231},"  \n",{"type":32,"tag":93,"props":233,"children":235},{"class":95,"line":234},6,[236,241,246,250,256,261,266,270],{"type":32,"tag":93,"props":237,"children":238},{"style":116},[239],{"type":37,"value":240},"  function",{"type":32,"tag":93,"props":242,"children":243},{"style":175},[244],{"type":37,"value":245}," sendEvent",{"type":32,"tag":93,"props":247,"children":248},{"style":110},[249],{"type":37,"value":113},{"type":32,"tag":93,"props":251,"children":253},{"style":252},"--shiki-default:#FFAB70",[254],{"type":37,"value":255},"name",{"type":32,"tag":93,"props":257,"children":258},{"style":110},[259],{"type":37,"value":260},", ",{"type":32,"tag":93,"props":262,"children":263},{"style":252},[264],{"type":37,"value":265},"props",{"type":32,"tag":93,"props":267,"children":268},{"style":116},[269],{"type":37,"value":144},{"type":32,"tag":93,"props":271,"children":272},{"style":110},[273],{"type":37,"value":274}," {}) {\n",{"type":32,"tag":93,"props":276,"children":278},{"class":95,"line":277},7,[279,284,289,294,299,304,309],{"type":32,"tag":93,"props":280,"children":281},{"style":110},[282],{"type":37,"value":283},"    navigator.",{"type":32,"tag":93,"props":285,"children":286},{"style":175},[287],{"type":37,"value":288},"sendBeacon",{"type":32,"tag":93,"props":290,"children":291},{"style":110},[292],{"type":37,"value":293},"(endpoint, ",{"type":32,"tag":93,"props":295,"children":296},{"style":136},[297],{"type":37,"value":298},"JSON",{"type":32,"tag":93,"props":300,"children":301},{"style":110},[302],{"type":37,"value":303},".",{"type":32,"tag":93,"props":305,"children":306},{"style":175},[307],{"type":37,"value":308},"stringify",{"type":32,"tag":93,"props":310,"children":311},{"style":110},[312],{"type":37,"value":313},"({\n",{"type":32,"tag":93,"props":315,"children":317},{"class":95,"line":316},8,[318,323],{"type":32,"tag":93,"props":319,"children":320},{"style":110},[321],{"type":37,"value":322},"      n: name,              ",{"type":32,"tag":93,"props":324,"children":325},{"style":100},[326],{"type":37,"value":327},"\u002F\u002F nome dell'evento\n",{"type":32,"tag":93,"props":329,"children":330},{"class":95,"line":26},[331,336],{"type":32,"tag":93,"props":332,"children":333},{"style":110},[334],{"type":37,"value":335},"      u: location.href,     ",{"type":32,"tag":93,"props":337,"children":338},{"style":100},[339],{"type":37,"value":340},"\u002F\u002F URL della pagina\n",{"type":32,"tag":93,"props":342,"children":344},{"class":95,"line":343},10,[345],{"type":32,"tag":93,"props":346,"children":347},{"style":110},[348],{"type":37,"value":349},"      d: document.domain,\n",{"type":32,"tag":93,"props":351,"children":353},{"class":95,"line":352},11,[354],{"type":32,"tag":93,"props":355,"children":356},{"style":110},[357],{"type":37,"value":358},"      r: document.referrer,\n",{"type":32,"tag":93,"props":360,"children":362},{"class":95,"line":361},12,[363],{"type":32,"tag":93,"props":364,"children":365},{"style":110},[366],{"type":37,"value":367},"      w: window.innerWidth,\n",{"type":32,"tag":93,"props":369,"children":371},{"class":95,"line":370},13,[372,377],{"type":32,"tag":93,"props":373,"children":374},{"style":110},[375],{"type":37,"value":376},"      h: sessionHash,       ",{"type":32,"tag":93,"props":378,"children":379},{"style":100},[380],{"type":37,"value":381},"\u002F\u002F identificativo di sessione temporaneo\n",{"type":32,"tag":93,"props":383,"children":385},{"class":95,"line":384},14,[386,391],{"type":32,"tag":93,"props":387,"children":388},{"style":110},[389],{"type":37,"value":390},"      p: props              ",{"type":32,"tag":93,"props":392,"children":393},{"style":100},[394],{"type":37,"value":395},"\u002F\u002F proprietà personalizzate\n",{"type":32,"tag":93,"props":397,"children":399},{"class":95,"line":398},15,[400],{"type":32,"tag":93,"props":401,"children":402},{"style":110},[403],{"type":37,"value":404},"    }));\n",{"type":32,"tag":93,"props":406,"children":408},{"class":95,"line":407},16,[409],{"type":32,"tag":93,"props":410,"children":411},{"style":110},[412],{"type":37,"value":413},"  }\n",{"type":32,"tag":93,"props":415,"children":417},{"class":95,"line":416},17,[418],{"type":32,"tag":93,"props":419,"children":420},{"style":110},[421],{"type":37,"value":231},{"type":32,"tag":93,"props":423,"children":425},{"class":95,"line":424},18,[426,431,435,440],{"type":32,"tag":93,"props":427,"children":428},{"style":175},[429],{"type":37,"value":430},"  sendEvent",{"type":32,"tag":93,"props":432,"children":433},{"style":110},[434],{"type":37,"value":113},{"type":32,"tag":93,"props":436,"children":437},{"style":147},[438],{"type":37,"value":439},"'pageview'",{"type":32,"tag":93,"props":441,"children":442},{"style":110},[443],{"type":37,"value":222},{"type":32,"tag":93,"props":445,"children":447},{"class":95,"line":446},19,[448],{"type":32,"tag":93,"props":449,"children":450},{"style":110},[451],{"type":37,"value":231},{"type":32,"tag":93,"props":453,"children":455},{"class":95,"line":454},20,[456],{"type":32,"tag":93,"props":457,"children":458},{"style":100},[459],{"type":37,"value":460},"  \u002F\u002F tracciamento dei clic\n",{"type":32,"tag":93,"props":462,"children":464},{"class":95,"line":463},21,[465,470,475,479,484,489,494,499,504],{"type":32,"tag":93,"props":466,"children":467},{"style":110},[468],{"type":37,"value":469},"  document.",{"type":32,"tag":93,"props":471,"children":472},{"style":175},[473],{"type":37,"value":474},"addEventListener",{"type":32,"tag":93,"props":476,"children":477},{"style":110},[478],{"type":37,"value":113},{"type":32,"tag":93,"props":480,"children":481},{"style":147},[482],{"type":37,"value":483},"'click'",{"type":32,"tag":93,"props":485,"children":486},{"style":110},[487],{"type":37,"value":488},", (",{"type":32,"tag":93,"props":490,"children":491},{"style":252},[492],{"type":37,"value":493},"e",{"type":32,"tag":93,"props":495,"children":496},{"style":110},[497],{"type":37,"value":498},") ",{"type":32,"tag":93,"props":500,"children":501},{"style":116},[502],{"type":37,"value":503},"=>",{"type":32,"tag":93,"props":505,"children":506},{"style":110},[507],{"type":37,"value":508}," {\n",{"type":32,"tag":93,"props":510,"children":512},{"class":95,"line":511},22,[513,518,523,528,532,537],{"type":32,"tag":93,"props":514,"children":515},{"style":116},[516],{"type":37,"value":517},"    if",{"type":32,"tag":93,"props":519,"children":520},{"style":110},[521],{"type":37,"value":522}," (e.target.",{"type":32,"tag":93,"props":524,"children":525},{"style":175},[526],{"type":37,"value":527},"matches",{"type":32,"tag":93,"props":529,"children":530},{"style":110},[531],{"type":37,"value":113},{"type":32,"tag":93,"props":533,"children":534},{"style":147},[535],{"type":37,"value":536},"'[data-track]'",{"type":32,"tag":93,"props":538,"children":539},{"style":110},[540],{"type":37,"value":541},")) {\n",{"type":32,"tag":93,"props":543,"children":545},{"class":95,"line":544},23,[546,551,555,559],{"type":32,"tag":93,"props":547,"children":548},{"style":175},[549],{"type":37,"value":550},"      sendEvent",{"type":32,"tag":93,"props":552,"children":553},{"style":110},[554],{"type":37,"value":113},{"type":32,"tag":93,"props":556,"children":557},{"style":147},[558],{"type":37,"value":483},{"type":32,"tag":93,"props":560,"children":561},{"style":110},[562],{"type":37,"value":563},", { element: e.target.dataset.track });\n",{"type":32,"tag":93,"props":565,"children":567},{"class":95,"line":566},24,[568],{"type":32,"tag":93,"props":569,"children":570},{"style":110},[571],{"type":37,"value":572},"    }\n",{"type":32,"tag":93,"props":574,"children":576},{"class":95,"line":575},25,[577],{"type":32,"tag":93,"props":578,"children":579},{"style":110},[580],{"type":37,"value":581},"  });\n",{"type":32,"tag":93,"props":583,"children":585},{"class":95,"line":584},26,[586],{"type":32,"tag":93,"props":587,"children":588},{"style":110},[589],{"type":37,"value":590},"})();\n",{"type":32,"tag":33,"props":592,"children":593},{},[594,596,602,604,610],{"type":37,"value":595},"L'API ",{"type":32,"tag":89,"props":597,"children":599},{"className":598},[],[600],{"type":37,"value":601},"navigator.sendBeacon",{"type":37,"value":603}," invia una POST HTTP senza inviare cookie. ",{"type":32,"tag":89,"props":605,"children":607},{"className":606},[],[608],{"type":37,"value":609},"sessionHash",{"type":37,"value":611}," viene generato lato client e non viene memorizzato in modo persistente (scompare quando la scheda si chiude). Questo hash viene utilizzato per collegare le visualizzazioni di pagina all'interno della stessa sessione, ma non identifica lo stesso utente in giorni diversi.",{"type":32,"tag":33,"props":613,"children":614},{},[615,620],{"type":32,"tag":76,"props":616,"children":617},{},[618],{"type":37,"value":619},"Lato server (scritto in Elixir\u002FPhoenix):",{"type":37,"value":621},"\nL'evento in arrivo viene scritto in ClickHouse (database time-series). Nell'installazione self-hosted di Plausible, ClickHouse è predefinito; nella versione cloud utilizza ClickHouse gestito. Lo schema della tabella è:",{"type":32,"tag":82,"props":623,"children":627},{"className":624,"code":625,"language":626,"meta":16,"style":16},"language-sql shiki shiki-themes github-dark","CREATE TABLE events (\n  timestamp DateTime,\n  domain String,\n  pathname String,\n  referrer String,\n  session_hash String,\n  event_name String,\n  props Map(String, String),\n  user_agent String,\n  country String,\n  device_type Enum8('desktop'=1, 'mobile'=2, 'tablet'=3)\n) ENGINE = MergeTree()\nPARTITION BY toYYYYMM(timestamp)\nORDER BY (domain, toDate(timestamp), session_hash);\n","sql",[628],{"type":32,"tag":89,"props":629,"children":630},{"__ignoreMap":16},[631,654,672,680,688,696,704,712,720,728,736,800,817,844],{"type":32,"tag":93,"props":632,"children":633},{"class":95,"line":96},[634,639,644,649],{"type":32,"tag":93,"props":635,"children":636},{"style":116},[637],{"type":37,"value":638},"CREATE",{"type":32,"tag":93,"props":640,"children":641},{"style":116},[642],{"type":37,"value":643}," TABLE",{"type":32,"tag":93,"props":645,"children":646},{"style":175},[647],{"type":37,"value":648}," events",{"type":32,"tag":93,"props":650,"children":651},{"style":110},[652],{"type":37,"value":653}," (\n",{"type":32,"tag":93,"props":655,"children":656},{"class":95,"line":106},[657,662,667],{"type":32,"tag":93,"props":658,"children":659},{"style":116},[660],{"type":37,"value":661},"  timestamp",{"type":32,"tag":93,"props":663,"children":664},{"style":116},[665],{"type":37,"value":666}," DateTime",{"type":32,"tag":93,"props":668,"children":669},{"style":110},[670],{"type":37,"value":671},",\n",{"type":32,"tag":93,"props":673,"children":674},{"class":95,"line":127},[675],{"type":32,"tag":93,"props":676,"children":677},{"style":110},[678],{"type":37,"value":679},"  domain String,\n",{"type":32,"tag":93,"props":681,"children":682},{"class":95,"line":158},[683],{"type":32,"tag":93,"props":684,"children":685},{"style":110},[686],{"type":37,"value":687},"  pathname String,\n",{"type":32,"tag":93,"props":689,"children":690},{"class":95,"line":225},[691],{"type":32,"tag":93,"props":692,"children":693},{"style":110},[694],{"type":37,"value":695},"  referrer String,\n",{"type":32,"tag":93,"props":697,"children":698},{"class":95,"line":234},[699],{"type":32,"tag":93,"props":700,"children":701},{"style":110},[702],{"type":37,"value":703},"  session_hash String,\n",{"type":32,"tag":93,"props":705,"children":706},{"class":95,"line":277},[707],{"type":32,"tag":93,"props":708,"children":709},{"style":110},[710],{"type":37,"value":711},"  event_name String,\n",{"type":32,"tag":93,"props":713,"children":714},{"class":95,"line":316},[715],{"type":32,"tag":93,"props":716,"children":717},{"style":110},[718],{"type":37,"value":719},"  props Map(String, String),\n",{"type":32,"tag":93,"props":721,"children":722},{"class":95,"line":26},[723],{"type":32,"tag":93,"props":724,"children":725},{"style":110},[726],{"type":37,"value":727},"  user_agent String,\n",{"type":32,"tag":93,"props":729,"children":730},{"class":95,"line":343},[731],{"type":32,"tag":93,"props":732,"children":733},{"style":110},[734],{"type":37,"value":735},"  country String,\n",{"type":32,"tag":93,"props":737,"children":738},{"class":95,"line":352},[739,744,749,754,759,763,768,772,777,781,786,790,795],{"type":32,"tag":93,"props":740,"children":741},{"style":110},[742],{"type":37,"value":743},"  device_type Enum8(",{"type":32,"tag":93,"props":745,"children":746},{"style":147},[747],{"type":37,"value":748},"'desktop'",{"type":32,"tag":93,"props":750,"children":751},{"style":116},[752],{"type":37,"value":753},"=",{"type":32,"tag":93,"props":755,"children":756},{"style":136},[757],{"type":37,"value":758},"1",{"type":32,"tag":93,"props":760,"children":761},{"style":110},[762],{"type":37,"value":260},{"type":32,"tag":93,"props":764,"children":765},{"style":147},[766],{"type":37,"value":767},"'mobile'",{"type":32,"tag":93,"props":769,"children":770},{"style":116},[771],{"type":37,"value":753},{"type":32,"tag":93,"props":773,"children":774},{"style":136},[775],{"type":37,"value":776},"2",{"type":32,"tag":93,"props":778,"children":779},{"style":110},[780],{"type":37,"value":260},{"type":32,"tag":93,"props":782,"children":783},{"style":147},[784],{"type":37,"value":785},"'tablet'",{"type":32,"tag":93,"props":787,"children":788},{"style":116},[789],{"type":37,"value":753},{"type":32,"tag":93,"props":791,"children":792},{"style":136},[793],{"type":37,"value":794},"3",{"type":32,"tag":93,"props":796,"children":797},{"style":110},[798],{"type":37,"value":799},")\n",{"type":32,"tag":93,"props":801,"children":802},{"class":95,"line":361},[803,808,812],{"type":32,"tag":93,"props":804,"children":805},{"style":110},[806],{"type":37,"value":807},") ENGINE ",{"type":32,"tag":93,"props":809,"children":810},{"style":116},[811],{"type":37,"value":753},{"type":32,"tag":93,"props":813,"children":814},{"style":110},[815],{"type":37,"value":816}," MergeTree()\n",{"type":32,"tag":93,"props":818,"children":819},{"class":95,"line":370},[820,825,830,835,840],{"type":32,"tag":93,"props":821,"children":822},{"style":116},[823],{"type":37,"value":824},"PARTITION",{"type":32,"tag":93,"props":826,"children":827},{"style":116},[828],{"type":37,"value":829}," BY",{"type":32,"tag":93,"props":831,"children":832},{"style":110},[833],{"type":37,"value":834}," toYYYYMM(",{"type":32,"tag":93,"props":836,"children":837},{"style":116},[838],{"type":37,"value":839},"timestamp",{"type":32,"tag":93,"props":841,"children":842},{"style":110},[843],{"type":37,"value":799},{"type":32,"tag":93,"props":845,"children":846},{"class":95,"line":384},[847,852,857,861],{"type":32,"tag":93,"props":848,"children":849},{"style":116},[850],{"type":37,"value":851},"ORDER BY",{"type":32,"tag":93,"props":853,"children":854},{"style":110},[855],{"type":37,"value":856}," (domain, toDate(",{"type":32,"tag":93,"props":858,"children":859},{"style":116},[860],{"type":37,"value":839},{"type":32,"tag":93,"props":862,"children":863},{"style":110},[864],{"type":37,"value":865},"), session_hash);\n",{"type":32,"tag":33,"props":867,"children":868},{},[869],{"type":37,"value":870},"Le query di aggregazione nel motore MergeTree di ClickHouse sono molto veloci: in una tabella con 100M eventi, una query \"sessioni univoche per giorno\" ritorna in 200-400 ms.",{"type":32,"tag":40,"props":872,"children":874},{"id":873},"aggregazione-lato-server-session-cohort-retention",[875],{"type":37,"value":876},"Aggregazione Lato Server: Session → Cohort → Retention",{"type":32,"tag":33,"props":878,"children":879},{},[880,882,887],{"type":37,"value":881},"La dashboard di Plausible mostra \"sessioni univoche\" anziché \"visitatori univoci\". Ma nell'analisi di marketing una sessione non basta — per la retention basata su coorte, la proiezione di LTV, l'attribuzione di campagna, è necessario un identificativo utente. Il modo di farlo senza cookie è: ",{"type":32,"tag":76,"props":883,"children":884},{},[885],{"type":37,"value":886},"server-side identity resolution + livello di aggregazione",{"type":37,"value":303},{"type":32,"tag":33,"props":889,"children":890},{},[891,893,899],{"type":37,"value":892},"Scenario: un sito di e-commerce raccoglie event con Plausible e li esporta in BigQuery. Quando un utente effettua il login, ",{"type":32,"tag":89,"props":894,"children":896},{"className":895},[],[897],{"type":37,"value":898},"user_id",{"type":37,"value":900}," viene inviato come proprietà personalizzata:",{"type":32,"tag":82,"props":902,"children":904},{"className":84,"code":903,"language":86,"meta":16,"style":16},"\u002F\u002F Sulla pagina di checkout, dopo il login\nplausible('Login', { props: { user_id: '{{user.id}}' } });\n",[905],{"type":32,"tag":89,"props":906,"children":907},{"__ignoreMap":16},[908,916],{"type":32,"tag":93,"props":909,"children":910},{"class":95,"line":96},[911],{"type":32,"tag":93,"props":912,"children":913},{"style":100},[914],{"type":37,"value":915},"\u002F\u002F Sulla pagina di checkout, dopo il login\n",{"type":32,"tag":93,"props":917,"children":918},{"class":95,"line":106},[919,923,927,932,937,942],{"type":32,"tag":93,"props":920,"children":921},{"style":175},[922],{"type":37,"value":22},{"type":32,"tag":93,"props":924,"children":925},{"style":110},[926],{"type":37,"value":113},{"type":32,"tag":93,"props":928,"children":929},{"style":147},[930],{"type":37,"value":931},"'Login'",{"type":32,"tag":93,"props":933,"children":934},{"style":110},[935],{"type":37,"value":936},", { props: { user_id: ",{"type":32,"tag":93,"props":938,"children":939},{"style":147},[940],{"type":37,"value":941},"'{{user.id}}'",{"type":32,"tag":93,"props":943,"children":944},{"style":110},[945],{"type":37,"value":946}," } });\n",{"type":32,"tag":33,"props":948,"children":949},{},[950,952,957],{"type":37,"value":951},"In BigQuery, un job batch giornaliero unisce gli event di Plausible con ",{"type":32,"tag":89,"props":953,"children":955},{"className":954},[],[956],{"type":37,"value":898},{"type":37,"value":958},":",{"type":32,"tag":82,"props":960,"children":962},{"className":624,"code":961,"language":626,"meta":16,"style":16},"-- modello dbt: user_sessions_daily.sql\nWITH raw_events AS (\n  SELECT\n    timestamp,\n    session_hash,\n    JSON_EXTRACT_SCALAR(props, '$.user_id') AS user_id,\n    pathname,\n    event_name\n  FROM `analytics.plausible_events`\n  WHERE DATE(timestamp) = CURRENT_DATE - 1\n),\nidentified_sessions AS (\n  SELECT\n    session_hash,\n    FIRST_VALUE(user_id IGNORE NULLS) OVER (\n      PARTITION BY session_hash ORDER BY timestamp\n    ) AS resolved_user_id\n  FROM raw_events\n)\nSELECT\n  e.timestamp,\n  e.session_hash,\n  COALESCE(i.resolved_user_id, e.session_hash) AS user_key,\n  e.pathname,\n  e.event_name\nFROM raw_events e\nLEFT JOIN identified_sessions i USING (session_hash);\n",[963],{"type":32,"tag":89,"props":964,"children":965},{"__ignoreMap":16},[966,974,996,1004,1016,1024,1050,1058,1066,1079,1123,1131,1147,1154,1161,1197,1223,1240,1252,1259,1267,1287,1307,1362,1382,1398,1411],{"type":32,"tag":93,"props":967,"children":968},{"class":95,"line":96},[969],{"type":32,"tag":93,"props":970,"children":971},{"style":100},[972],{"type":37,"value":973},"-- modello dbt: user_sessions_daily.sql\n",{"type":32,"tag":93,"props":975,"children":976},{"class":95,"line":106},[977,982,987,992],{"type":32,"tag":93,"props":978,"children":979},{"style":116},[980],{"type":37,"value":981},"WITH",{"type":32,"tag":93,"props":983,"children":984},{"style":110},[985],{"type":37,"value":986}," raw_events ",{"type":32,"tag":93,"props":988,"children":989},{"style":116},[990],{"type":37,"value":991},"AS",{"type":32,"tag":93,"props":993,"children":994},{"style":110},[995],{"type":37,"value":653},{"type":32,"tag":93,"props":997,"children":998},{"class":95,"line":127},[999],{"type":32,"tag":93,"props":1000,"children":1001},{"style":116},[1002],{"type":37,"value":1003},"  SELECT\n",{"type":32,"tag":93,"props":1005,"children":1006},{"class":95,"line":158},[1007,1012],{"type":32,"tag":93,"props":1008,"children":1009},{"style":116},[1010],{"type":37,"value":1011},"    timestamp",{"type":32,"tag":93,"props":1013,"children":1014},{"style":110},[1015],{"type":37,"value":671},{"type":32,"tag":93,"props":1017,"children":1018},{"class":95,"line":225},[1019],{"type":32,"tag":93,"props":1020,"children":1021},{"style":110},[1022],{"type":37,"value":1023},"    session_hash,\n",{"type":32,"tag":93,"props":1025,"children":1026},{"class":95,"line":234},[1027,1032,1037,1041,1045],{"type":32,"tag":93,"props":1028,"children":1029},{"style":110},[1030],{"type":37,"value":1031},"    JSON_EXTRACT_SCALAR(props, ",{"type":32,"tag":93,"props":1033,"children":1034},{"style":147},[1035],{"type":37,"value":1036},"'$.user_id'",{"type":32,"tag":93,"props":1038,"children":1039},{"style":110},[1040],{"type":37,"value":498},{"type":32,"tag":93,"props":1042,"children":1043},{"style":116},[1044],{"type":37,"value":991},{"type":32,"tag":93,"props":1046,"children":1047},{"style":110},[1048],{"type":37,"value":1049}," user_id,\n",{"type":32,"tag":93,"props":1051,"children":1052},{"class":95,"line":277},[1053],{"type":32,"tag":93,"props":1054,"children":1055},{"style":110},[1056],{"type":37,"value":1057},"    pathname,\n",{"type":32,"tag":93,"props":1059,"children":1060},{"class":95,"line":316},[1061],{"type":32,"tag":93,"props":1062,"children":1063},{"style":110},[1064],{"type":37,"value":1065},"    event_name\n",{"type":32,"tag":93,"props":1067,"children":1068},{"class":95,"line":26},[1069,1074],{"type":32,"tag":93,"props":1070,"children":1071},{"style":116},[1072],{"type":37,"value":1073},"  FROM",{"type":32,"tag":93,"props":1075,"children":1076},{"style":147},[1077],{"type":37,"value":1078}," `analytics.plausible_events`\n",{"type":32,"tag":93,"props":1080,"children":1081},{"class":95,"line":343},[1082,1087,1092,1096,1100,1104,1108,1113,1118],{"type":32,"tag":93,"props":1083,"children":1084},{"style":116},[1085],{"type":37,"value":1086},"  WHERE",{"type":32,"tag":93,"props":1088,"children":1089},{"style":116},[1090],{"type":37,"value":1091}," DATE",{"type":32,"tag":93,"props":1093,"children":1094},{"style":110},[1095],{"type":37,"value":113},{"type":32,"tag":93,"props":1097,"children":1098},{"style":116},[1099],{"type":37,"value":839},{"type":32,"tag":93,"props":1101,"children":1102},{"style":110},[1103],{"type":37,"value":498},{"type":32,"tag":93,"props":1105,"children":1106},{"style":116},[1107],{"type":37,"value":753},{"type":32,"tag":93,"props":1109,"children":1110},{"style":110},[1111],{"type":37,"value":1112}," CURRENT_DATE ",{"type":32,"tag":93,"props":1114,"children":1115},{"style":116},[1116],{"type":37,"value":1117},"-",{"type":32,"tag":93,"props":1119,"children":1120},{"style":136},[1121],{"type":37,"value":1122}," 1\n",{"type":32,"tag":93,"props":1124,"children":1125},{"class":95,"line":352},[1126],{"type":32,"tag":93,"props":1127,"children":1128},{"style":110},[1129],{"type":37,"value":1130},"),\n",{"type":32,"tag":93,"props":1132,"children":1133},{"class":95,"line":361},[1134,1139,1143],{"type":32,"tag":93,"props":1135,"children":1136},{"style":110},[1137],{"type":37,"value":1138},"identified_sessions ",{"type":32,"tag":93,"props":1140,"children":1141},{"style":116},[1142],{"type":37,"value":991},{"type":32,"tag":93,"props":1144,"children":1145},{"style":110},[1146],{"type":37,"value":653},{"type":32,"tag":93,"props":1148,"children":1149},{"class":95,"line":370},[1150],{"type":32,"tag":93,"props":1151,"children":1152},{"style":116},[1153],{"type":37,"value":1003},{"type":32,"tag":93,"props":1155,"children":1156},{"class":95,"line":384},[1157],{"type":32,"tag":93,"props":1158,"children":1159},{"style":110},[1160],{"type":37,"value":1023},{"type":32,"tag":93,"props":1162,"children":1163},{"class":95,"line":398},[1164,1169,1174,1179,1184,1188,1193],{"type":32,"tag":93,"props":1165,"children":1166},{"style":136},[1167],{"type":37,"value":1168},"    FIRST_VALUE",{"type":32,"tag":93,"props":1170,"children":1171},{"style":110},[1172],{"type":37,"value":1173},"(user_id ",{"type":32,"tag":93,"props":1175,"children":1176},{"style":116},[1177],{"type":37,"value":1178},"IGNORE",{"type":32,"tag":93,"props":1180,"children":1181},{"style":116},[1182],{"type":37,"value":1183}," NULLS",{"type":32,"tag":93,"props":1185,"children":1186},{"style":110},[1187],{"type":37,"value":498},{"type":32,"tag":93,"props":1189,"children":1190},{"style":116},[1191],{"type":37,"value":1192},"OVER",{"type":32,"tag":93,"props":1194,"children":1195},{"style":110},[1196],{"type":37,"value":653},{"type":32,"tag":93,"props":1198,"children":1199},{"class":95,"line":407},[1200,1205,1209,1214,1218],{"type":32,"tag":93,"props":1201,"children":1202},{"style":116},[1203],{"type":37,"value":1204},"      PARTITION",{"type":32,"tag":93,"props":1206,"children":1207},{"style":116},[1208],{"type":37,"value":829},{"type":32,"tag":93,"props":1210,"children":1211},{"style":110},[1212],{"type":37,"value":1213}," session_hash ",{"type":32,"tag":93,"props":1215,"children":1216},{"style":116},[1217],{"type":37,"value":851},{"type":32,"tag":93,"props":1219,"children":1220},{"style":116},[1221],{"type":37,"value":1222}," timestamp\n",{"type":32,"tag":93,"props":1224,"children":1225},{"class":95,"line":416},[1226,1231,1235],{"type":32,"tag":93,"props":1227,"children":1228},{"style":110},[1229],{"type":37,"value":1230},"    ) ",{"type":32,"tag":93,"props":1232,"children":1233},{"style":116},[1234],{"type":37,"value":991},{"type":32,"tag":93,"props":1236,"children":1237},{"style":110},[1238],{"type":37,"value":1239}," resolved_user_id\n",{"type":32,"tag":93,"props":1241,"children":1242},{"class":95,"line":424},[1243,1247],{"type":32,"tag":93,"props":1244,"children":1245},{"style":116},[1246],{"type":37,"value":1073},{"type":32,"tag":93,"props":1248,"children":1249},{"style":110},[1250],{"type":37,"value":1251}," raw_events\n",{"type":32,"tag":93,"props":1253,"children":1254},{"class":95,"line":446},[1255],{"type":32,"tag":93,"props":1256,"children":1257},{"style":110},[1258],{"type":37,"value":799},{"type":32,"tag":93,"props":1260,"children":1261},{"class":95,"line":454},[1262],{"type":32,"tag":93,"props":1263,"children":1264},{"style":116},[1265],{"type":37,"value":1266},"SELECT\n",{"type":32,"tag":93,"props":1268,"children":1269},{"class":95,"line":463},[1270,1275,1279,1283],{"type":32,"tag":93,"props":1271,"children":1272},{"style":136},[1273],{"type":37,"value":1274},"  e",{"type":32,"tag":93,"props":1276,"children":1277},{"style":110},[1278],{"type":37,"value":303},{"type":32,"tag":93,"props":1280,"children":1281},{"style":136},[1282],{"type":37,"value":839},{"type":32,"tag":93,"props":1284,"children":1285},{"style":110},[1286],{"type":37,"value":671},{"type":32,"tag":93,"props":1288,"children":1289},{"class":95,"line":511},[1290,1294,1298,1303],{"type":32,"tag":93,"props":1291,"children":1292},{"style":136},[1293],{"type":37,"value":1274},{"type":32,"tag":93,"props":1295,"children":1296},{"style":110},[1297],{"type":37,"value":303},{"type":32,"tag":93,"props":1299,"children":1300},{"style":136},[1301],{"type":37,"value":1302},"session_hash",{"type":32,"tag":93,"props":1304,"children":1305},{"style":110},[1306],{"type":37,"value":671},{"type":32,"tag":93,"props":1308,"children":1309},{"class":95,"line":544},[1310,1315,1319,1324,1328,1333,1337,1341,1345,1349,1353,1357],{"type":32,"tag":93,"props":1311,"children":1312},{"style":136},[1313],{"type":37,"value":1314},"  COALESCE",{"type":32,"tag":93,"props":1316,"children":1317},{"style":110},[1318],{"type":37,"value":113},{"type":32,"tag":93,"props":1320,"children":1321},{"style":136},[1322],{"type":37,"value":1323},"i",{"type":32,"tag":93,"props":1325,"children":1326},{"style":110},[1327],{"type":37,"value":303},{"type":32,"tag":93,"props":1329,"children":1330},{"style":136},[1331],{"type":37,"value":1332},"resolved_user_id",{"type":32,"tag":93,"props":1334,"children":1335},{"style":110},[1336],{"type":37,"value":260},{"type":32,"tag":93,"props":1338,"children":1339},{"style":136},[1340],{"type":37,"value":493},{"type":32,"tag":93,"props":1342,"children":1343},{"style":110},[1344],{"type":37,"value":303},{"type":32,"tag":93,"props":1346,"children":1347},{"style":136},[1348],{"type":37,"value":1302},{"type":32,"tag":93,"props":1350,"children":1351},{"style":110},[1352],{"type":37,"value":498},{"type":32,"tag":93,"props":1354,"children":1355},{"style":116},[1356],{"type":37,"value":991},{"type":32,"tag":93,"props":1358,"children":1359},{"style":110},[1360],{"type":37,"value":1361}," user_key,\n",{"type":32,"tag":93,"props":1363,"children":1364},{"class":95,"line":566},[1365,1369,1373,1378],{"type":32,"tag":93,"props":1366,"children":1367},{"style":136},[1368],{"type":37,"value":1274},{"type":32,"tag":93,"props":1370,"children":1371},{"style":110},[1372],{"type":37,"value":303},{"type":32,"tag":93,"props":1374,"children":1375},{"style":136},[1376],{"type":37,"value":1377},"pathname",{"type":32,"tag":93,"props":1379,"children":1380},{"style":110},[1381],{"type":37,"value":671},{"type":32,"tag":93,"props":1383,"children":1384},{"class":95,"line":575},[1385,1389,1393],{"type":32,"tag":93,"props":1386,"children":1387},{"style":136},[1388],{"type":37,"value":1274},{"type":32,"tag":93,"props":1390,"children":1391},{"style":110},[1392],{"type":37,"value":303},{"type":32,"tag":93,"props":1394,"children":1395},{"style":136},[1396],{"type":37,"value":1397},"event_name\n",{"type":32,"tag":93,"props":1399,"children":1400},{"class":95,"line":584},[1401,1406],{"type":32,"tag":93,"props":1402,"children":1403},{"style":116},[1404],{"type":37,"value":1405},"FROM",{"type":32,"tag":93,"props":1407,"children":1408},{"style":110},[1409],{"type":37,"value":1410}," raw_events e\n",{"type":32,"tag":93,"props":1412,"children":1414},{"class":95,"line":1413},27,[1415,1420,1425,1430],{"type":32,"tag":93,"props":1416,"children":1417},{"style":116},[1418],{"type":37,"value":1419},"LEFT JOIN",{"type":32,"tag":93,"props":1421,"children":1422},{"style":110},[1423],{"type":37,"value":1424}," identified_sessions i ",{"type":32,"tag":93,"props":1426,"children":1427},{"style":116},[1428],{"type":37,"value":1429},"USING",{"type":32,"tag":93,"props":1431,"children":1432},{"style":110},[1433],{"type":37,"value":1434}," (session_hash);\n",{"type":32,"tag":33,"props":1436,"children":1437},{},[1438,1440,1446,1448,1453,1455,1460,1462,1467],{"type":37,"value":1439},"In questo modello ",{"type":32,"tag":89,"props":1441,"children":1443},{"className":1442},[],[1444],{"type":37,"value":1445},"user_key",{"type":37,"value":1447}," è ",{"type":32,"tag":89,"props":1449,"children":1451},{"className":1450},[],[1452],{"type":37,"value":898},{"type":37,"value":1454}," per gli utenti autenticati e ",{"type":32,"tag":89,"props":1456,"children":1458},{"className":1457},[],[1459],{"type":37,"value":1302},{"type":37,"value":1461}," per le sessioni anonime. La misurazione di retention può ora essere calcolata su ",{"type":32,"tag":89,"props":1463,"children":1465},{"className":1464},[],[1466],{"type":37,"value":1445},{"type":37,"value":958},{"type":32,"tag":82,"props":1469,"children":1471},{"className":624,"code":1470,"language":626,"meta":16,"style":16},"-- coorte di retention a 7 giorni\nSELECT\n  DATE_TRUNC(first_seen, WEEK) AS cohort_week,\n  COUNT(DISTINCT user_key) AS cohort_size,\n  COUNT(DISTINCT CASE WHEN day_7_active THEN user_key END) AS retained_d7,\n  SAFE_DIVIDE(\n    COUNT(DISTINCT CASE WHEN day_7_active THEN user_key END),\n    COUNT(DISTINCT user_key)\n  ) AS retention_rate\nFROM user_retention_facts\nGROUP BY 1;\n",[1472],{"type":32,"tag":89,"props":1473,"children":1474},{"__ignoreMap":16},[1475,1483,1490,1516,1547,1605,1613,1657,1677,1694,1706],{"type":32,"tag":93,"props":1476,"children":1477},{"class":95,"line":96},[1478],{"type":32,"tag":93,"props":1479,"children":1480},{"style":100},[1481],{"type":37,"value":1482},"-- coorte di retention a 7 giorni\n",{"type":32,"tag":93,"props":1484,"children":1485},{"class":95,"line":106},[1486],{"type":32,"tag":93,"props":1487,"children":1488},{"style":116},[1489],{"type":37,"value":1266},{"type":32,"tag":93,"props":1491,"children":1492},{"class":95,"line":127},[1493,1498,1503,1507,1511],{"type":32,"tag":93,"props":1494,"children":1495},{"style":110},[1496],{"type":37,"value":1497},"  DATE_TRUNC(first_seen, ",{"type":32,"tag":93,"props":1499,"children":1500},{"style":116},[1501],{"type":37,"value":1502},"WEEK",{"type":32,"tag":93,"props":1504,"children":1505},{"style":110},[1506],{"type":37,"value":498},{"type":32,"tag":93,"props":1508,"children":1509},{"style":116},[1510],{"type":37,"value":991},{"type":32,"tag":93,"props":1512,"children":1513},{"style":110},[1514],{"type":37,"value":1515}," cohort_week,\n",{"type":32,"tag":93,"props":1517,"children":1518},{"class":95,"line":158},[1519,1524,1528,1533,1538,1542],{"type":32,"tag":93,"props":1520,"children":1521},{"style":136},[1522],{"type":37,"value":1523},"  COUNT",{"type":32,"tag":93,"props":1525,"children":1526},{"style":110},[1527],{"type":37,"value":113},{"type":32,"tag":93,"props":1529,"children":1530},{"style":116},[1531],{"type":37,"value":1532},"DISTINCT",{"type":32,"tag":93,"props":1534,"children":1535},{"style":110},[1536],{"type":37,"value":1537}," user_key) ",{"type":32,"tag":93,"props":1539,"children":1540},{"style":116},[1541],{"type":37,"value":991},{"type":32,"tag":93,"props":1543,"children":1544},{"style":110},[1545],{"type":37,"value":1546}," cohort_size,\n",{"type":32,"tag":93,"props":1548,"children":1549},{"class":95,"line":225},[1550,1554,1558,1562,1567,1572,1577,1582,1587,1592,1596,1600],{"type":32,"tag":93,"props":1551,"children":1552},{"style":136},[1553],{"type":37,"value":1523},{"type":32,"tag":93,"props":1555,"children":1556},{"style":110},[1557],{"type":37,"value":113},{"type":32,"tag":93,"props":1559,"children":1560},{"style":116},[1561],{"type":37,"value":1532},{"type":32,"tag":93,"props":1563,"children":1564},{"style":116},[1565],{"type":37,"value":1566}," CASE",{"type":32,"tag":93,"props":1568,"children":1569},{"style":116},[1570],{"type":37,"value":1571}," WHEN",{"type":32,"tag":93,"props":1573,"children":1574},{"style":110},[1575],{"type":37,"value":1576}," day_7_active ",{"type":32,"tag":93,"props":1578,"children":1579},{"style":116},[1580],{"type":37,"value":1581},"THEN",{"type":32,"tag":93,"props":1583,"children":1584},{"style":110},[1585],{"type":37,"value":1586}," user_key ",{"type":32,"tag":93,"props":1588,"children":1589},{"style":116},[1590],{"type":37,"value":1591},"END",{"type":32,"tag":93,"props":1593,"children":1594},{"style":110},[1595],{"type":37,"value":498},{"type":32,"tag":93,"props":1597,"children":1598},{"style":116},[1599],{"type":37,"value":991},{"type":32,"tag":93,"props":1601,"children":1602},{"style":110},[1603],{"type":37,"value":1604}," retained_d7,\n",{"type":32,"tag":93,"props":1606,"children":1607},{"class":95,"line":234},[1608],{"type":32,"tag":93,"props":1609,"children":1610},{"style":110},[1611],{"type":37,"value":1612},"  SAFE_DIVIDE(\n",{"type":32,"tag":93,"props":1614,"children":1615},{"class":95,"line":277},[1616,1621,1625,1629,1633,1637,1641,1645,1649,1653],{"type":32,"tag":93,"props":1617,"children":1618},{"style":136},[1619],{"type":37,"value":1620},"    COUNT",{"type":32,"tag":93,"props":1622,"children":1623},{"style":110},[1624],{"type":37,"value":113},{"type":32,"tag":93,"props":1626,"children":1627},{"style":116},[1628],{"type":37,"value":1532},{"type":32,"tag":93,"props":1630,"children":1631},{"style":116},[1632],{"type":37,"value":1566},{"type":32,"tag":93,"props":1634,"children":1635},{"style":116},[1636],{"type":37,"value":1571},{"type":32,"tag":93,"props":1638,"children":1639},{"style":110},[1640],{"type":37,"value":1576},{"type":32,"tag":93,"props":1642,"children":1643},{"style":116},[1644],{"type":37,"value":1581},{"type":32,"tag":93,"props":1646,"children":1647},{"style":110},[1648],{"type":37,"value":1586},{"type":32,"tag":93,"props":1650,"children":1651},{"style":116},[1652],{"type":37,"value":1591},{"type":32,"tag":93,"props":1654,"children":1655},{"style":110},[1656],{"type":37,"value":1130},{"type":32,"tag":93,"props":1658,"children":1659},{"class":95,"line":316},[1660,1664,1668,1672],{"type":32,"tag":93,"props":1661,"children":1662},{"style":136},[1663],{"type":37,"value":1620},{"type":32,"tag":93,"props":1665,"children":1666},{"style":110},[1667],{"type":37,"value":113},{"type":32,"tag":93,"props":1669,"children":1670},{"style":116},[1671],{"type":37,"value":1532},{"type":32,"tag":93,"props":1673,"children":1674},{"style":110},[1675],{"type":37,"value":1676}," user_key)\n",{"type":32,"tag":93,"props":1678,"children":1679},{"class":95,"line":26},[1680,1685,1689],{"type":32,"tag":93,"props":1681,"children":1682},{"style":110},[1683],{"type":37,"value":1684},"  ) ",{"type":32,"tag":93,"props":1686,"children":1687},{"style":116},[1688],{"type":37,"value":991},{"type":32,"tag":93,"props":1690,"children":1691},{"style":110},[1692],{"type":37,"value":1693}," retention_rate\n",{"type":32,"tag":93,"props":1695,"children":1696},{"class":95,"line":343},[1697,1701],{"type":32,"tag":93,"props":1698,"children":1699},{"style":116},[1700],{"type":37,"value":1405},{"type":32,"tag":93,"props":1702,"children":1703},{"style":110},[1704],{"type":37,"value":1705}," user_retention_facts\n",{"type":32,"tag":93,"props":1707,"children":1708},{"class":95,"line":352},[1709,1714,1719],{"type":32,"tag":93,"props":1710,"children":1711},{"style":116},[1712],{"type":37,"value":1713},"GROUP BY",{"type":32,"tag":93,"props":1715,"children":1716},{"style":136},[1717],{"type":37,"value":1718}," 1",{"type":32,"tag":93,"props":1720,"children":1721},{"style":110},[1722],{"type":37,"value":155},{"type":32,"tag":33,"props":1724,"children":1725},{},[1726],{"type":37,"value":1727},"Le sessioni anonime vengono incluse in questa analisi di coorte, ma vengono escluse dal calcolo del LTV a lungo termine perché non possiamo tracciare lo stesso utente in giorni diversi. In un sito dove il tasso di login è del 30%, siamo comunque in grado di misurare la retention reale basata su utenti per il 30% della coorte — una profondità simile al tasso di consenso del 35-40% di GA4, ma con zero rischio di violazione del GDPR.",{"type":32,"tag":40,"props":1729,"children":1731},{"id":1730},"confronto-con-ga4-conformità-vs-granularità",[1732],{"type":37,"value":1733},"Confronto con GA4: Conformità vs. Granularità",{"type":32,"tag":33,"props":1735,"children":1736},{},[1737],{"type":37,"value":1738},"I vantaggi di GA4:",{"type":32,"tag":1740,"props":1741,"children":1742},"ul",{},[1743,1749,1754,1759],{"type":32,"tag":1744,"props":1745,"children":1746},"li",{},[1747],{"type":37,"value":1748},"User ID + Google Signals con tracciamento cross-device (se c'è consenso)",{"type":32,"tag":1744,"props":1750,"children":1751},{},[1752],{"type":37,"value":1753},"Esportazione BigQuery nativa, schema stabile",{"type":32,"tag":1744,"props":1755,"children":1756},{},[1757],{"type":37,"value":1758},"Report Funnel e Path Exploration già pronti nell'UI",{"type":32,"tag":1744,"props":1760,"children":1761},{},[1762],{"type":37,"value":1763},"Integrazione Google Ads con un clic",{"type":32,"tag":33,"props":1765,"children":1766},{},[1767],{"type":37,"value":1768},"I difetti di GA4:",{"type":32,"tag":1740,"props":1770,"children":1771},{},[1772,1777,1782,1787],{"type":32,"tag":1744,"props":1773,"children":1774},{},[1775],{"type":37,"value":1776},"Consent Mode v2 obbligatorio → dati modellati quando consent_status=denied",{"type":32,"tag":1744,"props":1778,"children":1779},{},[1780],{"type":37,"value":1781},"Conservazione dell'ID utente di 360 giorni (dopo 14 mesi user_pseudo_id si ripristina)",{"type":32,"tag":1744,"props":1783,"children":1784},{},[1785],{"type":37,"value":1786},"Dimensione dello script 43 KB (30 volte quella di Plausible)",{"type":32,"tag":1744,"props":1788,"children":1789},{},[1790],{"type":37,"value":1791},"Per l'esportazione ClickStream è necessario GA360 (€150K+ annuali)",{"type":32,"tag":33,"props":1793,"children":1794},{},[1795],{"type":37,"value":1796},"I vantaggi di Plausible + server-side stack:",{"type":32,"tag":1740,"props":1798,"children":1799},{},[1800,1805,1810,1815],{"type":32,"tag":1744,"props":1801,"children":1802},{},[1803],{"type":37,"value":1804},"Niente cookie → il banner di consenso GDPR diventa opzionale (si semplifica enormemente)",{"type":32,"tag":1744,"props":1806,"children":1807},{},[1808],{"type":37,"value":1809},"Proprietà degli event: i dati grezzi rimangono sotto il tuo controllo (ClickHouse, BigQuery, S3)",{"type":32,"tag":1744,"props":1811,"children":1812},{},[1813],{"type":37,"value":1814},"Script leggero → impatto sul tempo di caricamento pagina \u003C5ms",{"type":32,"tag":1744,"props":1816,"children":1817},{},[1818],{"type":37,"value":1819},"Opzione self-hosted disponibile (i dati non escono dall'UE)",{"type":32,"tag":33,"props":1821,"children":1822},{},[1823],{"type":37,"value":1824},"I difetti di Plausible:",{"type":32,"tag":1740,"props":1826,"children":1827},{},[1828,1833,1838],{"type":32,"tag":1744,"props":1829,"children":1830},{},[1831],{"type":37,"value":1832},"Niente tracciamento cross-device (per utenti non autenticati)",{"type":32,"tag":1744,"props":1834,"children":1835},{},[1836],{"type":37,"value":1837},"L'analisi funnel\u002Fpercorso richiede SQL personalizzato",{"type":32,"tag":1744,"props":1839,"children":1840},{},[1841],{"type":37,"value":1842},"L'integrazione con Google Ads\u002FMeta Conversion API richiede pipeline personalizzate",{"type":32,"tag":33,"props":1844,"children":1845},{},[1846],{"type":32,"tag":76,"props":1847,"children":1848},{},[1849],{"type":37,"value":1850},"Confronto dei costi (100M event\u002Fmese):",{"type":32,"tag":1740,"props":1852,"children":1853},{},[1854,1859,1864,1869],{"type":32,"tag":1744,"props":1855,"children":1856},{},[1857],{"type":37,"value":1858},"GA4 standard: gratuito ma senza esportazione BigQuery (GA360 a €150K\u002Fanno)",{"type":32,"tag":1744,"props":1860,"children":1861},{},[1862],{"type":37,"value":1863},"Plausible Cloud: piano Business €200\u002Fmese (limite 200K pageview\u002Fmese, oltre self-host)",{"type":32,"tag":1744,"props":1865,"children":1866},{},[1867],{"type":37,"value":1868},"Plausible self-hosted + ClickHouse (AWS c6g.2xlarge + 500GB SSD): ~€350\u002Fmese",{"type":32,"tag":1744,"props":1870,"children":1871},{},[1872],{"type":37,"value":1873},"Job batch BigQuery (aggregazione giornaliera): ~€80\u002Fmese",{"type":32,"tag":33,"props":1875,"children":1876},{},[1877],{"type":37,"value":1878},"Stack Plausible totale: ~€430\u002Fmese. GA360: €12.5K\u002Fmese. Differenza di costo: 30 volte.",{"type":32,"tag":40,"props":1880,"children":1882},{"id":1881},"livello-di-identity-resolution-probabilistic-match",[1883],{"type":37,"value":1884},"Livello di Identity Resolution: Probabilistic Match",{"type":32,"tag":33,"props":1886,"children":1887},{},[1888,1890,1895],{"type":37,"value":1889},"Per identificare anche gli utenti che non effettuano il login oltre la singola sessione, è possibile utilizzare la probabilistic identity resolution. Il fingerprinting è vietato (GDPR, ePrivacy) ma l'",{"type":32,"tag":76,"props":1891,"children":1892},{},[1893],{"type":37,"value":1894},"aggregazione di segnali lato server",{"type":37,"value":1896}," permette di ottenere risultati simili.",{"type":32,"tag":33,"props":1898,"children":1899},{},[1900,1902,1908],{"type":37,"value":1901},"L'esempio combina ",{"type":32,"tag":89,"props":1903,"children":1905},{"className":1904},[],[1906],{"type":37,"value":1907},"user_agent + IP subnet + timezone + screen resolution",{"type":37,"value":1909}," per creare un hash:",{"type":32,"tag":82,"props":1911,"children":1913},{"className":624,"code":1912,"language":626,"meta":16,"style":16},"-- BigQuery UDF: probabilistic_user_id\nCREATE TEMP FUNCTION probabilistic_user_id(ua STRING, ip STRING, tz STRING, res STRING)\nRETURNS STRING\nAS (\n  TO_BASE64(SHA256(CONCAT(\n    REGEXP_EXTRACT(ua, r'^[^\u002F]+'),  -- famiglia di browser\n    NET.IP_TRUNC(NET.SAFE_IP_FROM_STRING(ip), 24),  -- subnet \u002F24\n    tz,\n    res\n  )))\n);\n\nSELECT\n  timestamp,\n  session_hash,\n  probabilistic_user_id(user_agent, ip_address, timezone, screen_resolution) AS prob_user_id\nFROM plausible_events;\n",[1914],{"type":32,"tag":89,"props":1915,"children":1916},{"__ignoreMap":16},[1917,1925,1947,1960,1971,1989,2012,2066,2074,2082,2090,2097,2106,2113,2124,2132,2149],{"type":32,"tag":93,"props":1918,"children":1919},{"class":95,"line":96},[1920],{"type":32,"tag":93,"props":1921,"children":1922},{"style":100},[1923],{"type":37,"value":1924},"-- BigQuery UDF: probabilistic_user_id\n",{"type":32,"tag":93,"props":1926,"children":1927},{"class":95,"line":106},[1928,1932,1937,1942],{"type":32,"tag":93,"props":1929,"children":1930},{"style":116},[1931],{"type":37,"value":638},{"type":32,"tag":93,"props":1933,"children":1934},{"style":110},[1935],{"type":37,"value":1936}," TEMP ",{"type":32,"tag":93,"props":1938,"children":1939},{"style":116},[1940],{"type":37,"value":1941},"FUNCTION",{"type":32,"tag":93,"props":1943,"children":1944},{"style":110},[1945],{"type":37,"value":1946}," probabilistic_user_id(ua STRING, ip STRING, tz STRING, res STRING)\n",{"type":32,"tag":93,"props":1948,"children":1949},{"class":95,"line":127},[1950,1955],{"type":32,"tag":93,"props":1951,"children":1952},{"style":116},[1953],{"type":37,"value":1954},"RETURNS",{"type":32,"tag":93,"props":1956,"children":1957},{"style":110},[1958],{"type":37,"value":1959}," STRING\n",{"type":32,"tag":93,"props":1961,"children":1962},{"class":95,"line":158},[1963,1967],{"type":32,"tag":93,"props":1964,"children":1965},{"style":116},[1966],{"type":37,"value":991},{"type":32,"tag":93,"props":1968,"children":1969},{"style":110},[1970],{"type":37,"value":653},{"type":32,"tag":93,"props":1972,"children":1973},{"class":95,"line":225},[1974,1979,1984],{"type":32,"tag":93,"props":1975,"children":1976},{"style":110},[1977],{"type":37,"value":1978},"  TO_BASE64(SHA256(",{"type":32,"tag":93,"props":1980,"children":1981},{"style":136},[1982],{"type":37,"value":1983},"CONCAT",{"type":32,"tag":93,"props":1985,"children":1986},{"style":110},[1987],{"type":37,"value":1988},"(\n",{"type":32,"tag":93,"props":1990,"children":1991},{"class":95,"line":234},[1992,1997,2002,2007],{"type":32,"tag":93,"props":1993,"children":1994},{"style":110},[1995],{"type":37,"value":1996},"    REGEXP_EXTRACT(ua, r",{"type":32,"tag":93,"props":1998,"children":1999},{"style":147},[2000],{"type":37,"value":2001},"'^[^\u002F]+'",{"type":32,"tag":93,"props":2003,"children":2004},{"style":110},[2005],{"type":37,"value":2006},"),  ",{"type":32,"tag":93,"props":2008,"children":2009},{"style":100},[2010],{"type":37,"value":2011},"-- famiglia di browser\n",{"type":32,"tag":93,"props":2013,"children":2014},{"class":95,"line":277},[2015,2020,2024,2029,2033,2038,2042,2047,2052,2057,2061],{"type":32,"tag":93,"props":2016,"children":2017},{"style":136},[2018],{"type":37,"value":2019},"    NET",{"type":32,"tag":93,"props":2021,"children":2022},{"style":110},[2023],{"type":37,"value":303},{"type":32,"tag":93,"props":2025,"children":2026},{"style":136},[2027],{"type":37,"value":2028},"IP_TRUNC",{"type":32,"tag":93,"props":2030,"children":2031},{"style":110},[2032],{"type":37,"value":113},{"type":32,"tag":93,"props":2034,"children":2035},{"style":136},[2036],{"type":37,"value":2037},"NET",{"type":32,"tag":93,"props":2039,"children":2040},{"style":110},[2041],{"type":37,"value":303},{"type":32,"tag":93,"props":2043,"children":2044},{"style":136},[2045],{"type":37,"value":2046},"SAFE_IP_FROM_STRING",{"type":32,"tag":93,"props":2048,"children":2049},{"style":110},[2050],{"type":37,"value":2051},"(ip), ",{"type":32,"tag":93,"props":2053,"children":2054},{"style":136},[2055],{"type":37,"value":2056},"24",{"type":32,"tag":93,"props":2058,"children":2059},{"style":110},[2060],{"type":37,"value":2006},{"type":32,"tag":93,"props":2062,"children":2063},{"style":100},[2064],{"type":37,"value":2065},"-- subnet \u002F24\n",{"type":32,"tag":93,"props":2067,"children":2068},{"class":95,"line":316},[2069],{"type":32,"tag":93,"props":2070,"children":2071},{"style":110},[2072],{"type":37,"value":2073},"    tz,\n",{"type":32,"tag":93,"props":2075,"children":2076},{"class":95,"line":26},[2077],{"type":32,"tag":93,"props":2078,"children":2079},{"style":110},[2080],{"type":37,"value":2081},"    res\n",{"type":32,"tag":93,"props":2083,"children":2084},{"class":95,"line":343},[2085],{"type":32,"tag":93,"props":2086,"children":2087},{"style":110},[2088],{"type":37,"value":2089},"  )))\n",{"type":32,"tag":93,"props":2091,"children":2092},{"class":95,"line":352},[2093],{"type":32,"tag":93,"props":2094,"children":2095},{"style":110},[2096],{"type":37,"value":222},{"type":32,"tag":93,"props":2098,"children":2099},{"class":95,"line":361},[2100],{"type":32,"tag":93,"props":2101,"children":2103},{"emptyLinePlaceholder":2102},true,[2104],{"type":37,"value":2105},"\n",{"type":32,"tag":93,"props":2107,"children":2108},{"class":95,"line":370},[2109],{"type":32,"tag":93,"props":2110,"children":2111},{"style":116},[2112],{"type":37,"value":1266},{"type":32,"tag":93,"props":2114,"children":2115},{"class":95,"line":384},[2116,2120],{"type":32,"tag":93,"props":2117,"children":2118},{"style":116},[2119],{"type":37,"value":661},{"type":32,"tag":93,"props":2121,"children":2122},{"style":110},[2123],{"type":37,"value":671},{"type":32,"tag":93,"props":2125,"children":2126},{"class":95,"line":398},[2127],{"type":32,"tag":93,"props":2128,"children":2129},{"style":110},[2130],{"type":37,"value":2131},"  session_hash,\n",{"type":32,"tag":93,"props":2133,"children":2134},{"class":95,"line":407},[2135,2140,2144],{"type":32,"tag":93,"props":2136,"children":2137},{"style":110},[2138],{"type":37,"value":2139},"  probabilistic_user_id(user_agent, ip_address, timezone, screen_resolution) ",{"type":32,"tag":93,"props":2141,"children":2142},{"style":116},[2143],{"type":37,"value":991},{"type":32,"tag":93,"props":2145,"children":2146},{"style":110},[2147],{"type":37,"value":2148}," prob_user_id\n",{"type":32,"tag":93,"props":2150,"children":2151},{"class":95,"line":416},[2152,2156],{"type":32,"tag":93,"props":2153,"children":2154},{"style":116},[2155],{"type":37,"value":1405},{"type":32,"tag":93,"props":2157,"children":2158},{"style":110},[2159],{"type":37,"value":2160}," plausible_events;\n",{"type":32,"tag":33,"props":2162,"children":2163},{},[2164,2166,2175],{"type":37,"value":2165},"Questo metodo non è al 100% preciso (il tasso di collisione è ~2-4%, utenti diversi possono finire nello stesso hash) ma, nel quadro dell'",{"type":32,"tag":2167,"props":2168,"children":2172},"a",{"href":2169,"rel":2170},"https:\u002F\u002Fwww.roibase.com.tr\u002Fit\u002Ffirstparty",[2171],"nofollow",[2173],{"type":37,"value":2174},"Architettura di Misurazione e Dati First-Party",{"type":37,"value":2176},", è possibile combinare i segnali deterministici (user_id) + probabilistici (hash) per creare \"coorte fuzzy\". In questa coorte il tasso di retention mostra una deviazione minore rispetto ai dati modellati di GA4 (nei nostri test A\u002FB, deviazione media del 8%, vs 18-22% per GA4 modeled).",{"type":32,"tag":40,"props":2178,"children":2180},{"id":2179},"conformità-kvkk-accordo-di-trattamento-dei-dati-e-retention-dei-log",[2181],{"type":37,"value":2182},"Conformità KVKK: Accordo di Trattamento dei Dati e Retention dei Log",{"type":32,"tag":33,"props":2184,"children":2185},{},[2186,2188,2193,2195,2201],{"type":37,"value":2187},"KVKK Articolo 5: \"I dati personali devono essere trattati per scopi specifici, espliciti e leciti.\" La combinazione indirizzo IP + user agent è considerata \"identificatore indiretto\". Plausible riceve l'IP nel server, ma ",{"type":32,"tag":76,"props":2189,"children":2190},{},[2191],{"type":37,"value":2192},"non lo scrive",{"type":37,"value":2194}," in ClickHouse — solo il campo ",{"type":32,"tag":89,"props":2196,"children":2198},{"className":2197},[],[2199],{"type":37,"value":2200},"country",{"type":37,"value":2202}," viene compilato tramite lookup GeoIP e l'IP viene scartato.",{"type":32,"tag":33,"props":2204,"children":2205},{},[2206],{"type":37,"value":2207},"Nell'installazione self-hosted puoi controllare questo flusso:",{"type":32,"tag":82,"props":2209,"children":2213},{"className":2210,"code":2211,"language":2212,"meta":16,"style":16},"language-elixir shiki shiki-themes github-dark","# lib\u002Fplausible\u002Fingestion\u002Fevent.ex (semplificato)\ndefmodule Plausible.Ingestion.Event do\n  def process(conn, params) do\n    ip = get_ip_address(conn)\n    country = GeoIP.lookup(ip) |> Map.get(:country_code)\n    \n    event = %{\n      timestamp: DateTime.utc_now(),\n      domain: params[\"d\"],\n      session_hash: params[\"h\"],\n      country: country,\n      # L'IP viene scartato qui\n    }\n    \n    ClickHouse.insert(\"events\", event)\n  end\nend\n","elixir",[2214],{"type":32,"tag":89,"props":2215,"children":2216},{"__ignoreMap":16},[2217,2225,2233,2241,2249,2257,2265,2273,2281,2289,2297,2305,2313,2320,2327,2335,2343],{"type":32,"tag":93,"props":2218,"children":2219},{"class":95,"line":96},[2220],{"type":32,"tag":93,"props":2221,"children":2222},{},[2223],{"type":37,"value":2224},"# lib\u002Fplausible\u002Fingestion\u002Fevent.ex (semplificato)\n",{"type":32,"tag":93,"props":2226,"children":2227},{"class":95,"line":106},[2228],{"type":32,"tag":93,"props":2229,"children":2230},{},[2231],{"type":37,"value":2232},"defmodule Plausible.Ingestion.Event do\n",{"type":32,"tag":93,"props":2234,"children":2235},{"class":95,"line":127},[2236],{"type":32,"tag":93,"props":2237,"children":2238},{},[2239],{"type":37,"value":2240},"  def process(conn, params) do\n",{"type":32,"tag":93,"props":2242,"children":2243},{"class":95,"line":158},[2244],{"type":32,"tag":93,"props":2245,"children":2246},{},[2247],{"type":37,"value":2248},"    ip = get_ip_address(conn)\n",{"type":32,"tag":93,"props":2250,"children":2251},{"class":95,"line":225},[2252],{"type":32,"tag":93,"props":2253,"children":2254},{},[2255],{"type":37,"value":2256},"    country = GeoIP.lookup(ip) |> Map.get(:country_code)\n",{"type":32,"tag":93,"props":2258,"children":2259},{"class":95,"line":234},[2260],{"type":32,"tag":93,"props":2261,"children":2262},{},[2263],{"type":37,"value":2264},"    \n",{"type":32,"tag":93,"props":2266,"children":2267},{"class":95,"line":277},[2268],{"type":32,"tag":93,"props":2269,"children":2270},{},[2271],{"type":37,"value":2272},"    event = %{\n",{"type":32,"tag":93,"props":2274,"children":2275},{"class":95,"line":316},[2276],{"type":32,"tag":93,"props":2277,"children":2278},{},[2279],{"type":37,"value":2280},"      timestamp: DateTime.utc_now(),\n",{"type":32,"tag":93,"props":2282,"children":2283},{"class":95,"line":26},[2284],{"type":32,"tag":93,"props":2285,"children":2286},{},[2287],{"type":37,"value":2288},"      domain: params[\"d\"],\n",{"type":32,"tag":93,"props":2290,"children":2291},{"class":95,"line":343},[2292],{"type":32,"tag":93,"props":2293,"children":2294},{},[2295],{"type":37,"value":2296},"      session_hash: params[\"h\"],\n",{"type":32,"tag":93,"props":2298,"children":2299},{"class":95,"line":352},[2300],{"type":32,"tag":93,"props":2301,"children":2302},{},[2303],{"type":37,"value":2304},"      country: country,\n",{"type":32,"tag":93,"props":2306,"children":2307},{"class":95,"line":361},[2308],{"type":32,"tag":93,"props":2309,"children":2310},{},[2311],{"type":37,"value":2312},"      # L'IP viene scartato qui\n",{"type":32,"tag":93,"props":2314,"children":2315},{"class":95,"line":370},[2316],{"type":32,"tag":93,"props":2317,"children":2318},{},[2319],{"type":37,"value":572},{"type":32,"tag":93,"props":2321,"children":2322},{"class":95,"line":384},[2323],{"type":32,"tag":93,"props":2324,"children":2325},{},[2326],{"type":37,"value":2264},{"type":32,"tag":93,"props":2328,"children":2329},{"class":95,"line":398},[2330],{"type":32,"tag":93,"props":2331,"children":2332},{},[2333],{"type":37,"value":2334},"    ClickHouse.insert(\"events\", event)\n",{"type":32,"tag":93,"props":2336,"children":2337},{"class":95,"line":407},[2338],{"type":32,"tag":93,"props":2339,"children":2340},{},[2341],{"type":37,"value":2342},"  end\n",{"type":32,"tag":93,"props":2344,"children":2345},{"class":95,"line":416},[2346],{"type":32,"tag":93,"props":2347,"children":2348},{},[2349],{"type":37,"value":2350},"end\n",{"type":32,"tag":33,"props":2352,"children":2353},{},[2354],{"type":37,"value":2355},"KVKK Articolo 7: \"I dati possono essere conservati per il periodo richiesto dallo scopo del trattamento.\" Per l'analytics, la retention tipica è 24-36 mesi. In ClickHouse, TTL basato su partizione:",{"type":32,"tag":82,"props":2357,"children":2359},{"className":624,"code":2358,"language":626,"meta":16,"style":16},"ALTER TABLE events\nMODIFY TTL toDate(timestamp) + INTERVAL 36 MONTH;\n",[2360],{"type":32,"tag":89,"props":2361,"children":2362},{"__ignoreMap":16},[2363,2380],{"type":32,"tag":93,"props":2364,"children":2365},{"class":95,"line":96},[2366,2371,2375],{"type":32,"tag":93,"props":2367,"children":2368},{"style":116},[2369],{"type":37,"value":2370},"ALTER",{"type":32,"tag":93,"props":2372,"children":2373},{"style":116},[2374],{"type":37,"value":643},{"type":32,"tag":93,"props":2376,"children":2377},{"style":110},[2378],{"type":37,"value":2379}," events\n",{"type":32,"tag":93,"props":2381,"children":2382},{"class":95,"line":106},[2383,2388,2393,2397,2401,2405,2410,2415,2420],{"type":32,"tag":93,"props":2384,"children":2385},{"style":116},[2386],{"type":37,"value":2387},"MODIFY",{"type":32,"tag":93,"props":2389,"children":2390},{"style":110},[2391],{"type":37,"value":2392}," TTL toDate(",{"type":32,"tag":93,"props":2394,"children":2395},{"style":116},[2396],{"type":37,"value":839},{"type":32,"tag":93,"props":2398,"children":2399},{"style":110},[2400],{"type":37,"value":498},{"type":32,"tag":93,"props":2402,"children":2403},{"style":116},[2404],{"type":37,"value":188},{"type":32,"tag":93,"props":2406,"children":2407},{"style":110},[2408],{"type":37,"value":2409}," INTERVAL ",{"type":32,"tag":93,"props":2411,"children":2412},{"style":136},[2413],{"type":37,"value":2414},"36",{"type":32,"tag":93,"props":2416,"children":2417},{"style":116},[2418],{"type":37,"value":2419}," MONTH",{"type":32,"tag":93,"props":2421,"children":2422},{"style":110},[2423],{"type":37,"value":155},{"type":32,"tag":33,"props":2425,"children":2426},{},[2427],{"type":37,"value":2428},"Dopo 36 mesi la partizione viene eliminata automaticamente. In GA4, i dati a livello utente vengono ripristinati dopo 14 mesi (user_pseudo_id si ripristina) ma l'esportazione BigQuery a livello di event può essere conservata fino a 60 mesi (ma senza GA360 non c'è esportazione).",{"type":32,"tag":33,"props":2430,"children":2431},{},[2432],{"type":37,"value":2433},"Accordo di Trattamento dei Dati KVKK: se usi Plausible Cloud devi firmare un DPA (Data Processing Agreement). Plausible è hosted in UE (Hetzner, Germania) e fornisce un template DPA conforme al GDPR. Con self-hosted, il controllo dei dati è tutto tuo, quindi non c'è un \"data processor\", sei solo tu come \"data controller\".",{"type":32,"tag":40,"props":2435,"children":2437},{"id":2436},"integrazione-conversion-api-server-side-event-forwarding",[2438],{"type":37,"value":2439},"Integrazione Conversion API: Server-Side Event Forwarding",{"type":32,"tag":33,"props":2441,"children":2442},{},[2443],{"type":37,"value":2444},"Per inviare event di Plausible a Meta\u002FGoogle Ads è possibile costruire un pipeline di forwarding basato su webhook. Plausible non ha una propria API, ma è possibile fare uno streaming export da ClickHouse a BigQuery e attivare una Cloud Function:",{"type":32,"tag":82,"props":2446,"children":2448},{"className":84,"code":2447,"language":86,"meta":16,"style":16},"\u002F\u002F Cloud Function: plausible\n",[2449],{"type":32,"tag":89,"props":2450,"children":2451},{"__ignoreMap":16},[2452],{"type":32,"tag":93,"props":2453,"children":2454},{"class":95,"line":96},[2455],{"type":32,"tag":93,"props":2456,"children":2457},{"style":100},[2458],{"type":37,"value":2447},{"type":32,"tag":2460,"props":2461,"children":2462},"style",{},[2463],{"type":37,"value":2464},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":16,"searchDepth":127,"depth":127,"links":2466},[2467,2468,2469,2470,2471,2472,2473],{"id":42,"depth":106,"text":45},{"id":63,"depth":106,"text":66},{"id":873,"depth":106,"text":876},{"id":1730,"depth":106,"text":1733},{"id":1881,"depth":106,"text":1884},{"id":2179,"depth":106,"text":2182},{"id":2436,"depth":106,"text":2439},"markdown","content:it:data:analytics-privacy-first-plausible-aggregazione-lato-server.md","content","it\u002Fdata\u002Fanalytics-privacy-first-plausible-aggregazione-lato-server.md","it\u002Fdata\u002Fanalytics-privacy-first-plausible-aggregazione-lato-server","md",1785103521008]