<svg xmlns="http://www.w3.org/2000/svg" viewBox="-40 -40 776 396" role="img" aria-labelledby="missing-user-id-title missing-user-id-desc" font-family="Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif">
  <title id="missing-user-id-title">User ID missing after sign-in</title>
  <desc id="missing-user-id-desc">When events after sign-in carry a user_id, Amplitude links the device to the known user. Without a user_id, activity from a new device remains anonymous until a later event identifies that device.</desc>

  <defs>
    <marker id="missing-user-id-arrow" viewBox="0 0 10 10" refX="10" refY="5"
            markerWidth="8" markerHeight="8" orient="auto">
      <path d="M0,0 L10,5 L0,10 Z" fill="#13294b"/>
    </marker>
    <marker id="missing-user-id-arrow-danger" viewBox="0 0 10 10" refX="10" refY="5"
            markerWidth="8" markerHeight="8" orient="auto">
      <path d="M0,0 L10,5 L0,10 Z" fill="#b41823"/>
    </marker>
  </defs>

  <!-- ===== Row 1: identified correctly ===== -->

  <!-- Status badge -->
  <rect x="0" y="0" width="176" height="26" rx="13" fill="#ffffff" stroke="#0a7640" stroke-width="1"/>
  <text x="88" y="17" text-anchor="middle" font-size="12" font-weight="600" fill="#0a7640">Identified correctly</text>

  <!-- Source events -->
  <g>
    <rect x="0" y="38" width="256" height="100" rx="8" fill="#f8f9fb" stroke="#6f7480" stroke-width="1"/>
    <text x="16" y="61" font-size="14" font-weight="600" fill="#13294b">After sign-in</text>
    <text x="16" y="82" font-size="12" fill="#1e2024">Plan selected</text>
    <text x="16" y="100" font-size="12" fill="#1e2024">Purchase</text>
    <text x="16" y="121" font-size="11" fill="#13294b"
          font-family="'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, monospace">device_id: dev42, user_id: usr-7</text>
  </g>

  <!-- Join arrow -->
  <line x1="264" y1="88" x2="448" y2="88" stroke="#13294b" stroke-width="1.5" marker-end="url(#missing-user-id-arrow)"/>

  <!-- Resulting profile (focal) -->
  <g>
    <rect x="456" y="56" width="240" height="64" rx="8" fill="#c1e0fe" stroke="#1e61f0" stroke-width="1"/>
    <text x="472" y="80" font-size="14" font-weight="600" fill="#13294b">Known user profile</text>
    <text x="472" y="101" font-size="11" fill="#13294b"
          font-family="'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, monospace">user_id: usr-7</text>
  </g>

  <!-- ===== Row 2: a new device isn't identified yet ===== -->

  <!-- Status badge -->
  <rect x="0" y="178" width="176" height="26" rx="13" fill="#ffffff" stroke="#b41823" stroke-width="1"/>
  <text x="88" y="195" text-anchor="middle" font-size="12" font-weight="600" fill="#b41823">Not identified yet</text>

  <!-- Source events -->
  <g>
    <rect x="0" y="216" width="256" height="100" rx="8" fill="#f8f9fb" stroke="#6f7480" stroke-width="1"/>
    <text x="16" y="239" font-size="14" font-weight="600" fill="#13294b">After sign-in</text>
    <text x="16" y="260" font-size="12" fill="#1e2024">Plan selected</text>
    <text x="16" y="278" font-size="12" fill="#1e2024">Purchase</text>
    <text x="16" y="299" font-size="11" fill="#13294b"
          font-family="'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, monospace">device_id: dev99, user_id: (none)</text>
  </g>

  <!-- Failure arrow: dashed + labelled, so color is not the only cue -->
  <text x="356" y="239" text-anchor="middle" font-size="11" font-weight="500" fill="#b41823">no <tspan
    font-family="'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, monospace">user_id</tspan> to link this device</text>
  <text x="356" y="254" text-anchor="middle" font-size="11" font-weight="500" fill="#b41823">until a later identified event</text>
  <line x1="264" y1="266" x2="448" y2="266" stroke="#b41823" stroke-width="1.5" stroke-dasharray="5 4" marker-end="url(#missing-user-id-arrow-danger)"/>

  <!-- Resulting profile -->
  <g>
    <rect x="456" y="234" width="240" height="64" rx="8" fill="#f8f9fb" stroke="#6f7480" stroke-width="1"/>
    <text x="472" y="259" font-size="14" font-weight="600" fill="#13294b">Anonymous device profile</text>
    <text x="472" y="280" font-size="11" fill="#13294b"
          font-family="'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, monospace">device_id: dev99</text>
  </g>
</svg>
