{"title":"Segmentation","description":"Plot product event metrics over time, compare breakdowns by event properties or user traits, and verify the results in a segmentation insight.","order":650,"askSuggestions":["How do I break down an event metric by user plan?","When should I use segmentation instead of retention?"],"navigation":true,"body":{"code":"var Component=(()=>{var g=Object.create;var s=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var f=Object.getPrototypeOf,y=Object.prototype.hasOwnProperty;var v=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),w=(t,e)=>{for(var r in e)s(t,r,{get:e[r],enumerable:!0})},c=(t,e,r,i)=>{if(e&&typeof e==\"object\"||typeof e==\"function\")for(let o of m(e))!y.call(t,o)&&o!==r&&s(t,o,{get:()=>e[o],enumerable:!(i=p(e,o))||i.enumerable});return t};var b=(t,e,r)=>(r=t!=null?g(f(t)):{},c(e||!t||!t.__esModule?s(r,\"default\",{value:t,enumerable:!0}):r,t)),x=t=>c(s({},\"__esModule\",{value:!0}),t);var d=v((_,h)=>{h.exports=_jsx_runtime});var k={};w(k,{default:()=>u,frontmatter:()=>S});var n=b(d()),S={title:\"Segmentation\",description:\"Plot product event metrics over time, compare breakdowns by event properties or user traits, and verify the results in a segmentation insight.\",order:650,askSuggestions:[\"How do I break down an event metric by user plan?\",\"When should I use segmentation instead of retention?\"]};function l(t){let e={a:\"a\",code:\"code\",h1:\"h1\",h2:\"h2\",li:\"li\",ol:\"ol\",p:\"p\",strong:\"strong\",ul:\"ul\",...t.components},{DocsPreviewDocument:r,DocsPreviewSection:i,Screenshot:o}=e;return r||a(\"DocsPreviewDocument\",!0),i||a(\"DocsPreviewSection\",!0),o||a(\"Screenshot\",!0),(0,n.jsxs)(r,{anchors:\"segmentation-insights create-a-segmentation-insight choose-a-breakdown\",children:[(0,n.jsxs)(i,{sectionId:\"segmentation-insights\",anchors:\"\",ancestors:\"\",index:\"0\",children:[(0,n.jsx)(e.h1,{id:\"segmentation-insights\",children:\"Segmentation insights\"}),`\n`,(0,n.jsx)(e.p,{children:\"Plot an event metric over time and compare it by property or user attribute. For example, count purchases by region or compare feature usage across subscription plans.\"}),`\n`]}),(0,n.jsxs)(i,{sectionId:\"create-a-segmentation-insight\",anchors:\"\",ancestors:\"\",index:\"1\",children:[(0,n.jsx)(e.h2,{id:\"create-a-segmentation-insight\",children:\"Create a segmentation insight\"}),`\n`,(0,n.jsxs)(e.ol,{children:[`\n`,(0,n.jsxs)(e.li,{children:[\"Open \",(0,n.jsx)(e.strong,{children:\"Insights\"}),\" and create an insight.\"]}),`\n`,(0,n.jsxs)(e.li,{children:[\"Choose \",(0,n.jsx)(e.strong,{children:\"Segmentation\"}),\" as the insight type.\"]}),`\n`,(0,n.jsx)(e.li,{children:\"Select an event and aggregation, such as event count, unique users, sum, or average.\"}),`\n`,(0,n.jsx)(e.li,{children:\"Add filters and an optional breakdown by an event property or user trait.\"}),`\n`,(0,n.jsxs)(e.li,{children:[\"Set the time range and interval. Open \",(0,n.jsx)(e.strong,{children:\"Results\"}),\" to inspect the rows and \",(0,n.jsx)(e.strong,{children:\"SQL\"}),\" to review the generated query.\"]}),`\n`,(0,n.jsx)(e.li,{children:\"Save the insight when the metric and breakdown match your question.\"}),`\n`]}),`\n`,(0,n.jsx)(o,{story:\"charts-segmentationchart-linechart--single-series\",caption:\"Segmentation insight line chart comparing a metric over time\",width:\"1856\",height:\"1096\"}),`\n`]}),(0,n.jsxs)(i,{sectionId:\"choose-a-breakdown\",anchors:\"\",ancestors:\"\",index:\"2\",children:[(0,n.jsx)(e.h2,{id:\"choose-a-breakdown\",children:\"Choose a breakdown\"}),`\n`,(0,n.jsxs)(e.ul,{children:[`\n`,(0,n.jsxs)(e.li,{children:[\"Use an \",(0,n.jsx)(e.strong,{children:\"event property\"}),\", such as \",(0,n.jsx)(e.code,{children:\"page_url\"}),\" or \",(0,n.jsx)(e.code,{children:\"endpoint\"}),\", to compare the context of each action.\"]}),`\n`,(0,n.jsxs)(e.li,{children:[\"Use a \",(0,n.jsx)(e.strong,{children:\"user trait\"}),\", such as plan or region, to compare groups of identified users. \",(0,n.jsx)(e.a,{href:\"/docs/product-analytics/identify\",children:\"Identify users\"}),\" to attach these traits.\"]}),`\n`]}),`\n`,(0,n.jsxs)(e.p,{children:[\"Check missing property values and the selected aggregation before comparing groups. Use \",(0,n.jsx)(e.a,{href:\"/docs/product-analytics/query\",children:\"SQL\"}),\" and the \",(0,n.jsx)(e.a,{href:\"/docs/product-analytics/data-model\",children:\"data model\"}),\" when you need to inspect the source records.\"]}),`\n`,(0,n.jsxs)(e.p,{children:[\"For conversion through ordered steps, use \",(0,n.jsx)(e.a,{href:\"/docs/product-analytics/funnel\",children:\"Funnel\"}),\". For the percentage of a cohort that returns after a starting event, use \",(0,n.jsx)(e.a,{href:\"/docs/product-analytics/retention\",children:\"Retention\"}),\".\"]})]})]})}function u(t={}){let{wrapper:e}=t.components||{};return e?(0,n.jsx)(e,{...t,children:(0,n.jsx)(l,{...t})}):l(t)}function a(t,e){throw new Error(\"Expected \"+(e?\"component\":\"object\")+\" `\"+t+\"` to be defined: you likely forgot to import, pass, or provide it.\")}return x(k);})();\n;return Component;"},"_id":"docs/product-analytics/segmentation.mdx","_raw":{"sourceFilePath":"docs/product-analytics/segmentation.mdx","sourceFileName":"segmentation.mdx","sourceFileDir":"docs/product-analytics","contentType":"mdx","flattenedPath":"docs/product-analytics/segmentation"},"type":"Docs","path":"/product-analytics/segmentation","level":2,"parent":"product-analytics"}