<svg xmlns="http://www.w3.org/2000/svg" viewBox="-40 -40 900 428" role="img" aria-labelledby="identity-join-at-login-title identity-join-at-login-desc" font-family="Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif">
  <title id="identity-join-at-login-title">How Amplitude joins activity at login</title>
  <desc id="identity-join-at-login-desc">When the device ID is preserved at login, anonymous events and signed-in events join into one user profile. When the device ID is replaced at login, the anonymous events are orphaned on a separate profile.</desc>

  <!-- Row 1: joined correctly -->
  <rect x="0" y="0" width="150" height="28" rx="14" fill="#2a2a2a" stroke="#3ecf8e"/>
  <text x="75" y="18" text-anchor="middle" font-size="12" font-weight="600" fill="#3ecf8e">Joined correctly</text>

  <!-- anonymous events box -->
  <rect x="0" y="52" width="190" height="104" rx="8" fill="#232323" stroke="#a8a8a8"/>
  <text x="16" y="76" font-size="14" font-weight="600" fill="#f0f0f0">Before sign-in</text>
  <text x="16" y="98" font-size="13" fill="#f0f0f0">Page viewed</text>
  <text x="16" y="118" font-size="13" fill="#f0f0f0">Product opened</text>
  <text x="16" y="140" font-size="11" fill="#f0f0f0" font-family="'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, monospace">device_id: dev42</text>

  <!-- signed-in events box -->
  <rect x="270" y="52" width="240" height="104" rx="8" fill="#232323" stroke="#a8a8a8"/>
  <text x="286" y="76" font-size="14" font-weight="600" fill="#f0f0f0">After sign-in</text>
  <text x="286" y="98" font-size="13" fill="#f0f0f0">Plan selected</text>
  <text x="286" y="118" font-size="13" fill="#f0f0f0">Purchase made</text>
  <text x="286" y="140" font-size="11" fill="#f0f0f0" font-family="'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, monospace">device_id: dev42, user_id: usr-7</text>

  <!-- one profile -->
  <rect x="620" y="52" width="200" height="104" rx="8" fill="#1c3252" stroke="#93c5fd"/>
  <text x="636" y="76" font-size="14" font-weight="600" fill="#f0f0f0">One user profile</text>
  <text x="636" y="98" font-size="13" fill="#f0f0f0">All four events</text>
  <text x="636" y="118" font-size="13" fill="#f0f0f0">One journey</text>
  <text x="636" y="140" font-size="11" fill="#f0f0f0" font-family="'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, monospace">user_id: usr-7</text>

  <!-- arrows row 1 -->
  <line x1="198" y1="104" x2="262" y2="104" stroke="#f0f0f0" stroke-width="1.5"/>
  <path d="M262 104 l-8 -4 v8 z" fill="#f0f0f0"/>
  <line x1="518" y1="104" x2="612" y2="104" stroke="#f0f0f0" stroke-width="1.5"/>
  <path d="M612 104 l-8 -4 v8 z" fill="#f0f0f0"/>
  <text x="565" y="96" text-anchor="middle" font-size="11" font-weight="500" fill="#f0f0f0">same <tspan font-family="'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, monospace">device_id</tspan></text>

  <!-- divider -->
  <line x1="0" y1="188" x2="820" y2="188" stroke="#a8a8a8"/>

  <!-- Row 2: split by mistake -->
  <rect x="0" y="212" width="150" height="28" rx="14" fill="#2a2a2a" stroke="#f87171"/>
  <text x="75" y="230" text-anchor="middle" font-size="12" font-weight="600" fill="#f87171">Split by mistake</text>

  <rect x="0" y="264" width="230" height="84" rx="8" fill="#232323" stroke="#a8a8a8"/>
  <text x="16" y="288" font-size="14" font-weight="600" fill="#f0f0f0">Anonymous profile</text>
  <text x="16" y="310" font-size="13" fill="#f0f0f0">Page viewed, Product opened</text>
  <text x="16" y="332" font-size="11" fill="#f0f0f0" font-family="'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, monospace">device_id: dev42 (orphaned)</text>

  <rect x="520" y="264" width="300" height="84" rx="8" fill="#232323" stroke="#a8a8a8"/>
  <text x="536" y="288" font-size="14" font-weight="600" fill="#f0f0f0">Signed-in profile</text>
  <text x="536" y="310" font-size="13" fill="#f0f0f0">Plan selected, Purchase made</text>
  <text x="536" y="332" font-size="11" fill="#f0f0f0" font-family="'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, monospace">new device_id: dev99, user_id: usr-7</text>

  <line x1="238" y1="306" x2="512" y2="306" stroke="#f87171" stroke-width="1.5" stroke-dasharray="5 4"/>
  <text x="375" y="298" text-anchor="middle" font-size="11" font-weight="500" fill="#f87171"><tspan font-family="'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, monospace">device_id</tspan> replaced, no join</text>
</svg>
