{"title":"Product Analytics data model","description":"Look up the raw and identity-resolved Product Analytics tables for events, users, web sessions, and pageviews in the built-in lakehouse catalog.","order":800,"navigation":true,"body":{"code":"var Component=(()=>{var h=Object.create;var a=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var v=Object.getPrototypeOf,b=Object.prototype.hasOwnProperty;var f=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),D=(t,e)=>{for(var i in e)a(t,i,{get:e[i],enumerable:!0})},c=(t,e,i,s)=>{if(e&&typeof e==\"object\"||typeof e==\"function\")for(let o of y(e))!b.call(t,o)&&o!==i&&a(t,o,{get:()=>e[o],enumerable:!(s=m(e,o))||s.enumerable});return t};var g=(t,e,i)=>(i=t!=null?h(v(t)):{},c(e||!t||!t.__esModule?a(i,\"default\",{value:t,enumerable:!0}):i,t)),w=t=>c(a({},\"__esModule\",{value:!0}),t);var l=f((A,d)=>{d.exports=_jsx_runtime});var x={};D(x,{default:()=>p,frontmatter:()=>_});var n=g(l()),_={title:\"Product Analytics data model\",description:\"Look up the raw and identity-resolved Product Analytics tables for events, users, web sessions, and pageviews in the built-in lakehouse catalog.\",order:800};function u(t){let e={a:\"a\",code:\"code\",h1:\"h1\",h2:\"h2\",p:\"p\",pre:\"pre\",...t.components},{DocsPreviewDocument:i,DocsPreviewSection:s,DocsTable:o}=e;return i||r(\"DocsPreviewDocument\",!0),s||r(\"DocsPreviewSection\",!0),o||r(\"DocsTable\",!0),(0,n.jsxs)(i,{anchors:\"product-analytics-data-model collection-mode\",children:[(0,n.jsxs)(s,{sectionId:\"product-analytics-data-model\",anchors:\"\",ancestors:\"\",index:\"0\",children:[(0,n.jsx)(e.h1,{id:\"product-analytics-data-model\",children:\"Product Analytics data model\"}),`\n`,(0,n.jsxs)(e.p,{children:[\"When you enable Product Analytics, Altertable creates the catalog tables for you and exposes API endpoints that make ingestion easier. As your application sends events and identity updates through the \",(0,n.jsx)(e.a,{href:\"/docs/api-references/product-analytics\",children:\"Product Analytics API\"}),\", Altertable writes the resulting data into these tables and views:\"]}),`\n`,(0,n.jsx)(o,{columns:[\"Table\",\"Description\"],data:[{Table:\"`main.events`\",Description:\"Raw events (everything `/track` receives)\"},{Table:\"`main.identities`\",Description:\"Raw identities (everything `/identify` receives)\"},{Table:\"`main.identity_distinct_ids`\",Description:\"Raw distinct IDs mapping\"},{Table:\"`main.identity_distinct_id_overrides`\",Description:\"Raw distinct ID override mappings\"},{Table:\"`analytics.events`\",Description:\"Identity-resolved events\"},{Table:\"`analytics.identities`\",Description:\"Identity-resolved user profiles\"},{Table:\"`analytics.web_sessions`\",Description:\"Aggregated session data\"},{Table:\"`analytics.web_pageviews`\",Description:\"Page-level analytics\"}]}),`\n`]}),(0,n.jsxs)(s,{sectionId:\"collection-mode\",anchors:\"\",ancestors:\"\",index:\"1\",children:[(0,n.jsx)(e.h2,{id:\"collection-mode\",children:\"Collection mode\"}),`\n`,(0,n.jsxs)(e.p,{children:[\"The \",(0,n.jsx)(e.code,{children:\"mode\"}),\" column distinguishes \",(0,n.jsx)(e.code,{children:\"product\"}),\" and \",(0,n.jsx)(e.code,{children:\"audience\"}),\" events. Filter by mode when analyzing identified product behavior separately from audience measurement:\"]}),`\n`,(0,n.jsx)(e.pre,{children:(0,n.jsx)(e.code,{className:\"language-sql\",children:`SELECT mode, event, COUNT(*) AS event_count\nFROM product_analytics.main.events\nGROUP BY mode, event;\n`})}),`\n`,(0,n.jsx)(e.p,{children:\"Audience events do not carry client-provided user, anonymous, session, or device identifiers. Do not use them as a substitute for identified-user retention or cross-day user journeys.\"})]})]})}function p(t={}){let{wrapper:e}=t.components||{};return e?(0,n.jsx)(e,{...t,children:(0,n.jsx)(u,{...t})}):u(t)}function r(t,e){throw new Error(\"Expected \"+(e?\"component\":\"object\")+\" `\"+t+\"` to be defined: you likely forgot to import, pass, or provide it.\")}return w(x);})();\n;return Component;"},"_id":"docs/product-analytics/data-model.mdx","_raw":{"sourceFilePath":"docs/product-analytics/data-model.mdx","sourceFileName":"data-model.mdx","sourceFileDir":"docs/product-analytics","contentType":"mdx","flattenedPath":"docs/product-analytics/data-model"},"type":"Docs","path":"/product-analytics/data-model","level":2,"parent":"product-analytics"}