@amplitude/wizard 1.0.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +25 -1
- package/dist/bin.js +47 -11
- package/dist/src/frameworks/javascript-node/javascript-node-wizard-agent.js +11 -1
- package/dist/src/frameworks/react-router/react-router-wizard-agent.js +65 -8
- package/dist/src/frameworks/vue/vue-wizard-agent.js +6 -1
- package/dist/src/lib/agent-interface.js +46 -0
- package/dist/src/lib/agent-runner.js +112 -51
- package/dist/src/lib/api.d.ts +35 -0
- package/dist/src/lib/api.js +118 -0
- package/dist/src/lib/commandments.js +1 -0
- package/dist/src/lib/constants.d.ts +1 -1
- package/dist/src/lib/constants.js +3 -3
- package/dist/src/lib/credential-resolution.js +7 -0
- package/dist/src/lib/framework-config.d.ts +9 -0
- package/dist/src/lib/mcp-with-fallback.d.ts +43 -0
- package/dist/src/lib/mcp-with-fallback.js +220 -0
- package/dist/src/lib/version-check.d.ts +17 -0
- package/dist/src/lib/version-check.js +72 -0
- package/dist/src/lib/wizard-session.d.ts +22 -7
- package/dist/src/lib/wizard-session.js +5 -3
- package/dist/src/run.d.ts +18 -1
- package/dist/src/run.js +104 -15
- package/dist/src/ui/agent-ui.d.ts +2 -0
- package/dist/src/ui/agent-ui.js +10 -0
- package/dist/src/ui/logging-ui.d.ts +2 -0
- package/dist/src/ui/logging-ui.js +6 -0
- package/dist/src/ui/tui/components/ConsoleView.js +14 -1
- package/dist/src/ui/tui/components/JourneyStepper.js +1 -3
- package/dist/src/ui/tui/flows.d.ts +0 -1
- package/dist/src/ui/tui/flows.js +1 -9
- package/dist/src/ui/tui/ink-ui.d.ts +2 -0
- package/dist/src/ui/tui/ink-ui.js +6 -0
- package/dist/src/ui/tui/screen-registry.js +0 -2
- package/dist/src/ui/tui/screens/DataIngestionCheckScreen.d.ts +5 -3
- package/dist/src/ui/tui/screens/DataIngestionCheckScreen.js +124 -4
- package/dist/src/ui/tui/screens/OutroScreen.js +12 -3
- package/dist/src/ui/tui/store.d.ts +22 -3
- package/dist/src/ui/tui/store.js +52 -18
- package/dist/src/ui/tui/utils/diagnostics.js +1 -3
- package/dist/src/ui/wizard-ui.d.ts +8 -0
- package/dist/src/utils/analytics.d.ts +15 -0
- package/dist/src/utils/analytics.js +37 -0
- package/dist/src/utils/setup-utils.js +6 -1
- package/package.json +2 -2
- package/skills/integration/integration-android/SKILL.md +7 -10
- package/skills/integration/integration-android/references/amplitude-quickstart.md +1 -1
- package/skills/integration/integration-android/references/android.md +1468 -0
- package/skills/integration/integration-android/references/basic-integration-1.0-begin.md +3 -1
- package/skills/integration/integration-android/references/basic-integration-1.1-edit.md +183 -0
- package/skills/integration/integration-android/references/basic-integration-1.3-conclude.md +81 -11
- package/skills/integration/integration-angular/SKILL.md +6 -8
- package/skills/integration/integration-angular/references/amplitude-quickstart.md +1 -1
- package/skills/integration/integration-angular/references/basic-integration-1.0-begin.md +3 -1
- package/skills/integration/integration-angular/references/basic-integration-1.1-edit.md +183 -0
- package/skills/integration/integration-angular/references/basic-integration-1.3-conclude.md +81 -11
- package/skills/integration/integration-angular/references/browser-sdk-2.md +67 -20
- package/skills/integration/{integration-swift/references/analytics.md → integration-angular/references/browser-unified-sdk.md} +591 -157
- package/skills/integration/integration-astro-hybrid/SKILL.md +6 -13
- package/skills/integration/integration-astro-hybrid/references/amplitude-quickstart.md +1 -1
- package/skills/integration/integration-astro-hybrid/references/basic-integration-1.0-begin.md +3 -1
- package/skills/integration/integration-astro-hybrid/references/basic-integration-1.1-edit.md +183 -0
- package/skills/integration/integration-astro-hybrid/references/basic-integration-1.3-conclude.md +81 -11
- package/skills/integration/integration-astro-hybrid/references/browser-sdk-2.md +67 -20
- package/skills/integration/{integration-android/references/analytics.md → integration-astro-hybrid/references/browser-unified-sdk.md} +591 -157
- package/skills/integration/integration-astro-ssr/SKILL.md +6 -11
- package/skills/integration/integration-astro-ssr/references/amplitude-quickstart.md +1 -1
- package/skills/integration/integration-astro-ssr/references/basic-integration-1.0-begin.md +3 -1
- package/skills/integration/integration-astro-ssr/references/basic-integration-1.1-edit.md +183 -0
- package/skills/integration/integration-astro-ssr/references/basic-integration-1.3-conclude.md +81 -11
- package/skills/integration/integration-astro-ssr/references/browser-sdk-2.md +67 -20
- package/skills/integration/{integration-javascript_node/references/analytics.md → integration-astro-ssr/references/browser-unified-sdk.md} +591 -157
- package/skills/integration/integration-astro-static/SKILL.md +6 -8
- package/skills/integration/integration-astro-static/references/amplitude-quickstart.md +1 -1
- package/skills/integration/integration-astro-static/references/basic-integration-1.0-begin.md +3 -1
- package/skills/integration/integration-astro-static/references/basic-integration-1.1-edit.md +183 -0
- package/skills/integration/integration-astro-static/references/basic-integration-1.3-conclude.md +81 -11
- package/skills/integration/integration-astro-static/references/browser-sdk-2.md +67 -20
- package/skills/integration/integration-astro-static/references/browser-unified-sdk.md +2212 -0
- package/skills/integration/integration-astro-view-transitions/SKILL.md +6 -10
- package/skills/integration/integration-astro-view-transitions/references/amplitude-quickstart.md +1 -1
- package/skills/integration/integration-astro-view-transitions/references/basic-integration-1.0-begin.md +3 -1
- package/skills/integration/integration-astro-view-transitions/references/basic-integration-1.1-edit.md +183 -0
- package/skills/integration/integration-astro-view-transitions/references/basic-integration-1.3-conclude.md +81 -11
- package/skills/integration/integration-astro-view-transitions/references/browser-sdk-2.md +67 -20
- package/skills/integration/integration-astro-view-transitions/references/browser-unified-sdk.md +2212 -0
- package/skills/integration/integration-django/SKILL.md +5 -16
- package/skills/integration/integration-django/references/amplitude-quickstart.md +1 -1
- package/skills/integration/integration-django/references/basic-integration-1.0-begin.md +3 -1
- package/skills/integration/integration-django/references/basic-integration-1.1-edit.md +183 -0
- package/skills/integration/integration-django/references/basic-integration-1.3-conclude.md +81 -11
- package/skills/integration/integration-django/references/python.md +1 -1
- package/skills/integration/integration-expo/SKILL.md +8 -13
- package/skills/integration/integration-expo/references/amplitude-quickstart.md +1 -1
- package/skills/integration/integration-expo/references/basic-integration-1.0-begin.md +3 -1
- package/skills/integration/integration-expo/references/basic-integration-1.1-edit.md +183 -0
- package/skills/integration/integration-expo/references/basic-integration-1.3-conclude.md +81 -11
- package/skills/integration/integration-expo/references/react-native-sdk.md +11 -10
- package/skills/integration/integration-fastapi/SKILL.md +5 -16
- package/skills/integration/integration-fastapi/references/amplitude-quickstart.md +1 -1
- package/skills/integration/integration-fastapi/references/basic-integration-1.0-begin.md +3 -1
- package/skills/integration/integration-fastapi/references/basic-integration-1.1-edit.md +183 -0
- package/skills/integration/integration-fastapi/references/basic-integration-1.3-conclude.md +81 -11
- package/skills/integration/integration-fastapi/references/python.md +1 -1
- package/skills/integration/integration-flask/SKILL.md +5 -15
- package/skills/integration/integration-flask/references/amplitude-quickstart.md +1 -1
- package/skills/integration/integration-flask/references/basic-integration-1.0-begin.md +3 -1
- package/skills/integration/integration-flask/references/basic-integration-1.1-edit.md +183 -0
- package/skills/integration/integration-flask/references/basic-integration-1.3-conclude.md +81 -11
- package/skills/integration/integration-flask/references/python.md +1 -1
- package/skills/integration/integration-javascript_node/SKILL.md +6 -12
- package/skills/integration/integration-javascript_node/references/amplitude-quickstart.md +1 -1
- package/skills/integration/integration-javascript_node/references/basic-integration-1.0-begin.md +3 -1
- package/skills/integration/integration-javascript_node/references/basic-integration-1.1-edit.md +183 -0
- package/skills/integration/integration-javascript_node/references/basic-integration-1.3-conclude.md +81 -11
- package/skills/integration/integration-javascript_node/references/node.md +1457 -0
- package/skills/integration/integration-javascript_web/SKILL.md +7 -16
- package/skills/integration/integration-javascript_web/references/amplitude-quickstart.md +1 -1
- package/skills/integration/integration-javascript_web/references/basic-integration-1.0-begin.md +3 -1
- package/skills/integration/integration-javascript_web/references/basic-integration-1.1-edit.md +183 -0
- package/skills/integration/integration-javascript_web/references/basic-integration-1.3-conclude.md +81 -11
- package/skills/integration/integration-javascript_web/references/browser-sdk-2.md +67 -20
- package/skills/integration/integration-javascript_web/references/browser-unified-sdk.md +2212 -0
- package/skills/integration/integration-laravel/SKILL.md +5 -11
- package/skills/integration/integration-laravel/references/amplitude-quickstart.md +1 -1
- package/skills/integration/integration-laravel/references/analytics.md +1 -1
- package/skills/integration/integration-laravel/references/basic-integration-1.0-begin.md +3 -1
- package/skills/integration/integration-laravel/references/basic-integration-1.1-edit.md +183 -0
- package/skills/integration/integration-laravel/references/basic-integration-1.3-conclude.md +81 -11
- package/skills/integration/integration-nextjs-app-router/SKILL.md +6 -13
- package/skills/integration/integration-nextjs-app-router/references/amplitude-quickstart.md +1 -1
- package/skills/integration/integration-nextjs-app-router/references/basic-integration-1.0-begin.md +3 -1
- package/skills/integration/integration-nextjs-app-router/references/basic-integration-1.1-edit.md +183 -0
- package/skills/integration/integration-nextjs-app-router/references/basic-integration-1.3-conclude.md +81 -11
- package/skills/integration/integration-nextjs-app-router/references/browser-sdk-2.md +67 -20
- package/skills/integration/integration-nextjs-app-router/references/browser-unified-sdk.md +2212 -0
- package/skills/integration/integration-nextjs-pages-router/SKILL.md +6 -13
- package/skills/integration/integration-nextjs-pages-router/references/amplitude-quickstart.md +1 -1
- package/skills/integration/integration-nextjs-pages-router/references/basic-integration-1.0-begin.md +3 -1
- package/skills/integration/integration-nextjs-pages-router/references/basic-integration-1.1-edit.md +183 -0
- package/skills/integration/integration-nextjs-pages-router/references/basic-integration-1.3-conclude.md +81 -11
- package/skills/integration/integration-nextjs-pages-router/references/browser-sdk-2.md +67 -20
- package/skills/integration/integration-nextjs-pages-router/references/browser-unified-sdk.md +2212 -0
- package/skills/integration/integration-nuxt-3.6/SKILL.md +6 -5
- package/skills/integration/integration-nuxt-3.6/references/EXAMPLE.md +1 -1
- package/skills/integration/integration-nuxt-3.6/references/amplitude-quickstart.md +1 -1
- package/skills/integration/integration-nuxt-3.6/references/basic-integration-1.0-begin.md +3 -1
- package/skills/integration/integration-nuxt-3.6/references/basic-integration-1.1-edit.md +183 -0
- package/skills/integration/integration-nuxt-3.6/references/basic-integration-1.3-conclude.md +81 -11
- package/skills/integration/integration-nuxt-3.6/references/browser-sdk-2.md +67 -20
- package/skills/integration/integration-nuxt-3.6/references/browser-unified-sdk.md +2212 -0
- package/skills/integration/integration-nuxt-4/SKILL.md +6 -5
- package/skills/integration/integration-nuxt-4/references/amplitude-quickstart.md +1 -1
- package/skills/integration/integration-nuxt-4/references/basic-integration-1.0-begin.md +3 -1
- package/skills/integration/integration-nuxt-4/references/basic-integration-1.1-edit.md +183 -0
- package/skills/integration/integration-nuxt-4/references/basic-integration-1.3-conclude.md +81 -11
- package/skills/integration/integration-nuxt-4/references/browser-sdk-2.md +67 -20
- package/skills/integration/integration-nuxt-4/references/browser-unified-sdk.md +2212 -0
- package/skills/integration/integration-python/SKILL.md +8 -13
- package/skills/integration/integration-python/references/amplitude-quickstart.md +1 -1
- package/skills/integration/integration-python/references/basic-integration-1.0-begin.md +3 -1
- package/skills/integration/integration-python/references/basic-integration-1.1-edit.md +183 -0
- package/skills/integration/integration-python/references/basic-integration-1.3-conclude.md +81 -11
- package/skills/integration/integration-python/references/python.md +1 -1
- package/skills/integration/integration-react-native/SKILL.md +8 -9
- package/skills/integration/integration-react-native/references/amplitude-quickstart.md +1 -1
- package/skills/integration/integration-react-native/references/basic-integration-1.0-begin.md +3 -1
- package/skills/integration/integration-react-native/references/basic-integration-1.1-edit.md +183 -0
- package/skills/integration/integration-react-native/references/basic-integration-1.3-conclude.md +81 -11
- package/skills/integration/integration-react-native/references/react-native-sdk.md +11 -10
- package/skills/integration/integration-react-react-router-6/SKILL.md +6 -12
- package/skills/integration/integration-react-react-router-6/references/amplitude-quickstart.md +1 -1
- package/skills/integration/integration-react-react-router-6/references/basic-integration-1.0-begin.md +3 -1
- package/skills/integration/integration-react-react-router-6/references/basic-integration-1.1-edit.md +183 -0
- package/skills/integration/integration-react-react-router-6/references/basic-integration-1.3-conclude.md +81 -11
- package/skills/integration/integration-react-react-router-6/references/browser-sdk-2.md +67 -20
- package/skills/integration/integration-react-react-router-6/references/browser-unified-sdk.md +2212 -0
- package/skills/integration/integration-react-react-router-7-data/SKILL.md +6 -12
- package/skills/integration/integration-react-react-router-7-data/references/amplitude-quickstart.md +1 -1
- package/skills/integration/integration-react-react-router-7-data/references/basic-integration-1.0-begin.md +3 -1
- package/skills/integration/integration-react-react-router-7-data/references/basic-integration-1.1-edit.md +183 -0
- package/skills/integration/integration-react-react-router-7-data/references/basic-integration-1.3-conclude.md +81 -11
- package/skills/integration/integration-react-react-router-7-data/references/browser-sdk-2.md +67 -20
- package/skills/integration/integration-react-react-router-7-data/references/browser-unified-sdk.md +2212 -0
- package/skills/integration/integration-react-react-router-7-declarative/SKILL.md +6 -12
- package/skills/integration/integration-react-react-router-7-declarative/references/amplitude-quickstart.md +1 -1
- package/skills/integration/integration-react-react-router-7-declarative/references/basic-integration-1.0-begin.md +3 -1
- package/skills/integration/integration-react-react-router-7-declarative/references/basic-integration-1.1-edit.md +183 -0
- package/skills/integration/integration-react-react-router-7-declarative/references/basic-integration-1.3-conclude.md +81 -11
- package/skills/integration/integration-react-react-router-7-declarative/references/browser-sdk-2.md +67 -20
- package/skills/integration/integration-react-react-router-7-declarative/references/browser-unified-sdk.md +2212 -0
- package/skills/integration/integration-react-react-router-7-framework/SKILL.md +6 -12
- package/skills/integration/integration-react-react-router-7-framework/references/amplitude-quickstart.md +1 -1
- package/skills/integration/integration-react-react-router-7-framework/references/basic-integration-1.0-begin.md +3 -1
- package/skills/integration/integration-react-react-router-7-framework/references/basic-integration-1.1-edit.md +183 -0
- package/skills/integration/integration-react-react-router-7-framework/references/basic-integration-1.3-conclude.md +81 -11
- package/skills/integration/integration-react-react-router-7-framework/references/browser-sdk-2.md +67 -20
- package/skills/integration/integration-react-react-router-7-framework/references/browser-unified-sdk.md +2212 -0
- package/skills/integration/integration-react-tanstack-router-code-based/SKILL.md +6 -14
- package/skills/integration/integration-react-tanstack-router-code-based/references/amplitude-quickstart.md +1 -1
- package/skills/integration/integration-react-tanstack-router-code-based/references/basic-integration-1.0-begin.md +3 -1
- package/skills/integration/integration-react-tanstack-router-code-based/references/basic-integration-1.1-edit.md +183 -0
- package/skills/integration/integration-react-tanstack-router-code-based/references/basic-integration-1.3-conclude.md +81 -11
- package/skills/integration/integration-react-tanstack-router-code-based/references/browser-sdk-2.md +67 -20
- package/skills/integration/integration-react-tanstack-router-code-based/references/browser-unified-sdk.md +2212 -0
- package/skills/integration/integration-react-tanstack-router-file-based/SKILL.md +6 -14
- package/skills/integration/integration-react-tanstack-router-file-based/references/amplitude-quickstart.md +1 -1
- package/skills/integration/integration-react-tanstack-router-file-based/references/basic-integration-1.0-begin.md +3 -1
- package/skills/integration/integration-react-tanstack-router-file-based/references/basic-integration-1.1-edit.md +183 -0
- package/skills/integration/integration-react-tanstack-router-file-based/references/basic-integration-1.3-conclude.md +81 -11
- package/skills/integration/integration-react-tanstack-router-file-based/references/browser-sdk-2.md +67 -20
- package/skills/integration/integration-react-tanstack-router-file-based/references/browser-unified-sdk.md +2212 -0
- package/skills/integration/integration-react-vite/SKILL.md +6 -12
- package/skills/integration/integration-react-vite/references/amplitude-quickstart.md +1 -1
- package/skills/integration/integration-react-vite/references/basic-integration-1.0-begin.md +3 -1
- package/skills/integration/integration-react-vite/references/basic-integration-1.1-edit.md +183 -0
- package/skills/integration/integration-react-vite/references/basic-integration-1.3-conclude.md +81 -11
- package/skills/integration/integration-react-vite/references/browser-sdk-2.md +67 -20
- package/skills/integration/integration-react-vite/references/browser-unified-sdk.md +2212 -0
- package/skills/integration/integration-ruby/SKILL.md +6 -10
- package/skills/integration/integration-ruby/references/amplitude-quickstart.md +1 -1
- package/skills/integration/integration-ruby/references/analytics.md +1 -1
- package/skills/integration/integration-ruby/references/basic-integration-1.0-begin.md +3 -1
- package/skills/integration/integration-ruby/references/basic-integration-1.1-edit.md +183 -0
- package/skills/integration/integration-ruby/references/basic-integration-1.3-conclude.md +81 -11
- package/skills/integration/integration-ruby-on-rails/SKILL.md +5 -14
- package/skills/integration/integration-ruby-on-rails/references/amplitude-quickstart.md +1 -1
- package/skills/integration/integration-ruby-on-rails/references/analytics.md +1 -1
- package/skills/integration/integration-ruby-on-rails/references/basic-integration-1.0-begin.md +3 -1
- package/skills/integration/integration-ruby-on-rails/references/basic-integration-1.1-edit.md +183 -0
- package/skills/integration/integration-ruby-on-rails/references/basic-integration-1.3-conclude.md +81 -11
- package/skills/integration/integration-sveltekit/SKILL.md +6 -6
- package/skills/integration/integration-sveltekit/references/amplitude-quickstart.md +1 -1
- package/skills/integration/integration-sveltekit/references/basic-integration-1.0-begin.md +3 -1
- package/skills/integration/integration-sveltekit/references/basic-integration-1.1-edit.md +183 -0
- package/skills/integration/integration-sveltekit/references/basic-integration-1.3-conclude.md +81 -11
- package/skills/integration/integration-sveltekit/references/browser-sdk-2.md +67 -20
- package/skills/integration/integration-sveltekit/references/browser-unified-sdk.md +2212 -0
- package/skills/integration/integration-swift/SKILL.md +9 -10
- package/skills/integration/integration-swift/references/amplitude-quickstart.md +1 -1
- package/skills/integration/integration-swift/references/basic-integration-1.0-begin.md +3 -1
- package/skills/integration/integration-swift/references/basic-integration-1.1-edit.md +183 -0
- package/skills/integration/integration-swift/references/basic-integration-1.3-conclude.md +81 -11
- package/skills/integration/integration-swift/references/ios.md +1480 -0
- package/skills/integration/integration-tanstack-start/SKILL.md +6 -17
- package/skills/integration/integration-tanstack-start/references/amplitude-quickstart.md +1 -1
- package/skills/integration/integration-tanstack-start/references/basic-integration-1.0-begin.md +3 -1
- package/skills/integration/integration-tanstack-start/references/basic-integration-1.1-edit.md +183 -0
- package/skills/integration/integration-tanstack-start/references/basic-integration-1.3-conclude.md +81 -11
- package/skills/integration/integration-tanstack-start/references/browser-sdk-2.md +67 -20
- package/skills/integration/integration-tanstack-start/references/browser-unified-sdk.md +2212 -0
- package/skills/integration/integration-vue-3/SKILL.md +6 -5
- package/skills/integration/integration-vue-3/references/amplitude-quickstart.md +1 -1
- package/skills/integration/integration-vue-3/references/basic-integration-1.0-begin.md +3 -1
- package/skills/integration/integration-vue-3/references/basic-integration-1.1-edit.md +183 -0
- package/skills/integration/integration-vue-3/references/basic-integration-1.3-conclude.md +81 -11
- package/skills/integration/integration-vue-3/references/browser-sdk-2.md +67 -20
- package/skills/integration/integration-vue-3/references/browser-unified-sdk.md +2212 -0
- package/skills/taxonomy/amplitude-chart-dashboard-plan/SKILL.md +183 -0
- package/dist/src/ui/tui/screens/ChecklistScreen.d.ts +0 -12
- package/dist/src/ui/tui/screens/ChecklistScreen.js +0 -111
package/skills/integration/integration-react-react-router-7-data/references/browser-unified-sdk.md
ADDED
|
@@ -0,0 +1,2212 @@
|
|
|
1
|
+
<!--production-->
|
|
2
|
+
|
|
3
|
+
<!doctype html>
|
|
4
|
+
<html lang="en">
|
|
5
|
+
<head>
|
|
6
|
+
<meta name='zd-site-verification' content='od3rs5oc4ggcruhipz6rp' />
|
|
7
|
+
<meta charset="utf-8">
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
11
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
12
|
+
<meta content="Amplitude offers multiple ways to install browser SDKs, each with different product support and" name="description">
|
|
13
|
+
<meta name="google-site-verification" content="UHLjtoO7DV30dx3hVhwTOIWguEUr_VzS41msmq-uYKA" />
|
|
14
|
+
|
|
15
|
+
<link rel="apple-touch-icon" sizes="180x180" href="/docs/assets/general/apple-touch-icon.png">
|
|
16
|
+
<link rel="icon" type="image/png" sizes="32x32" href="/docs/assets/general/favicon-32x32.png">
|
|
17
|
+
<link rel="icon" type="image/png" sizes="16x16" href="/docs/assets/general/favicon-16x16.png">
|
|
18
|
+
<title>Browser Unified SDK | Amplitude</title>
|
|
19
|
+
|
|
20
|
+
<script type="application/ld+json">
|
|
21
|
+
{
|
|
22
|
+
"@context": "https://schema.org",
|
|
23
|
+
"@type": "Article",
|
|
24
|
+
"headline": "Browser Unified SDK",
|
|
25
|
+
"description": "Amplitude offers multiple ways to install browser SDKs, each with different product support and",
|
|
26
|
+
"url": "/docs/sdks/analytics/browser/browser-unified-sdk",
|
|
27
|
+
"publisher": {
|
|
28
|
+
"@type": "Organization",
|
|
29
|
+
"name": "Amplitude",
|
|
30
|
+
"legalName": "Amplitude, Inc.",
|
|
31
|
+
"url": "https://amplitude.com",
|
|
32
|
+
"logo": {
|
|
33
|
+
"@type": "ImageObject",
|
|
34
|
+
"url": "https://amplitude.com/nextjs-public/amplitude-default-seo.png"
|
|
35
|
+
},
|
|
36
|
+
"address": {
|
|
37
|
+
"@type": "PostalAddress",
|
|
38
|
+
"streetAddress": "201 3rd St #200",
|
|
39
|
+
"addressLocality": "San Francisco",
|
|
40
|
+
"addressRegion": "CA",
|
|
41
|
+
"postalCode": "94103",
|
|
42
|
+
"addressCountry": "USA"
|
|
43
|
+
},
|
|
44
|
+
"contactPoint": {
|
|
45
|
+
"@type": "ContactPoint",
|
|
46
|
+
"telephone": "[+650-988-5131]",
|
|
47
|
+
"contactType": "Customer Support",
|
|
48
|
+
"email": "sales@amplitude.com"
|
|
49
|
+
},
|
|
50
|
+
"sameAs": [
|
|
51
|
+
"https://twitter.com/Amplitude_HQ",
|
|
52
|
+
"https://www.facebook.com/AmplitudeAnalytics/",
|
|
53
|
+
"https://www.linkedin.com/company/amplitude-analytics"
|
|
54
|
+
]
|
|
55
|
+
},
|
|
56
|
+
"datePublished": "",
|
|
57
|
+
"dateModified": "April 15th, 2026",
|
|
58
|
+
"mainEntityOfPage": {
|
|
59
|
+
"@type": "WebPage",
|
|
60
|
+
"@id": "/docs/sdks/analytics/browser/browser-unified-sdk"
|
|
61
|
+
},
|
|
62
|
+
"author": [
|
|
63
|
+
{
|
|
64
|
+
"@type": "Organization",
|
|
65
|
+
"name": "Amplitude"
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
</script>
|
|
70
|
+
|
|
71
|
+
<style>
|
|
72
|
+
/* Prism’s critical code-block styles only */
|
|
73
|
+
code[class*="language-"],
|
|
74
|
+
pre[class*="language-"] {
|
|
75
|
+
color: #2a2a2a;
|
|
76
|
+
background: #f5f2f0;
|
|
77
|
+
font-family:"IBM Plex Mono", Consolas, Menlo, monospace;
|
|
78
|
+
font-size: 0.9em;
|
|
79
|
+
white-space: pre;
|
|
80
|
+
/* …etc, just the essentials… */
|
|
81
|
+
}
|
|
82
|
+
</style>
|
|
83
|
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/tocbot/4.25.0/tocbot.css">
|
|
84
|
+
<link href="/docs/css/site.css?id=6e2f9e1efe9343c4ba65666223648444" rel="stylesheet">
|
|
85
|
+
<link href="/docs/css/algolia.css?id=e343cc9490e043fefffa37d2817ddf8c" rel="stylesheet">
|
|
86
|
+
<link href="/docs/css/dracula-prism.css?id=a5713888be640854bb66b8b74c1037ce" rel="stylesheet">
|
|
87
|
+
<style>
|
|
88
|
+
pre[class*="language-"] code p {
|
|
89
|
+
all: unset; /* removes default block-level margins/padding */
|
|
90
|
+
display: inline; /* flow as if it were plain text */
|
|
91
|
+
}
|
|
92
|
+
</style>
|
|
93
|
+
<script src="/docs/js/site.js?id=078a82617f7dafffff92da951b4ec6c9"></script>
|
|
94
|
+
<script type="module" src="/docs/js/side-nav.js?id=b84c163c6c16a6a6b14fc85ee81c31e9"></script>
|
|
95
|
+
<script defer src="https://cdn.jsdelivr.net/npm/@alpinejs/collapse@3.x.x/dist/cdn.min.js"></script>
|
|
96
|
+
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.13.5/dist/cdn.min.js"></script>
|
|
97
|
+
<link rel="preconnect" href="https://93SYI9HL20-dsn.algolia.net" crossorigin />
|
|
98
|
+
<script src="https://unpkg.com/@amplitude/experiment-js-client@1.9.0/dist/experiment.umd.js"></script>
|
|
99
|
+
<style>
|
|
100
|
+
[x-cloak] {
|
|
101
|
+
display: none !important;
|
|
102
|
+
}
|
|
103
|
+
.copy-btn {
|
|
104
|
+
height: 24px;
|
|
105
|
+
position: absolute;
|
|
106
|
+
top: 0.5rem;
|
|
107
|
+
right: 0.5rem;
|
|
108
|
+
z-index: 10;
|
|
109
|
+
background: transparent;
|
|
110
|
+
border: none;
|
|
111
|
+
cursor: pointer;
|
|
112
|
+
padding: 0.25rem;
|
|
113
|
+
opacity: 0.6;
|
|
114
|
+
transition: opacity 0.2s;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.copy-btn:hover {
|
|
118
|
+
opacity: 1;
|
|
119
|
+
}
|
|
120
|
+
</style>
|
|
121
|
+
<script src="https://cdn.amplitude.com/script/8ec8f5cbeaf93a6717831a55add2d7a4.js"></script>
|
|
122
|
+
<script src="https://cdn.amplitude.com/script/8ec8f5cbeaf93a6717831a55add2d7a4.engagement.js"></script>
|
|
123
|
+
|
|
124
|
+
<script>
|
|
125
|
+
window.amplitude.add(window.sessionReplay.plugin({
|
|
126
|
+
sampleRate: 0.5
|
|
127
|
+
}));
|
|
128
|
+
window.amplitude.init('8ec8f5cbeaf93a6717831a55add2d7a4', {
|
|
129
|
+
"fetchRemoteConfig": true,
|
|
130
|
+
"autocapture": {
|
|
131
|
+
"attribution": {
|
|
132
|
+
"excludeInternalReferrers": true,
|
|
133
|
+
},
|
|
134
|
+
"pageViews": true,
|
|
135
|
+
"sessions": true,
|
|
136
|
+
"formInteractions": true,
|
|
137
|
+
"fileDownloads": true,
|
|
138
|
+
"elementInteractions": true,
|
|
139
|
+
"pageUrlEnrichment": true,
|
|
140
|
+
"webVitals": true,
|
|
141
|
+
},
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
window.amplitude.add(window.engagement.plugin())
|
|
145
|
+
|
|
146
|
+
function checkAuthenticatedUser() {
|
|
147
|
+
try {
|
|
148
|
+
const AMP_PREFIX = 'AMP_';
|
|
149
|
+
const currUserId = amplitude.getUserId();
|
|
150
|
+
|
|
151
|
+
if (!currUserId) {
|
|
152
|
+
// Iterate through all amplitude cookies within amplitude domain
|
|
153
|
+
const amplitudeCookies = getCookies(AMP_PREFIX);
|
|
154
|
+
|
|
155
|
+
for (let [cookieName, cookieValue] of amplitudeCookies.map((cookies) => cookies.split('='))) {
|
|
156
|
+
const [deviceId, userId] = cookieValue.split('.');
|
|
157
|
+
|
|
158
|
+
try {
|
|
159
|
+
const userSession = JSON.parse(decodeURIComponent(atob(cookieValue)))
|
|
160
|
+
if (userSession && userSession.userId) {
|
|
161
|
+
amplitude.setUserId(userSession.userId);
|
|
162
|
+
break;
|
|
163
|
+
}
|
|
164
|
+
} catch {}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
} catch (e) {
|
|
168
|
+
console.error(e);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
function getCookies(prefix) {
|
|
173
|
+
try {
|
|
174
|
+
const cookieArray = document.cookie.split(';').map((c) => c.trimStart());
|
|
175
|
+
let values = [];
|
|
176
|
+
for (let cookie of cookieArray) {
|
|
177
|
+
while (cookie.charAt(0) === ' ') {
|
|
178
|
+
cookie = cookie.substring(1);
|
|
179
|
+
}
|
|
180
|
+
if (cookie.startsWith(prefix)) {
|
|
181
|
+
values.push(cookie.substring(name.length));
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
return values;
|
|
185
|
+
} catch (e) {
|
|
186
|
+
return [];
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
document.addEventListener("DOMContentLoaded", function () {
|
|
191
|
+
checkAuthenticatedUser();
|
|
192
|
+
});
|
|
193
|
+
</script>
|
|
194
|
+
<script>
|
|
195
|
+
function academyClick(link) {
|
|
196
|
+
amplitude.track('Academy link', {
|
|
197
|
+
'destination': link,
|
|
198
|
+
'[Amplitude] Page URL': window.location.href
|
|
199
|
+
})
|
|
200
|
+
}
|
|
201
|
+
</script>
|
|
202
|
+
<!-- Preload consolidated glossary data -->
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
</head>
|
|
206
|
+
<body class="bg-gray-100 font-sans leading-normal text-gray-800 scroll-pt-24">
|
|
207
|
+
<div x-data="{ sidebarOpen: false }" class="container prose">
|
|
208
|
+
<div class="top-0 left-0 right-0 bg-white fixed z-10">
|
|
209
|
+
<div class="w-full pt-5 pl-5">
|
|
210
|
+
<div class="box-border">
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
<div class="box-border flex flex-row flex-nowrap items-center border-solid border-b border-black-200 h-12 px-4"
|
|
214
|
+
style="margin-left: -20px; margin-top: -20px;">
|
|
215
|
+
<div class="flex-auto mr-4"><a class="no-underline" href="/docs"><svg class="inline" xmlns="http://www.w3.org/2000/svg" width="102" height="22" viewBox="0 0 102 22" fill="none"><path d="M29.6006 4.30664L24.9824 15.8083H27.0328L27.9448 13.5064H32.8375L33.7338 15.8083H35.8324L31.222 4.30664H29.6006ZM28.6561 11.6698L30.3916 7.26636L32.1114 11.6698H28.6561Z" fill="#1E61F0"/><path d="M46.3273 7.61133C45.7724 7.61133 45.2618 7.7384 44.7934 7.99253C44.3251 8.24667 43.9778 8.59073 43.7515 9.02276C43.2724 8.08148 42.4381 7.61133 41.2486 7.61133C40.7695 7.61133 40.3081 7.71396 39.8643 7.9202C39.4206 8.12644 39.0615 8.45682 38.787 8.91036V7.77945H36.9541V15.8082H38.787V11.308C38.787 10.6668 38.9631 10.183 39.3153 9.85653C39.6676 9.53006 40.0916 9.36683 40.5865 9.36683C41.1355 9.36683 41.5684 9.53886 41.8862 9.8839C42.2039 10.2289 42.3623 10.703 42.3623 11.3071V15.8072H44.211V11.3071C44.211 10.6659 44.3861 10.182 44.7354 9.85555C45.0857 9.52908 45.5107 9.36585 46.0115 9.36585C46.5545 9.36585 46.9825 9.53788 47.2954 9.88292C47.6073 10.228 47.7637 10.702 47.7637 11.3061V15.8063H49.637V10.8975C49.637 9.89758 49.332 9.099 48.721 8.50276C48.11 7.90945 47.3121 7.61133 46.3273 7.61133Z" fill="#1E61F0"/><path d="M58.0913 8.17238C57.502 7.79802 56.8546 7.61133 56.1492 7.61133C55.5038 7.61133 54.9351 7.75013 54.4462 8.0287C53.9562 8.30727 53.5626 8.70509 53.2675 9.22412V7.78043H51.4346V18.6164H53.2675V14.3655C53.5636 14.8787 53.9562 15.2745 54.4462 15.5521C54.9361 15.8307 55.5038 15.9695 56.1492 15.9695C57.2206 15.9695 58.1297 15.5639 58.8784 14.7545C59.6261 13.9442 60 12.959 60 11.7987C60 11.0392 59.8288 10.3394 59.4874 9.6972C59.146 9.05502 58.6807 8.54675 58.0913 8.17238ZM57.4813 13.5181C57.0081 13.9911 56.4296 14.2277 55.7458 14.2277C55.0355 14.2277 54.4442 13.995 53.9739 13.5298C53.5026 13.0645 53.2675 12.4868 53.2675 11.7968C53.2675 11.0959 53.5026 10.5134 53.9739 10.0481C54.4452 9.58284 55.0355 9.35021 55.7458 9.35021C56.4296 9.35021 57.0081 9.58675 57.4813 10.0598C57.9556 10.5329 58.1917 11.1116 58.1917 11.7968C58.1927 12.4722 57.9556 13.045 57.4813 13.5181Z" fill="#1E61F0"/><path d="M63.287 4.30664H61.4541V15.8083H63.287V4.30664Z" fill="#1E61F0"/><path d="M66.9003 7.7793H65.0674V15.8081H66.9003V7.7793Z" fill="#1E61F0"/><path d="M65.996 4.04883C65.6733 4.04883 65.3959 4.16417 65.1647 4.39387C64.9335 4.62357 64.8174 4.89628 64.8174 5.21199C64.8174 5.53846 64.9325 5.81606 65.1647 6.04673C65.3959 6.27643 65.6733 6.39177 65.996 6.39177C66.3187 6.39177 66.5982 6.27643 66.8323 6.04673C67.0665 5.81703 67.1836 5.53846 67.1836 5.21199C67.1836 4.89628 67.0665 4.62357 66.8323 4.39387C66.5972 4.16417 66.3187 4.04883 65.996 4.04883Z" fill="#1E61F0"/><path d="M71.4538 5.62109H69.6051V7.77832H68.0713V9.51916H69.6051V12.7838C69.6051 13.7838 69.8737 14.554 70.4129 15.0936C70.951 15.6341 71.6751 15.9039 72.5842 15.9039C72.961 15.9039 73.2926 15.8716 73.5769 15.8071V14.1151C73.4107 14.1581 73.2109 14.1796 72.9797 14.1796C72.5055 14.1796 72.1336 14.0633 71.8621 13.8307C71.5905 13.5981 71.4538 13.2384 71.4538 12.7516V9.51916H73.5769V7.77832H71.4538V5.62109Z" fill="#1E61F0"/><path d="M80.6484 12.127C80.6484 12.7574 80.4673 13.2628 80.1033 13.643C79.7403 14.0223 79.2602 14.2129 78.662 14.2129C78.0697 14.2129 77.5935 14.0232 77.2324 13.643C76.8714 13.2638 76.6913 12.7584 76.6913 12.127V7.7793H74.8584V12.343C74.8584 13.471 75.1575 14.3575 75.7547 15.0017C76.3519 15.6458 77.1724 15.9684 78.2173 15.9684C78.7505 15.9684 79.2238 15.8452 79.638 15.5989C80.0522 15.3535 80.3886 15.0007 80.6474 14.5403V15.8081H82.496V7.7793H80.6474V12.127H80.6484Z" fill="#1E61F0"/><path d="M90.6406 9.19095C90.3445 8.68268 89.9549 8.29268 89.4699 8.01997C88.9858 7.74726 88.423 7.61139 87.7826 7.61139C87.0771 7.61139 86.4288 7.79613 85.8375 8.16463C85.2452 8.53313 84.7769 9.03847 84.4325 9.68065C84.0882 10.3228 83.916 11.0227 83.916 11.7822C83.916 12.5416 84.0882 13.2435 84.4325 13.8876C84.7769 14.5317 85.2452 15.04 85.8375 15.4114C86.4298 15.7829 87.0781 15.9686 87.7826 15.9686C88.423 15.9686 88.9858 15.8337 89.4699 15.5629C89.9539 15.2932 90.3445 14.9041 90.6406 14.3959V15.8073H92.4982V4.30664H90.6406V9.19095ZM89.9352 13.5269C89.464 13.9951 88.8786 14.2287 88.1791 14.2287C87.4953 14.2287 86.9168 13.9922 86.4435 13.5191C85.9693 13.046 85.7332 12.4674 85.7332 11.7822C85.7332 11.1087 85.9703 10.5349 86.4435 10.0619C86.9168 9.58877 87.4953 9.35223 88.1791 9.35223C88.8786 9.35223 89.464 9.58486 89.9352 10.0501C90.4065 10.5154 90.6416 11.0931 90.6416 11.7831C90.6406 12.4771 90.4055 13.0587 89.9352 13.5269Z" fill="#1E61F0"/><path d="M102 11.6218C102 10.8574 101.822 10.1664 101.466 9.54863C101.111 8.93088 100.633 8.45389 100.033 8.11667C99.4327 7.77945 98.7716 7.61133 98.0504 7.61133C97.286 7.61133 96.5854 7.79313 95.9469 8.15674C95.3094 8.52036 94.8057 9.01885 94.4367 9.65224C94.0678 10.2856 93.8838 10.9855 93.8838 11.7498C93.8838 12.5357 94.0678 13.2522 94.4367 13.8993C94.8057 14.5463 95.3104 15.0526 95.9509 15.4192C96.5914 15.7857 97.3017 15.9685 98.0829 15.9685C99.0785 15.9685 99.9256 15.7114 100.626 15.1983C101.326 14.6851 101.751 14.0058 101.902 13.1613H100.054C99.9729 13.5034 99.7535 13.782 99.3953 13.995C99.0372 14.2091 98.6112 14.3156 98.1153 14.3156C97.4749 14.3156 96.9505 14.1446 96.5412 13.8025C96.1319 13.4604 95.8682 12.9902 95.7502 12.3911H101.95C101.984 12.2474 102 11.9903 102 11.6218ZM95.7993 10.8271C95.9341 10.3345 96.189 9.95232 96.5668 9.67961C96.9436 9.4069 97.403 9.27006 97.9471 9.27006C98.4961 9.27006 98.9546 9.41374 99.3235 9.69916C99.6925 9.98555 99.9168 10.3609 99.9975 10.8262H95.7993V10.8271Z" fill="#1E61F0"/><path d="M9.3659 5.25304C9.30588 5.1768 9.24193 5.13477 9.16519 5.13477C9.1101 5.13868 9.05894 5.15627 9.01171 5.18559C8.44403 5.62642 7.6717 7.49628 7.03613 9.96336L7.59988 9.96727C8.70967 9.97998 9.85684 9.99269 10.9883 10.0093C10.6892 8.88133 10.4078 7.91463 10.1481 7.13072C9.76731 5.99101 9.51151 5.47785 9.3659 5.25304Z" fill="#1E61F0"/><path d="M10.6256 0.5C4.75792 0.5 0 5.22694 0 11.0564C0 16.886 4.75792 21.6129 10.6256 21.6129C16.4933 21.6129 21.2512 16.886 21.2512 11.0564C21.2512 5.22694 16.4933 0.5 10.6256 0.5ZM18.4689 10.9294C18.4394 11.0477 18.3666 11.163 18.2643 11.247C18.2515 11.2558 18.2387 11.2637 18.2259 11.2725L18.2131 11.2813L18.1875 11.2979L18.1659 11.3106C18.0852 11.3526 17.9947 11.3741 17.9012 11.3741H12.8659C12.9042 11.5393 12.9514 11.7299 12.9977 11.9342C13.2751 13.1169 14.0052 16.2623 14.7853 16.2623H14.8021H14.8109H14.8277C15.4337 16.2623 15.7456 15.3895 16.4284 13.4766L16.4372 13.4551C16.5484 13.1501 16.6724 12.8022 16.8042 12.4337L16.8386 12.3408C16.8898 12.2177 17.0305 12.1541 17.1545 12.2049C17.244 12.2392 17.3079 12.3281 17.3079 12.4259C17.3079 12.4513 17.304 12.4728 17.2991 12.4933L17.2696 12.5862C17.1968 12.8149 17.125 13.1247 17.0344 13.4854C16.6291 15.1559 16.0142 17.6787 14.444 17.6787H14.4312C13.4158 17.6699 12.8098 16.059 12.549 15.368C12.063 14.0787 11.696 12.7093 11.3419 11.379H6.71677L5.75653 14.4355L5.74374 14.4228C5.59911 14.6476 5.29608 14.715 5.0698 14.5714C4.92911 14.4824 4.84351 14.3299 4.84351 14.1647V14.1481L4.90353 13.8001C5.03536 13.0162 5.1977 12.1971 5.37676 11.3751H3.41397L3.40512 11.3663C3.0037 11.3067 2.72626 10.9343 2.78627 10.5355C2.8335 10.2256 3.07257 9.98028 3.37954 9.92456C3.45628 9.91576 3.53302 9.91185 3.60976 9.91576H3.70322C4.32207 9.92456 4.97928 9.93727 5.70438 9.94509C6.72464 5.82416 7.90625 3.72949 9.22067 3.72558C10.6286 3.72558 11.6744 6.90913 12.5107 10.0252L12.5146 10.0379C14.2305 10.0722 16.0653 10.123 17.8441 10.2501L17.9209 10.2588C17.9504 10.2588 17.976 10.2628 18.0065 10.2676H18.0153L18.0242 10.2716H18.0281C18.3321 10.3312 18.5328 10.6283 18.4689 10.9294Z" fill="#1E61F0"/></svg> <span class="hidden md:inline text-xs uppercase text-black-600 ml-2">documentation</span></a></div>
|
|
216
|
+
<div id="algolia-search-header"></div>
|
|
217
|
+
</div>
|
|
218
|
+
|
|
219
|
+
</div>
|
|
220
|
+
</div>
|
|
221
|
+
|
|
222
|
+
</div>
|
|
223
|
+
<div class="top-12 left-0 right-0 fixed bg-white z-10">
|
|
224
|
+
<div class="w-full overflow-scroll md:overflow-auto pt-5 pl-5">
|
|
225
|
+
<div class="box-border">
|
|
226
|
+
|
|
227
|
+
<div class="box-border flex flex-row flex-nowrap items-center border-solid border-b border-black-200 h-12 px-4 justify-start"
|
|
228
|
+
style="margin-left: -20px; margin-top: -20px;">
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
<div class="flex-initial mr-4 text-sm p-2 transition hover:bg-amp-blue-950 hover:rounded hover:p-2 relative"><a class="no-underline font-normal " href="/docs/get-started">Get Started</a></div>
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
<div class="flex-initial mr-4 text-sm p-2 transition hover:bg-amp-blue-950 hover:rounded hover:p-2 relative"><a class="no-underline font-normal " href="/docs/data">Data</a></div>
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
<div class="flex-initial mr-4 text-sm p-2 transition hover:bg-amp-blue-950 hover:rounded hover:p-2 relative"><a class="no-underline font-normal " href="/docs/analytics">Analytics</a></div>
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
<div class="flex-initial mr-4 text-sm p-2 transition hover:bg-amp-blue-950 hover:rounded hover:p-2 relative"><a class="no-underline font-normal " href="/docs/amplitude-ai">Amplitude AI</a></div>
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
<div class="flex-initial mr-4 text-sm p-2 transition hover:bg-amp-blue-950 hover:rounded hover:p-2 relative"><a class="no-underline font-normal " href="/docs/session-replay">Session Replay</a></div>
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
<div class="flex-initial mr-4 text-sm p-2 transition hover:bg-amp-blue-950 hover:rounded hover:p-2 relative"><a class="no-underline font-normal " href="/docs/guides-and-surveys">Guides and Surveys</a></div>
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
<div class="flex-initial mr-4 text-sm p-2 transition hover:bg-amp-blue-950 hover:rounded hover:p-2 relative"><a class="no-underline font-normal " href="/docs/assistant">AI Assistant</a></div>
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
<div class="flex-initial mr-4 text-sm p-2 transition hover:bg-amp-blue-950 hover:rounded hover:p-2 relative"><a class="no-underline font-normal " href="/docs/experiment-home">Experiment</a></div>
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
<div class="flex-initial mr-4 text-sm p-2 transition hover:bg-amp-blue-950 hover:rounded hover:p-2 relative"><a class="no-underline font-normal " href="/docs/admin">Admin</a></div>
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
<div class="flex-initial mr-4 text-sm p-2 inline w-max" x-data="{ open: false }"><button
|
|
268
|
+
@click="open = !open" class="font-normal -mb-[11px] text-[#111827]">Developers <svg class="inline fill-[#111827]" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none"><g id="icon-chevron-down"><path id="Vector" d="M10.25 10.6338L13.8837 7L15 8.11625L10.25 12.8663L5.5 8.11625L6.61625 7L10.25 10.6338Z" fill="#5A5E68"/></g></svg></button>
|
|
269
|
+
<div x-cloak x-show="open" x-transition @click.outside="open = false" class="mt-4 py-2 right-4 sm:right-auto absolute border border-amp-gray-100 rounded flex flex-col shadow-lg top-4 bg-white w-48 p-4 font-normal z-20">
|
|
270
|
+
|
|
271
|
+
<a class="no-underline pl-4 py-2 font-light hover:bg-amp-blue-950 hover:rounded" href="/docs/sdks">SDKs</a>
|
|
272
|
+
|
|
273
|
+
<a class="no-underline pl-4 py-2 font-light hover:bg-amp-blue-950 hover:rounded" href="/docs/apis">APIs</a>
|
|
274
|
+
|
|
275
|
+
</div>
|
|
276
|
+
</div>
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
<div class="flex-initial mr-4 text-sm p-2 transition hover:bg-amp-blue-950 hover:rounded hover:p-2 relative"><a class="no-underline font-normal " href="/docs/partners">Partners</a></div>
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
<div class="flex-initial mr-4 text-sm p-2 transition hover:bg-amp-blue-950 hover:rounded hover:p-2 relative"><a class="no-underline font-normal " href="/docs/faq">FAQ</a></div>
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
</div>
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
</div>
|
|
291
|
+
</div>
|
|
292
|
+
|
|
293
|
+
</div>
|
|
294
|
+
|
|
295
|
+
<div
|
|
296
|
+
class="w-64 top-24 bg-white bottom-0 border-solid border-r border-black-200 -left-60 lg:left-0 lg:translate-x-0 lg:block z-10 fixed transition shadow overflow-visible lg:overflow-auto lg:overscroll-contain" :class="{ 'translate-x-[240px]': sidebarOpen }">
|
|
297
|
+
<button @click="sidebarOpen = !sidebarOpen" class="absolute lg:hidden left-0 z-50 w-4 translate-x-[245px] translate-y-8" :class="{ 'rotate-180': sidebarOpen, 'translate-x-[250px]' : sidebarOpen }"><svg xmlns="http://www.w3.org/2000/svg" width="21" height="24" viewBox="0 0 21 24" fill="none"><rect x="0.5" y="0.5" width="20" height="23" rx="3.5" fill="white"/><rect x="0.5" y="0.5" width="20" height="23" rx="3.5" stroke="#DEDFE2"/><g clip-path="url(#clip0_671_1270)"><path d="M11.007 11.8L8.09998 8.893L8.99298 8L12.793 11.8L8.99298 15.6L8.09998 14.707L11.007 11.8Z" fill="#1E2024"/></g><defs><clipPath id="clip0_671_1270"><rect width="16" height="16" fill="white" transform="translate(2.5 4)"/></clipPath></defs></svg></button>
|
|
298
|
+
<div class="h-full overflow-scroll overscroll-contain">
|
|
299
|
+
|
|
300
|
+
<amp-side-nav current-uri="/docs/sdks/analytics/browser/browser-unified-sdk" nav-title="analytics_sdks">
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
<amp-nav-item
|
|
306
|
+
title="Analytics SDKs"
|
|
307
|
+
url="/docs/sdks/analytics"
|
|
308
|
+
slug="analytics-sdks"
|
|
309
|
+
level="1"
|
|
310
|
+
>
|
|
311
|
+
</amp-nav-item>
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
<amp-nav-item
|
|
319
|
+
title="Browser"
|
|
320
|
+
slug="browser"
|
|
321
|
+
has-children
|
|
322
|
+
level="1">
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
<amp-nav-item
|
|
329
|
+
title="Browser Unified SDK"
|
|
330
|
+
url="/docs/sdks/analytics/browser/browser-unified-sdk"
|
|
331
|
+
slug="browser-unified-sdk"
|
|
332
|
+
parent-slug="browser"
|
|
333
|
+
level="2"
|
|
334
|
+
is-current>
|
|
335
|
+
</amp-nav-item>
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
<amp-nav-item
|
|
344
|
+
title="Browser SDK 2"
|
|
345
|
+
slug="browser-sdk-2"
|
|
346
|
+
parent-slug="browser"
|
|
347
|
+
has-children
|
|
348
|
+
level="2">
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
<amp-nav-item
|
|
352
|
+
title="Browser SDK 2"
|
|
353
|
+
url="/docs/sdks/analytics/browser/browser-sdk-2"
|
|
354
|
+
slug="browser-sdk-2"
|
|
355
|
+
parent-slug="browser-sdk-2"
|
|
356
|
+
|
|
357
|
+
level="3"
|
|
358
|
+
>
|
|
359
|
+
</amp-nav-item>
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
<amp-nav-item
|
|
363
|
+
title="Ampli for Browser SDK 2.0"
|
|
364
|
+
url="/docs/sdks/analytics/browser/ampli-for-browser-sdk-2-0"
|
|
365
|
+
slug="ampli-for-browser-sdk-20"
|
|
366
|
+
parent-slug="browser-sdk-2"
|
|
367
|
+
|
|
368
|
+
level="3"
|
|
369
|
+
>
|
|
370
|
+
</amp-nav-item>
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
<amp-nav-item
|
|
374
|
+
title="Migrate from Browser SDK 1.0 to 2.0"
|
|
375
|
+
url="/docs/sdks/analytics/browser/migrate-from-browser-sdk-1-0-to-2-0"
|
|
376
|
+
slug="migrate-from-browser-sdk-10-to-20"
|
|
377
|
+
parent-slug="browser-sdk-2"
|
|
378
|
+
|
|
379
|
+
level="3"
|
|
380
|
+
>
|
|
381
|
+
</amp-nav-item>
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
<amp-nav-item
|
|
385
|
+
title="Cookies and consent management (Browser SDK)"
|
|
386
|
+
url="/docs/sdks/analytics/browser/cookies-and-consent-management"
|
|
387
|
+
slug="cookies-and-consent-management-browser-sdk"
|
|
388
|
+
parent-slug="browser-sdk-2"
|
|
389
|
+
|
|
390
|
+
level="3"
|
|
391
|
+
>
|
|
392
|
+
</amp-nav-item>
|
|
393
|
+
|
|
394
|
+
</amp-nav-item>
|
|
395
|
+
|
|
396
|
+
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
|
|
402
|
+
<amp-nav-item
|
|
403
|
+
title="Autocapture Plugin"
|
|
404
|
+
url="/docs/sdks/analytics/browser/autocapture-plugin"
|
|
405
|
+
slug="autocapture-plugin"
|
|
406
|
+
parent-slug="browser"
|
|
407
|
+
level="2"
|
|
408
|
+
>
|
|
409
|
+
</amp-nav-item>
|
|
410
|
+
|
|
411
|
+
|
|
412
|
+
|
|
413
|
+
|
|
414
|
+
|
|
415
|
+
|
|
416
|
+
|
|
417
|
+
<amp-nav-item
|
|
418
|
+
title="Browser SDK 1"
|
|
419
|
+
slug="browser-sdk-1"
|
|
420
|
+
parent-slug="browser"
|
|
421
|
+
has-children
|
|
422
|
+
level="2">
|
|
423
|
+
|
|
424
|
+
|
|
425
|
+
<amp-nav-item
|
|
426
|
+
title="Browser SDK 1"
|
|
427
|
+
url="/docs/sdks/analytics/browser/browser-sdk-1"
|
|
428
|
+
slug="browser-sdk-1"
|
|
429
|
+
parent-slug="browser-sdk-1"
|
|
430
|
+
|
|
431
|
+
level="3"
|
|
432
|
+
>
|
|
433
|
+
</amp-nav-item>
|
|
434
|
+
|
|
435
|
+
|
|
436
|
+
<amp-nav-item
|
|
437
|
+
title="Ampli for Browser SDK 1.0"
|
|
438
|
+
url="/docs/sdks/analytics/browser/ampli-for-browser-sdk-1-0"
|
|
439
|
+
slug="ampli-for-browser-sdk-10"
|
|
440
|
+
parent-slug="browser-sdk-1"
|
|
441
|
+
|
|
442
|
+
level="3"
|
|
443
|
+
>
|
|
444
|
+
</amp-nav-item>
|
|
445
|
+
|
|
446
|
+
</amp-nav-item>
|
|
447
|
+
|
|
448
|
+
|
|
449
|
+
|
|
450
|
+
</amp-nav-item>
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
|
|
456
|
+
<amp-nav-item
|
|
457
|
+
title="Android"
|
|
458
|
+
slug="android"
|
|
459
|
+
has-children
|
|
460
|
+
level="1">
|
|
461
|
+
|
|
462
|
+
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
|
|
466
|
+
<amp-nav-item
|
|
467
|
+
title="Android-Kotlin SDK"
|
|
468
|
+
url="/docs/sdks/analytics/android/android-kotlin-sdk"
|
|
469
|
+
slug="android-kotlin-sdk"
|
|
470
|
+
parent-slug="android"
|
|
471
|
+
level="2"
|
|
472
|
+
>
|
|
473
|
+
</amp-nav-item>
|
|
474
|
+
|
|
475
|
+
|
|
476
|
+
|
|
477
|
+
|
|
478
|
+
|
|
479
|
+
|
|
480
|
+
|
|
481
|
+
<amp-nav-item
|
|
482
|
+
title="Ampli for Android-Kotlin SDK"
|
|
483
|
+
url="/docs/sdks/analytics/android/ampli-for-android-kotlin-sdk"
|
|
484
|
+
slug="ampli-for-android-kotlin-sdk"
|
|
485
|
+
parent-slug="android"
|
|
486
|
+
level="2"
|
|
487
|
+
>
|
|
488
|
+
</amp-nav-item>
|
|
489
|
+
|
|
490
|
+
|
|
491
|
+
|
|
492
|
+
</amp-nav-item>
|
|
493
|
+
|
|
494
|
+
|
|
495
|
+
|
|
496
|
+
|
|
497
|
+
|
|
498
|
+
<amp-nav-item
|
|
499
|
+
title="Node"
|
|
500
|
+
slug="node"
|
|
501
|
+
has-children
|
|
502
|
+
level="1">
|
|
503
|
+
|
|
504
|
+
|
|
505
|
+
|
|
506
|
+
|
|
507
|
+
|
|
508
|
+
<amp-nav-item
|
|
509
|
+
title="Node.js SDK"
|
|
510
|
+
url="/docs/sdks/analytics/node/node-js-sdk"
|
|
511
|
+
slug="nodejs-sdk"
|
|
512
|
+
parent-slug="node"
|
|
513
|
+
level="2"
|
|
514
|
+
>
|
|
515
|
+
</amp-nav-item>
|
|
516
|
+
|
|
517
|
+
|
|
518
|
+
|
|
519
|
+
|
|
520
|
+
|
|
521
|
+
|
|
522
|
+
|
|
523
|
+
<amp-nav-item
|
|
524
|
+
title="Node.js Ampli Wrapper"
|
|
525
|
+
url="/docs/sdks/analytics/node/node-js-ampli-wrapper"
|
|
526
|
+
slug="nodejs-ampli-wrapper"
|
|
527
|
+
parent-slug="node"
|
|
528
|
+
level="2"
|
|
529
|
+
>
|
|
530
|
+
</amp-nav-item>
|
|
531
|
+
|
|
532
|
+
|
|
533
|
+
|
|
534
|
+
</amp-nav-item>
|
|
535
|
+
|
|
536
|
+
|
|
537
|
+
|
|
538
|
+
|
|
539
|
+
|
|
540
|
+
<amp-nav-item
|
|
541
|
+
title="Go"
|
|
542
|
+
slug="go"
|
|
543
|
+
has-children
|
|
544
|
+
level="1">
|
|
545
|
+
|
|
546
|
+
|
|
547
|
+
|
|
548
|
+
|
|
549
|
+
|
|
550
|
+
<amp-nav-item
|
|
551
|
+
title="Go SDK"
|
|
552
|
+
url="/docs/sdks/analytics/go/go-sdk"
|
|
553
|
+
slug="go-sdk"
|
|
554
|
+
parent-slug="go"
|
|
555
|
+
level="2"
|
|
556
|
+
>
|
|
557
|
+
</amp-nav-item>
|
|
558
|
+
|
|
559
|
+
|
|
560
|
+
|
|
561
|
+
|
|
562
|
+
|
|
563
|
+
|
|
564
|
+
|
|
565
|
+
<amp-nav-item
|
|
566
|
+
title="Ampli for Go"
|
|
567
|
+
url="/docs/sdks/analytics/go/ampli-for-go"
|
|
568
|
+
slug="ampli-for-go"
|
|
569
|
+
parent-slug="go"
|
|
570
|
+
level="2"
|
|
571
|
+
>
|
|
572
|
+
</amp-nav-item>
|
|
573
|
+
|
|
574
|
+
|
|
575
|
+
|
|
576
|
+
</amp-nav-item>
|
|
577
|
+
|
|
578
|
+
|
|
579
|
+
|
|
580
|
+
|
|
581
|
+
|
|
582
|
+
<amp-nav-item
|
|
583
|
+
title="Python"
|
|
584
|
+
slug="python"
|
|
585
|
+
has-children
|
|
586
|
+
level="1">
|
|
587
|
+
|
|
588
|
+
|
|
589
|
+
|
|
590
|
+
|
|
591
|
+
|
|
592
|
+
<amp-nav-item
|
|
593
|
+
title="Python SDK"
|
|
594
|
+
url="/docs/sdks/analytics-sdks/python/python-sdk"
|
|
595
|
+
slug="python-sdk"
|
|
596
|
+
parent-slug="python"
|
|
597
|
+
level="2"
|
|
598
|
+
>
|
|
599
|
+
</amp-nav-item>
|
|
600
|
+
|
|
601
|
+
|
|
602
|
+
|
|
603
|
+
|
|
604
|
+
|
|
605
|
+
|
|
606
|
+
|
|
607
|
+
<amp-nav-item
|
|
608
|
+
title="Ampli for Python SDK"
|
|
609
|
+
url="/docs/sdks/analytics-sdks/python/ampli-for-python-sdk"
|
|
610
|
+
slug="ampli-for-python-sdk"
|
|
611
|
+
parent-slug="python"
|
|
612
|
+
level="2"
|
|
613
|
+
>
|
|
614
|
+
</amp-nav-item>
|
|
615
|
+
|
|
616
|
+
|
|
617
|
+
|
|
618
|
+
</amp-nav-item>
|
|
619
|
+
|
|
620
|
+
|
|
621
|
+
|
|
622
|
+
|
|
623
|
+
|
|
624
|
+
<amp-nav-item
|
|
625
|
+
title="iOS"
|
|
626
|
+
slug="ios"
|
|
627
|
+
has-children
|
|
628
|
+
level="1">
|
|
629
|
+
|
|
630
|
+
|
|
631
|
+
|
|
632
|
+
|
|
633
|
+
|
|
634
|
+
<amp-nav-item
|
|
635
|
+
title="iOS Swift SDK"
|
|
636
|
+
url="/docs/sdks/analytics/ios/ios-swift-sdk"
|
|
637
|
+
slug="ios-swift-sdk"
|
|
638
|
+
parent-slug="ios"
|
|
639
|
+
level="2"
|
|
640
|
+
>
|
|
641
|
+
</amp-nav-item>
|
|
642
|
+
|
|
643
|
+
|
|
644
|
+
|
|
645
|
+
|
|
646
|
+
|
|
647
|
+
|
|
648
|
+
|
|
649
|
+
<amp-nav-item
|
|
650
|
+
title="Ampli for iOS Swift SDK"
|
|
651
|
+
url="/docs/sdks/analytics/ios/ampli-for-ios-swift-sdk"
|
|
652
|
+
slug="ampli-for-ios-swift-sdk"
|
|
653
|
+
parent-slug="ios"
|
|
654
|
+
level="2"
|
|
655
|
+
>
|
|
656
|
+
</amp-nav-item>
|
|
657
|
+
|
|
658
|
+
|
|
659
|
+
|
|
660
|
+
|
|
661
|
+
|
|
662
|
+
|
|
663
|
+
|
|
664
|
+
<amp-nav-item
|
|
665
|
+
title="Unified SDK for Swift"
|
|
666
|
+
url="/docs/sdks/analytics/ios/unified-sdk"
|
|
667
|
+
slug="unified-sdk-for-swift"
|
|
668
|
+
parent-slug="ios"
|
|
669
|
+
level="2"
|
|
670
|
+
>
|
|
671
|
+
</amp-nav-item>
|
|
672
|
+
|
|
673
|
+
|
|
674
|
+
|
|
675
|
+
</amp-nav-item>
|
|
676
|
+
|
|
677
|
+
|
|
678
|
+
|
|
679
|
+
|
|
680
|
+
|
|
681
|
+
<amp-nav-item
|
|
682
|
+
title="Flutter"
|
|
683
|
+
slug="flutter"
|
|
684
|
+
has-children
|
|
685
|
+
level="1">
|
|
686
|
+
|
|
687
|
+
|
|
688
|
+
|
|
689
|
+
|
|
690
|
+
|
|
691
|
+
<amp-nav-item
|
|
692
|
+
title="Flutter SDK 3"
|
|
693
|
+
url="/docs/sdks/analytics/flutter/flutter-sdk"
|
|
694
|
+
slug="flutter-sdk-3"
|
|
695
|
+
parent-slug="flutter"
|
|
696
|
+
level="2"
|
|
697
|
+
>
|
|
698
|
+
</amp-nav-item>
|
|
699
|
+
|
|
700
|
+
|
|
701
|
+
|
|
702
|
+
|
|
703
|
+
|
|
704
|
+
|
|
705
|
+
|
|
706
|
+
<amp-nav-item
|
|
707
|
+
title="Flutter SDK 4"
|
|
708
|
+
url="/docs/sdks/analytics/flutter/flutter-sdk-4"
|
|
709
|
+
slug="flutter-sdk-4"
|
|
710
|
+
parent-slug="flutter"
|
|
711
|
+
level="2"
|
|
712
|
+
>
|
|
713
|
+
</amp-nav-item>
|
|
714
|
+
|
|
715
|
+
|
|
716
|
+
|
|
717
|
+
|
|
718
|
+
|
|
719
|
+
|
|
720
|
+
|
|
721
|
+
<amp-nav-item
|
|
722
|
+
title="Flutter SDK 4.0 Migration Guide"
|
|
723
|
+
url="/docs/sdks/analytics/flutter/flutter-sdk-4-0-migration-guide"
|
|
724
|
+
slug="flutter-sdk-40-migration-guide"
|
|
725
|
+
parent-slug="flutter"
|
|
726
|
+
level="2"
|
|
727
|
+
>
|
|
728
|
+
</amp-nav-item>
|
|
729
|
+
|
|
730
|
+
|
|
731
|
+
|
|
732
|
+
</amp-nav-item>
|
|
733
|
+
|
|
734
|
+
|
|
735
|
+
|
|
736
|
+
|
|
737
|
+
|
|
738
|
+
<amp-nav-item
|
|
739
|
+
title="Java"
|
|
740
|
+
slug="java"
|
|
741
|
+
has-children
|
|
742
|
+
level="1">
|
|
743
|
+
|
|
744
|
+
|
|
745
|
+
|
|
746
|
+
|
|
747
|
+
|
|
748
|
+
<amp-nav-item
|
|
749
|
+
title="JRE Java SDK"
|
|
750
|
+
url="/docs/sdks/analytics/java/jre-java-sdk"
|
|
751
|
+
slug="jre-java-sdk"
|
|
752
|
+
parent-slug="java"
|
|
753
|
+
level="2"
|
|
754
|
+
>
|
|
755
|
+
</amp-nav-item>
|
|
756
|
+
|
|
757
|
+
|
|
758
|
+
|
|
759
|
+
|
|
760
|
+
|
|
761
|
+
|
|
762
|
+
|
|
763
|
+
<amp-nav-item
|
|
764
|
+
title="Ampli for Java SDK"
|
|
765
|
+
url="/docs/sdks/analytics/java/ampli-for-java-sdk"
|
|
766
|
+
slug="ampli-for-java-sdk"
|
|
767
|
+
parent-slug="java"
|
|
768
|
+
level="2"
|
|
769
|
+
>
|
|
770
|
+
</amp-nav-item>
|
|
771
|
+
|
|
772
|
+
|
|
773
|
+
|
|
774
|
+
</amp-nav-item>
|
|
775
|
+
|
|
776
|
+
|
|
777
|
+
|
|
778
|
+
|
|
779
|
+
|
|
780
|
+
<amp-nav-item
|
|
781
|
+
title="React Native"
|
|
782
|
+
slug="react-native"
|
|
783
|
+
has-children
|
|
784
|
+
level="1">
|
|
785
|
+
|
|
786
|
+
|
|
787
|
+
|
|
788
|
+
|
|
789
|
+
|
|
790
|
+
<amp-nav-item
|
|
791
|
+
title="React Native SDK"
|
|
792
|
+
url="/docs/sdks/analytics/react-native/react-native-sdk"
|
|
793
|
+
slug="react-native-sdk"
|
|
794
|
+
parent-slug="react-native"
|
|
795
|
+
level="2"
|
|
796
|
+
>
|
|
797
|
+
</amp-nav-item>
|
|
798
|
+
|
|
799
|
+
|
|
800
|
+
|
|
801
|
+
|
|
802
|
+
|
|
803
|
+
|
|
804
|
+
|
|
805
|
+
<amp-nav-item
|
|
806
|
+
title="Migrate to the latest React Native SDK"
|
|
807
|
+
url="/docs/sdks/analytics/react-native/migrate-to-the-latest-react-native-sdk"
|
|
808
|
+
slug="migrate-to-the-latest-react-native-sdk"
|
|
809
|
+
parent-slug="react-native"
|
|
810
|
+
level="2"
|
|
811
|
+
>
|
|
812
|
+
</amp-nav-item>
|
|
813
|
+
|
|
814
|
+
|
|
815
|
+
|
|
816
|
+
|
|
817
|
+
|
|
818
|
+
|
|
819
|
+
|
|
820
|
+
<amp-nav-item
|
|
821
|
+
title="Ampli for the React Native SDK"
|
|
822
|
+
url="/docs/sdks/analytics/react-native/ampli-for-the-react-native-sdk"
|
|
823
|
+
slug="ampli-for-the-react-native-sdk"
|
|
824
|
+
parent-slug="react-native"
|
|
825
|
+
level="2"
|
|
826
|
+
>
|
|
827
|
+
</amp-nav-item>
|
|
828
|
+
|
|
829
|
+
|
|
830
|
+
|
|
831
|
+
</amp-nav-item>
|
|
832
|
+
|
|
833
|
+
|
|
834
|
+
|
|
835
|
+
|
|
836
|
+
|
|
837
|
+
<amp-nav-item
|
|
838
|
+
title="Unreal"
|
|
839
|
+
slug="unreal"
|
|
840
|
+
has-children
|
|
841
|
+
level="1">
|
|
842
|
+
|
|
843
|
+
|
|
844
|
+
|
|
845
|
+
|
|
846
|
+
|
|
847
|
+
<amp-nav-item
|
|
848
|
+
title="Unreal SDK"
|
|
849
|
+
url="/docs/sdks/analytics/unreal/unreal-sdk"
|
|
850
|
+
slug="unreal-sdk"
|
|
851
|
+
parent-slug="unreal"
|
|
852
|
+
level="2"
|
|
853
|
+
>
|
|
854
|
+
</amp-nav-item>
|
|
855
|
+
|
|
856
|
+
|
|
857
|
+
|
|
858
|
+
</amp-nav-item>
|
|
859
|
+
|
|
860
|
+
|
|
861
|
+
|
|
862
|
+
|
|
863
|
+
|
|
864
|
+
<amp-nav-item
|
|
865
|
+
title="Unity"
|
|
866
|
+
slug="unity"
|
|
867
|
+
has-children
|
|
868
|
+
level="1">
|
|
869
|
+
|
|
870
|
+
|
|
871
|
+
|
|
872
|
+
|
|
873
|
+
|
|
874
|
+
<amp-nav-item
|
|
875
|
+
title="Unity SDK"
|
|
876
|
+
url="/docs/sdks/analytics/unity/unity-sdk"
|
|
877
|
+
slug="unity-sdk"
|
|
878
|
+
parent-slug="unity"
|
|
879
|
+
level="2"
|
|
880
|
+
>
|
|
881
|
+
</amp-nav-item>
|
|
882
|
+
|
|
883
|
+
|
|
884
|
+
|
|
885
|
+
</amp-nav-item>
|
|
886
|
+
|
|
887
|
+
|
|
888
|
+
|
|
889
|
+
|
|
890
|
+
|
|
891
|
+
<amp-nav-item
|
|
892
|
+
title="Maintenance SDKs"
|
|
893
|
+
slug="maintenance-sdks"
|
|
894
|
+
has-children
|
|
895
|
+
level="1">
|
|
896
|
+
|
|
897
|
+
|
|
898
|
+
|
|
899
|
+
|
|
900
|
+
|
|
901
|
+
<amp-nav-item
|
|
902
|
+
title="Marketing Analytics SDK"
|
|
903
|
+
slug="marketing-analytics-sdk"
|
|
904
|
+
parent-slug="maintenance-sdks"
|
|
905
|
+
has-children
|
|
906
|
+
level="2">
|
|
907
|
+
|
|
908
|
+
|
|
909
|
+
<amp-nav-item
|
|
910
|
+
title="Marketing Analytics SDK"
|
|
911
|
+
url="/docs/sdks/analytics/browser/marketing-analytics-sdk"
|
|
912
|
+
slug="marketing-analytics-sdk"
|
|
913
|
+
parent-slug="marketing-analytics-sdk"
|
|
914
|
+
|
|
915
|
+
level="3"
|
|
916
|
+
>
|
|
917
|
+
</amp-nav-item>
|
|
918
|
+
|
|
919
|
+
|
|
920
|
+
<amp-nav-item
|
|
921
|
+
title="Migrate from Marketing Analytics to Browser SDK 2.0"
|
|
922
|
+
url="/docs/sdks/analytics/browser/migrate-from-marketing-analytics-to-browser-sdk-2-0"
|
|
923
|
+
slug="migrate-from-marketing-analytics-to-browser-sdk-20"
|
|
924
|
+
parent-slug="marketing-analytics-sdk"
|
|
925
|
+
|
|
926
|
+
level="3"
|
|
927
|
+
>
|
|
928
|
+
</amp-nav-item>
|
|
929
|
+
|
|
930
|
+
</amp-nav-item>
|
|
931
|
+
|
|
932
|
+
|
|
933
|
+
|
|
934
|
+
|
|
935
|
+
|
|
936
|
+
|
|
937
|
+
|
|
938
|
+
<amp-nav-item
|
|
939
|
+
title="Javascript SDK"
|
|
940
|
+
slug="javascript-sdk"
|
|
941
|
+
parent-slug="maintenance-sdks"
|
|
942
|
+
has-children
|
|
943
|
+
level="2">
|
|
944
|
+
|
|
945
|
+
|
|
946
|
+
<amp-nav-item
|
|
947
|
+
title="Javascript SDK"
|
|
948
|
+
url="/docs/sdks/analytics/browser/javascript-sdk"
|
|
949
|
+
slug="javascript-sdk"
|
|
950
|
+
parent-slug="javascript-sdk"
|
|
951
|
+
|
|
952
|
+
level="3"
|
|
953
|
+
>
|
|
954
|
+
</amp-nav-item>
|
|
955
|
+
|
|
956
|
+
|
|
957
|
+
<amp-nav-item
|
|
958
|
+
title="Ampli for Javascript SDK"
|
|
959
|
+
url="/docs/sdks/analytics/browser/ampli-for-javascript-sdk"
|
|
960
|
+
slug="ampli-for-javascript-sdk"
|
|
961
|
+
parent-slug="javascript-sdk"
|
|
962
|
+
|
|
963
|
+
level="3"
|
|
964
|
+
>
|
|
965
|
+
</amp-nav-item>
|
|
966
|
+
|
|
967
|
+
|
|
968
|
+
<amp-nav-item
|
|
969
|
+
title="Migrate from Javascript SDK to Browser SDK 1.0"
|
|
970
|
+
url="/docs/sdks/analytics/browser/migrate-from-javascript-sdk-to-browser-sdk-1-0"
|
|
971
|
+
slug="migrate-from-javascript-sdk-to-browser-sdk-10"
|
|
972
|
+
parent-slug="javascript-sdk"
|
|
973
|
+
|
|
974
|
+
level="3"
|
|
975
|
+
>
|
|
976
|
+
</amp-nav-item>
|
|
977
|
+
|
|
978
|
+
|
|
979
|
+
<amp-nav-item
|
|
980
|
+
title="Migrate from Javascript SDK to Browser SDK 2.0"
|
|
981
|
+
url="/docs/sdks/analytics/browser/migrate-from-javascript-sdk-to-browser-sdk-2-0"
|
|
982
|
+
slug="migrate-from-javascript-sdk-to-browser-sdk-20"
|
|
983
|
+
parent-slug="javascript-sdk"
|
|
984
|
+
|
|
985
|
+
level="3"
|
|
986
|
+
>
|
|
987
|
+
</amp-nav-item>
|
|
988
|
+
|
|
989
|
+
|
|
990
|
+
<amp-nav-item
|
|
991
|
+
title="Cookies and Consent Management (JavaScript SDK)"
|
|
992
|
+
url="/docs/sdks/analytics/browser/cookies-and-consent-management-javascript-sdk"
|
|
993
|
+
slug="cookies-and-consent-management-javascript-sdk"
|
|
994
|
+
parent-slug="javascript-sdk"
|
|
995
|
+
|
|
996
|
+
level="3"
|
|
997
|
+
>
|
|
998
|
+
</amp-nav-item>
|
|
999
|
+
|
|
1000
|
+
</amp-nav-item>
|
|
1001
|
+
|
|
1002
|
+
|
|
1003
|
+
|
|
1004
|
+
|
|
1005
|
+
|
|
1006
|
+
|
|
1007
|
+
|
|
1008
|
+
<amp-nav-item
|
|
1009
|
+
title="React Native SDK (maintenance)"
|
|
1010
|
+
url="/docs/sdks/analytics/react-native/react-native-sdk-maintenance"
|
|
1011
|
+
slug="react-native-sdk-maintenance"
|
|
1012
|
+
parent-slug="maintenance-sdks"
|
|
1013
|
+
level="2"
|
|
1014
|
+
>
|
|
1015
|
+
</amp-nav-item>
|
|
1016
|
+
|
|
1017
|
+
|
|
1018
|
+
|
|
1019
|
+
|
|
1020
|
+
|
|
1021
|
+
|
|
1022
|
+
|
|
1023
|
+
<amp-nav-item
|
|
1024
|
+
title="iOS SDK"
|
|
1025
|
+
url="/docs/sdks/analytics/ios/ios-sdk"
|
|
1026
|
+
slug="ios-sdk"
|
|
1027
|
+
parent-slug="maintenance-sdks"
|
|
1028
|
+
level="2"
|
|
1029
|
+
>
|
|
1030
|
+
</amp-nav-item>
|
|
1031
|
+
|
|
1032
|
+
|
|
1033
|
+
|
|
1034
|
+
|
|
1035
|
+
|
|
1036
|
+
|
|
1037
|
+
|
|
1038
|
+
<amp-nav-item
|
|
1039
|
+
title="Node SDK"
|
|
1040
|
+
slug="node-sdk"
|
|
1041
|
+
parent-slug="maintenance-sdks"
|
|
1042
|
+
has-children
|
|
1043
|
+
level="2">
|
|
1044
|
+
|
|
1045
|
+
|
|
1046
|
+
<amp-nav-item
|
|
1047
|
+
title="Node SDK"
|
|
1048
|
+
url="/docs/sdks/analytics/node/node-sdk"
|
|
1049
|
+
slug="node-sdk"
|
|
1050
|
+
parent-slug="node-sdk"
|
|
1051
|
+
|
|
1052
|
+
level="3"
|
|
1053
|
+
>
|
|
1054
|
+
</amp-nav-item>
|
|
1055
|
+
|
|
1056
|
+
|
|
1057
|
+
<amp-nav-item
|
|
1058
|
+
title="Ampli for Node SDK"
|
|
1059
|
+
url="/docs/sdks/analytics/node/ampli-for-node-sdk"
|
|
1060
|
+
slug="ampli-for-node-sdk"
|
|
1061
|
+
parent-slug="node-sdk"
|
|
1062
|
+
|
|
1063
|
+
level="3"
|
|
1064
|
+
>
|
|
1065
|
+
</amp-nav-item>
|
|
1066
|
+
|
|
1067
|
+
|
|
1068
|
+
<amp-nav-item
|
|
1069
|
+
title="Node.js SDK Migration Guide"
|
|
1070
|
+
url="/docs/sdks/analytics/node/node-js-sdk-migration-guide"
|
|
1071
|
+
slug="nodejs-sdk-migration-guide"
|
|
1072
|
+
parent-slug="node-sdk"
|
|
1073
|
+
|
|
1074
|
+
level="3"
|
|
1075
|
+
>
|
|
1076
|
+
</amp-nav-item>
|
|
1077
|
+
|
|
1078
|
+
</amp-nav-item>
|
|
1079
|
+
|
|
1080
|
+
|
|
1081
|
+
|
|
1082
|
+
|
|
1083
|
+
|
|
1084
|
+
|
|
1085
|
+
|
|
1086
|
+
<amp-nav-item
|
|
1087
|
+
title="Android SDK 1.0"
|
|
1088
|
+
slug="android-sdk-10"
|
|
1089
|
+
parent-slug="maintenance-sdks"
|
|
1090
|
+
has-children
|
|
1091
|
+
level="2">
|
|
1092
|
+
|
|
1093
|
+
|
|
1094
|
+
<amp-nav-item
|
|
1095
|
+
title="Android SDK"
|
|
1096
|
+
url="/docs/sdks/analytics/android/android-sdk"
|
|
1097
|
+
slug="android-sdk"
|
|
1098
|
+
parent-slug="android-sdk-10"
|
|
1099
|
+
|
|
1100
|
+
level="3"
|
|
1101
|
+
>
|
|
1102
|
+
</amp-nav-item>
|
|
1103
|
+
|
|
1104
|
+
|
|
1105
|
+
<amp-nav-item
|
|
1106
|
+
title="Migrate to the Android-Kotlin SDK"
|
|
1107
|
+
url="/docs/sdks/analytics/android/migrate-to-the-android-kotlin-sdk"
|
|
1108
|
+
slug="migrate-to-the-android-kotlin-sdk"
|
|
1109
|
+
parent-slug="android-sdk-10"
|
|
1110
|
+
|
|
1111
|
+
level="3"
|
|
1112
|
+
>
|
|
1113
|
+
</amp-nav-item>
|
|
1114
|
+
|
|
1115
|
+
</amp-nav-item>
|
|
1116
|
+
|
|
1117
|
+
|
|
1118
|
+
|
|
1119
|
+
</amp-nav-item>
|
|
1120
|
+
|
|
1121
|
+
|
|
1122
|
+
</amp-side-nav>
|
|
1123
|
+
|
|
1124
|
+
</div>
|
|
1125
|
+
|
|
1126
|
+
</div>
|
|
1127
|
+
<div class="absolute top-24 left-0 lg:left-64 bottom-0 right-0 z-0 transition">
|
|
1128
|
+
<div class="max-w-screen-xl pt-8 mx-auto">
|
|
1129
|
+
<section class="w-full flex flex-col items-center">
|
|
1130
|
+
<div class="flex flex-row flex-nowrap w-full text-sm pl-6 lg:pl-8 text-gray-400">
|
|
1131
|
+
|
|
1132
|
+
<div class="mr-2 text-s text-gray-500 "><a class=""
|
|
1133
|
+
href="/docs/sdks">SDKs</a></div>
|
|
1134
|
+
<span class="mr-2">/</span><div class="mr-2 text-s text-gray-500 "><a class=""
|
|
1135
|
+
href="/docs/sdks/analytics">Amplitude Analytics SDK Catalog</a></div>
|
|
1136
|
+
<span class="mr-2">/</span><div class="mr-2 text-s text-gray-500 "><a class=""
|
|
1137
|
+
href="/docs/sdks/analytics/browser">Browser</a></div>
|
|
1138
|
+
<span class="mr-2">/</span><div class="mr-2 text-s text-gray-500 "><a class="font-semibold"
|
|
1139
|
+
href="/docs/sdks/analytics/browser/browser-unified-sdk">Browser Unified SDK</a></div>
|
|
1140
|
+
|
|
1141
|
+
|
|
1142
|
+
</div>
|
|
1143
|
+
<div class="flex flex-row w-full pt-8 px-6 lg:p-8">
|
|
1144
|
+
<div class="copy w-full">
|
|
1145
|
+
<div class="flex flex-row items-start justify-between">
|
|
1146
|
+
<h1 class="font-[Gellix] font-normal mb-5 max-w-3xl">Browser Unified SDK</h1>
|
|
1147
|
+
</div>
|
|
1148
|
+
<div
|
|
1149
|
+
class="prose prose-a:text-amp-blue prose-ol:list-decimal prose-ol:list-outside prose-pre:bg-[#fafafa] max-w-prose" data-headings-anchors data-math-root>
|
|
1150
|
+
|
|
1151
|
+
|
|
1152
|
+
|
|
1153
|
+
|
|
1154
|
+
|
|
1155
|
+
|
|
1156
|
+
|
|
1157
|
+
|
|
1158
|
+
<p>Amplitude offers multiple ways to install browser SDKs, each with different product support and version control options. This guide explains the three main installation methods and helps you choose the right approach for your needs.</p>
|
|
1159
|
+
<h2 id="choose-your-installation-method">Choose your installation method<a href="#choose-your-installation-method" class="heading-permalink" aria-hidden="true" title="Permalink"></a></h2>
|
|
1160
|
+
<p>Amplitude provides three main ways to install browser SDKs:</p>
|
|
1161
|
+
<table>
|
|
1162
|
+
<thead>
|
|
1163
|
+
<tr>
|
|
1164
|
+
<th>Method</th>
|
|
1165
|
+
<th>Description</th>
|
|
1166
|
+
<th>Version control</th>
|
|
1167
|
+
<th>Best for</th>
|
|
1168
|
+
</tr>
|
|
1169
|
+
</thead>
|
|
1170
|
+
<tbody>
|
|
1171
|
+
<tr>
|
|
1172
|
+
<td><a href="#unified-sdk-npm">Unified SDK (npm)</a></td>
|
|
1173
|
+
<td>Single npm package with all Amplitude features</td>
|
|
1174
|
+
<td>Customer-managed</td>
|
|
1175
|
+
<td>Teams requiring reproducible builds and strict change management</td>
|
|
1176
|
+
</tr>
|
|
1177
|
+
<tr>
|
|
1178
|
+
<td><a href="#unified-script-cdn">Unified Script (CDN)</a></td>
|
|
1179
|
+
<td>Single script tag that loads Amplitude capabilities</td>
|
|
1180
|
+
<td>Amplitude-managed</td>
|
|
1181
|
+
<td>Quick setup with automatic updates and sensible defaults</td>
|
|
1182
|
+
</tr>
|
|
1183
|
+
<tr>
|
|
1184
|
+
<td><a href="#google-tag-manager">GTM Template</a></td>
|
|
1185
|
+
<td>Google Tag Manager template</td>
|
|
1186
|
+
<td>Template version-controlled</td>
|
|
1187
|
+
<td>Teams using GTM for tag management</td>
|
|
1188
|
+
</tr>
|
|
1189
|
+
</tbody>
|
|
1190
|
+
</table>
|
|
1191
|
+
<h3 id="product-support-by-installation-method">Product support by installation method<a href="#product-support-by-installation-method" class="heading-permalink" aria-hidden="true" title="Permalink"></a></h3>
|
|
1192
|
+
<p>Different installation methods support different Amplitude products:</p>
|
|
1193
|
+
<table>
|
|
1194
|
+
<thead>
|
|
1195
|
+
<tr>
|
|
1196
|
+
<th>Product</th>
|
|
1197
|
+
<th>Unified Script (CDN)</th>
|
|
1198
|
+
<th>Unified SDK (npm)</th>
|
|
1199
|
+
<th>GTM Template</th>
|
|
1200
|
+
</tr>
|
|
1201
|
+
</thead>
|
|
1202
|
+
<tbody>
|
|
1203
|
+
<tr>
|
|
1204
|
+
<td>Analytics (<code>@amplitude/analytics-browser</code>)</td>
|
|
1205
|
+
<td>✅ Included</td>
|
|
1206
|
+
<td>✅ Included</td>
|
|
1207
|
+
<td>✅ Included</td>
|
|
1208
|
+
</tr>
|
|
1209
|
+
<tr>
|
|
1210
|
+
<td>Session Replay</td>
|
|
1211
|
+
<td>✅ Included</td>
|
|
1212
|
+
<td>✅ Included</td>
|
|
1213
|
+
<td>✅ Optional (checkbox)</td>
|
|
1214
|
+
</tr>
|
|
1215
|
+
<tr>
|
|
1216
|
+
<td>Guides & Surveys</td>
|
|
1217
|
+
<td>⚠️ Separate script</td>
|
|
1218
|
+
<td>✅ Included</td>
|
|
1219
|
+
<td>✅ Optional (checkbox)</td>
|
|
1220
|
+
</tr>
|
|
1221
|
+
<tr>
|
|
1222
|
+
<td>Web Experiment (<code>@amplitude/experiment-tag</code>)</td>
|
|
1223
|
+
<td>✅ Included</td>
|
|
1224
|
+
<td>❌ Not included</td>
|
|
1225
|
+
<td>❌ Not supported</td>
|
|
1226
|
+
</tr>
|
|
1227
|
+
<tr>
|
|
1228
|
+
<td>Feature Experiment (<code>@amplitude/experiment-js-client</code>)</td>
|
|
1229
|
+
<td>❌ Not included</td>
|
|
1230
|
+
<td>✅ Included</td>
|
|
1231
|
+
<td>❌ Not supported</td>
|
|
1232
|
+
</tr>
|
|
1233
|
+
</tbody>
|
|
1234
|
+
</table>
|
|
1235
|
+
<p>
|
|
1236
|
+
<div class="hint note"><h2 class="hint-title">Web Experiment compared with Feature Experiment</h2><div class="hint-content"></p>
|
|
1237
|
+
<ul>
|
|
1238
|
+
<li><strong>Web Experiment</strong>: Uses visual editing for no-code A/B testing on web pages. The Unified Script includes it automatically.</li>
|
|
1239
|
+
<li><strong>Feature Experiment</strong>: Uses code-based feature flags with the Experiment JavaScript SDK. The Unified npm package includes it.</div></div>
|
|
1240
|
+
</li>
|
|
1241
|
+
</ul>
|
|
1242
|
+
<h2 id="unified-sdk-npm">Unified SDK (npm)<a href="#unified-sdk-npm" class="heading-permalink" aria-hidden="true" title="Permalink"></a></h2>
|
|
1243
|
+
<p>The Unified SDK provides a single npm package (<code>@amplitude/unified</code>) giving you access to Analytics, Session Replay, Feature Experiment, and Guides & Surveys through a single API. Install it with npm or yarn, and control the version in your <code>package.json</code>.</p>
|
|
1244
|
+
<p><strong>Key characteristics:</strong></p>
|
|
1245
|
+
<ul>
|
|
1246
|
+
<li>Customer-managed package installation with full control over versions.</li>
|
|
1247
|
+
<li>Includes Feature Experiment (code-based feature flags), not Web Experiment (visual editor).</li>
|
|
1248
|
+
<li>Upgrade by bumping the package version in your dependency file.</li>
|
|
1249
|
+
<li>Ideal for teams that require reproducible builds and strict change management.</li>
|
|
1250
|
+
</ul>
|
|
1251
|
+
<p>
|
|
1252
|
+
<div class="hint info"><h2 class="hint-title">Individual product installation</h2><div class="hint-content">
|
|
1253
|
+
If you're concerned about bundle size and only need specific products, install them individually:</p>
|
|
1254
|
+
<ul>
|
|
1255
|
+
<li><a href="/docs/sdks/analytics/browser/browser-sdk-2">Analytics</a>: For tracking user events and behavior.</li>
|
|
1256
|
+
<li><a href="/docs/sdks/experiment-sdks/experiment-javascript">Experiment</a>: For running A/B tests and feature flags.</li>
|
|
1257
|
+
<li><a href="/docs/session-replay/session-replay-standalone-sdk">Session Replay</a>: For capturing and replaying user sessions.</li>
|
|
1258
|
+
<li><a href="/docs/guides-and-surveys/sdk">Guides and Surveys</a>: For in-product messaging and surveys.</div></div>
|
|
1259
|
+
</li>
|
|
1260
|
+
</ul>
|
|
1261
|
+
<h3 id="install-the-unified-sdk">Install the Unified SDK<a href="#install-the-unified-sdk" class="heading-permalink" aria-hidden="true" title="Permalink"></a></h3>
|
|
1262
|
+
<p>Install the dependency with npm or yarn.</p>
|
|
1263
|
+
<p>
|
|
1264
|
+
<div class="border border-amp-gray-200 rounded" x-data="{ activeTab: 'npm' }">
|
|
1265
|
+
<div class="flex space-x-1 border-amp-gray-200 border-b border-solid">
|
|
1266
|
+
<button x-on:click="activeTab = 'npm'" :class="{'border-b-2 border-amp-blue-500 text-amp-blue-500 -mb-[2px]' : activeTab === 'npm', 'bg-gray-200': activeTab !== 'npm'}" class="px-4 py-2">npm</button><button x-on:click="activeTab = 'yarn'" :class="{'border-b-2 border-amp-blue-500 text-amp-blue-500 -mb-[2px]' : activeTab === 'yarn', 'bg-gray-200': activeTab !== 'yarn'}" class="px-4 py-2">yarn</button><button x-on:click="activeTab = 'AI prompt'" :class="{'border-b-2 border-amp-blue-500 text-amp-blue-500 -mb-[2px]' : activeTab === 'AI prompt', 'bg-gray-200': activeTab !== 'AI prompt'}" class="px-4 py-2">AI prompt</button></div>
|
|
1267
|
+
|
|
1268
|
+
<div x-cloak x-show="activeTab === 'npm'" class="p-4 tab"></p>
|
|
1269
|
+
<pre><code class="language-bash">npm install @amplitude/unified
|
|
1270
|
+
</code></pre>
|
|
1271
|
+
<p>
|
|
1272
|
+
</div>
|
|
1273
|
+
<div x-cloak x-show="activeTab === 'yarn'" class="p-4 tab"></p>
|
|
1274
|
+
<pre><code class="language-bash">yarn add @amplitude/unified
|
|
1275
|
+
</code></pre>
|
|
1276
|
+
<p>
|
|
1277
|
+
</div>
|
|
1278
|
+
<div x-cloak x-show="activeTab === 'AI prompt'" class="p-4 tab">
|
|
1279
|
+
<p>Paste the prompt below into your terminal or AI tools like Copilot, Cursor, Replit, or Bolt.</p></p>
|
|
1280
|
+
<p>Click the <strong>Key</strong> icon to insert your Amplitude API key.
|
|
1281
|
+
</p>
|
|
1282
|
+
<pre><code class="language-plaintext">You are an Amplitude installation wizard, an expert AI programming assistant that implements Amplitude Analytics, Session Replay, Experiment, and Guides and Surveys for JavaScript-based applications.
|
|
1283
|
+
<p>Your task is to select, install, and initialize the correct Amplitude package(s) necessary to enable Amplitude Analytics, Session Replay, Experiment, and Guides and Surveys for this application and track key interactions, all in strict accordance to the Documentation provided below.</p>
|
|
1284
|
+
<p>Rules</p>
|
|
1285
|
+
<ul>
|
|
1286
|
+
<li>Do not make any code changes if this is not a JavaScript-based application</li>
|
|
1287
|
+
<li>Ensure ALL the code added ONLY runs client-side and never server-side</li>
|
|
1288
|
+
<li>Ensure amplitude is only initialized once during the lifecycle of the application</li>
|
|
1289
|
+
</ul>
|
|
1290
|
+
<h2 id="context">Context<a href="#context" class="heading-permalink" aria-hidden="true" title="Permalink"></a></h2>
|
|
1291
|
+
<h2 id="documentation">Documentation<a href="#documentation" class="heading-permalink" aria-hidden="true" title="Permalink"></a></h2>
|
|
1292
|
+
<ol>
|
|
1293
|
+
<li>Install the Amplitude Analytics Browser SDK with <code>npm install @amplitude/unified</code> or <code>yarn add @amplitude/unified</code></li>
|
|
1294
|
+
<li>Import amplitude into the root of the client application with <code>import * as amplitude from '@amplitude/unified';</code></li>
|
|
1295
|
+
<li>Initialize amplitude with <code>amplitude.initAll('AMPLITUDE_API_KEY', {"analytics":{"autocapture":true},"sessionReplay":{"sampleRate":1},"experiment":{"deploymentKey":"DEPLOYMENT_KEY"},"engagement":{"serverZone":"US","logLevel":LogLevel.Warn}});</code></code></pre></li>
|
|
1296
|
+
</ol>
|
|
1297
|
+
<p>
|
|
1298
|
+
</div>
|
|
1299
|
+
</div></p>
|
|
1300
|
+
<h3 id="initialize-the-unified-sdk">Initialize the Unified SDK<a href="#initialize-the-unified-sdk" class="heading-permalink" aria-hidden="true" title="Permalink"></a></h3>
|
|
1301
|
+
<p>The Unified SDK provides a single initialization method that initializes all Amplitude features.</p>
|
|
1302
|
+
<pre><code class="language-typescript">import { initAll } from '@amplitude/unified';
|
|
1303
|
+
|
|
1304
|
+
initAll('AMPLITUDE_API_KEY');
|
|
1305
|
+
</code></pre>
|
|
1306
|
+
<h3 id="access-sdk-features">Access SDK features<a href="#access-sdk-features" class="heading-permalink" aria-hidden="true" title="Permalink"></a></h3>
|
|
1307
|
+
<p>The Unified SDK provides access to all Amplitude features through a single interface:</p>
|
|
1308
|
+
<p>
|
|
1309
|
+
<div class="hint info"><h2 class="hint-title">Feature Documentation</h2><div class="hint-content">
|
|
1310
|
+
For detailed information about each product's features and APIs, refer to their respective documentation:</p>
|
|
1311
|
+
<ul>
|
|
1312
|
+
<li><a href="/docs/sdks/analytics/browser/browser-sdk-2">Analytics Browser SDK</a></li>
|
|
1313
|
+
<li><a href="/docs/sdks/experiment-sdks/experiment-javascript">Experiment JavaScript SDK</a></li>
|
|
1314
|
+
<li><a href="/docs/session-replay/session-replay-standalone-sdk">Session Replay Standalone SDK</a></li>
|
|
1315
|
+
<li><a href="/docs/guides-and-surveys/sdk">Guides and Surveys Web SDK</a></div></div>
|
|
1316
|
+
</li>
|
|
1317
|
+
</ul>
|
|
1318
|
+
<pre><code class="language-typescript">import {
|
|
1319
|
+
track,
|
|
1320
|
+
identify,
|
|
1321
|
+
experiment,
|
|
1322
|
+
sessionReplay
|
|
1323
|
+
} from '@amplitude/unified';
|
|
1324
|
+
|
|
1325
|
+
// Track events
|
|
1326
|
+
track('Button Clicked', { buttonName: 'Sign Up' });
|
|
1327
|
+
|
|
1328
|
+
// Identify users
|
|
1329
|
+
identify(new Identify().set('userType', 'premium'));
|
|
1330
|
+
|
|
1331
|
+
// Access Experiment features
|
|
1332
|
+
const variant = await experiment.fetch('experiment-key');
|
|
1333
|
+
|
|
1334
|
+
// Access Session Replay features
|
|
1335
|
+
sessionReplay.flush();
|
|
1336
|
+
</code></pre>
|
|
1337
|
+
<h3 id="configuration">Configuration<a href="#configuration" class="heading-permalink" aria-hidden="true" title="Permalink"></a></h3>
|
|
1338
|
+
<p>The Unified SDK supports configuration options for all Amplitude features. You can configure each product individually while sharing some common options.</p>
|
|
1339
|
+
<pre><code class="language-typescript">import { initAll } from '@amplitude/unified';
|
|
1340
|
+
|
|
1341
|
+
initAll('AMPLITUDE_API_KEY', {
|
|
1342
|
+
// Shared options for all SDKs (optional)
|
|
1343
|
+
serverZone: 'US', // or 'EU'
|
|
1344
|
+
instanceName: 'my-instance',
|
|
1345
|
+
|
|
1346
|
+
// Analytics options
|
|
1347
|
+
analytics: {
|
|
1348
|
+
// Analytics configuration options
|
|
1349
|
+
},
|
|
1350
|
+
|
|
1351
|
+
// Session Replay options
|
|
1352
|
+
sessionReplay: {
|
|
1353
|
+
// Session Replay configuration options
|
|
1354
|
+
sampleRate: 1 // To enable session replay
|
|
1355
|
+
},
|
|
1356
|
+
|
|
1357
|
+
// Experiment options
|
|
1358
|
+
experiment: {
|
|
1359
|
+
// Experiment configuration options
|
|
1360
|
+
},
|
|
1361
|
+
|
|
1362
|
+
// Guides and Surveys options
|
|
1363
|
+
engagement: {
|
|
1364
|
+
// Guides and Surveys configuration options
|
|
1365
|
+
}
|
|
1366
|
+
});
|
|
1367
|
+
</code></pre>
|
|
1368
|
+
<h4 id="shared-options">Shared options<a href="#shared-options" class="heading-permalink" aria-hidden="true" title="Permalink"></a></h4>
|
|
1369
|
+
<table>
|
|
1370
|
+
<thead>
|
|
1371
|
+
<tr>
|
|
1372
|
+
<th>Name</th>
|
|
1373
|
+
<th>Type</th>
|
|
1374
|
+
<th>Default</th>
|
|
1375
|
+
<th>Description</th>
|
|
1376
|
+
</tr>
|
|
1377
|
+
</thead>
|
|
1378
|
+
<tbody>
|
|
1379
|
+
<tr>
|
|
1380
|
+
<td><code>serverZone</code></td>
|
|
1381
|
+
<td><code>'US'</code> or <code>'EU'</code></td>
|
|
1382
|
+
<td><code>'US'</code></td>
|
|
1383
|
+
<td>The server zone to use for all SDKs.</td>
|
|
1384
|
+
</tr>
|
|
1385
|
+
<tr>
|
|
1386
|
+
<td><code>instanceName</code></td>
|
|
1387
|
+
<td><code>string</code></td>
|
|
1388
|
+
<td><code>$default_instance</code></td>
|
|
1389
|
+
<td>A unique name for this instance of the SDK.</td>
|
|
1390
|
+
</tr>
|
|
1391
|
+
</tbody>
|
|
1392
|
+
</table>
|
|
1393
|
+
<h4 id="analytics-options">Analytics options<a href="#analytics-options" class="heading-permalink" aria-hidden="true" title="Permalink"></a></h4>
|
|
1394
|
+
<p>All options from <code>@amplitude/analytics-browser</code> are supported. Refer to the <a href="/docs/sdks/analytics/browser/browser-sdk-2#initialize-the-sdk">Analytics Browser SDK documentation</a> for details.</p>
|
|
1395
|
+
<h4 id="session-replay-options">Session Replay options<a href="#session-replay-options" class="heading-permalink" aria-hidden="true" title="Permalink"></a></h4>
|
|
1396
|
+
<p>The Unified Browser SDK supports all options from <code>@amplitude/plugin-session-replay-browser</code>. Refer to the <a href="/docs/session-replay/session-replay-plugin#configuration">Session Replay Plugin documentation</a> for more information. Set <code>config.sessionReplay.sampleRate</code> to a non-zero value to enable Session Replay.</p>
|
|
1397
|
+
<p>Sample rate controls the rate at which Amplitude captures session replays. For example, if you set <code>config.sessionReplay.sampleRate</code> to <code>0.5</code>, Session Replay captures roughly half of all sessions.</p>
|
|
1398
|
+
<h4 id="experiment-options">Experiment options<a href="#experiment-options" class="heading-permalink" aria-hidden="true" title="Permalink"></a></h4>
|
|
1399
|
+
<p>All options from <code>@amplitude/plugin-experiment-browser</code> are supported. Refer to the <a href="/docs/sdks/experiment-sdks/experiment-javascript#configuration">Experiment documentation</a> for details.</p>
|
|
1400
|
+
<h4 id="guides-and-surveys-options">Guides and Surveys options<a href="#guides-and-surveys-options" class="heading-permalink" aria-hidden="true" title="Permalink"></a></h4>
|
|
1401
|
+
<p>The Unified Browser SDK supports all <a href="/docs/guides-and-surveys/sdk#initialize-the-sdk">Guides and Surveys options</a>. The engagement plugin initializes automatically when you pass engagement options in the configuration.</p>
|
|
1402
|
+
<h2 id="unified-script-cdn">Unified script (CDN)<a href="#unified-script-cdn" class="heading-permalink" aria-hidden="true" title="Permalink"></a></h2>
|
|
1403
|
+
<p>The Unified Script is a single script tag that loads Amplitude browser capabilities from Amplitude's CDN. Amplitude remotely controls the versions of the underlying SDKs, offering a "single line of code" experience with sensible defaults and optional remote or manual configuration.</p>
|
|
1404
|
+
<p><strong>Key characteristics:</strong></p>
|
|
1405
|
+
<ul>
|
|
1406
|
+
<li>Amplitude manages SDK versions and can patch bugs or improve performance centrally without requiring a customer release.</li>
|
|
1407
|
+
<li>Includes Web Experiment (visual editor) by default.</li>
|
|
1408
|
+
<li>Session Replay and Web Experiment enable automatically with default settings.</li>
|
|
1409
|
+
<li>Guides & Surveys requires a separate script because of size concerns.</li>
|
|
1410
|
+
</ul>
|
|
1411
|
+
<h3 id="install-the-unified-script">Install the Unified Script<a href="#install-the-unified-script" class="heading-permalink" aria-hidden="true" title="Permalink"></a></h3>
|
|
1412
|
+
<p>Add the following script tag to the <code><head></code> of your site:</p>
|
|
1413
|
+
<pre><code class="language-html"><script src="https://cdn.amplitude.com/script/AMPLITUDE_API_KEY.js"></script>
|
|
1414
|
+
</code></pre>
|
|
1415
|
+
<p>Replace <code>AMPLITUDE_API_KEY</code> with your project's API key.</p>
|
|
1416
|
+
<h3 id="initialize-the-unified-script">Initialize the Unified Script<a href="#initialize-the-unified-script" class="heading-permalink" aria-hidden="true" title="Permalink"></a></h3>
|
|
1417
|
+
<p>The Unified Script enables Session Replay and Web Experiment by default. For manual configuration:</p>
|
|
1418
|
+
<pre><code class="language-html"><script src="https://cdn.amplitude.com/script/AMPLITUDE_API_KEY.js"></script>
|
|
1419
|
+
<script>
|
|
1420
|
+
window.amplitude.init('AMPLITUDE_API_KEY', {
|
|
1421
|
+
defaultTracking: true,
|
|
1422
|
+
autocapture: true,
|
|
1423
|
+
fetchRemoteConfig: true
|
|
1424
|
+
});
|
|
1425
|
+
// Enable Session Replay with custom sample rate
|
|
1426
|
+
window.amplitude.add(window.sessionReplay.plugin({ sampleRate: 1 }));
|
|
1427
|
+
</script>
|
|
1428
|
+
</code></pre>
|
|
1429
|
+
<h3 id="add-guides--surveys-to-the-unified-script">Add Guides & Surveys to the Unified Script<a href="#add-guides--surveys-to-the-unified-script" class="heading-permalink" aria-hidden="true" title="Permalink"></a></h3>
|
|
1430
|
+
<p>Because of size concerns, Guides & Surveys requires a separate script. Add it after the Unified Script:</p>
|
|
1431
|
+
<pre><code class="language-html"><script src="https://cdn.amplitude.com/script/AMPLITUDE_API_KEY.js"></script>
|
|
1432
|
+
<script src="https://cdn.amplitude.com/script/AMPLITUDE_API_KEY.engagement.js"></script>
|
|
1433
|
+
<script>
|
|
1434
|
+
window.amplitude.add(window.engagement.plugin());
|
|
1435
|
+
window.amplitude.init('AMPLITUDE_API_KEY', {
|
|
1436
|
+
fetchRemoteConfig: true,
|
|
1437
|
+
autocapture: true
|
|
1438
|
+
});
|
|
1439
|
+
</script>
|
|
1440
|
+
</code></pre>
|
|
1441
|
+
<p>Refer to the <a href="/docs/guides-and-surveys/sdk">Guides and Surveys SDK documentation</a> for more configuration options.</p>
|
|
1442
|
+
<h2 id="google-tag-manager">Google Tag Manager<a href="#google-tag-manager" class="heading-permalink" aria-hidden="true" title="Permalink"></a></h2>
|
|
1443
|
+
<p>The <a href="/docs/data/source-catalog/google-tag-manager">Amplitude GTM template</a> directly wraps the Analytics Browser 2.0 SDK (<code>@amplitude/analytics-browser</code>). It doesn't use the Unified SDK or Unified Script.</p>
|
|
1444
|
+
<p><strong>Key characteristics:</strong></p>
|
|
1445
|
+
<ul>
|
|
1446
|
+
<li>Template version-controlled through GTM.</li>
|
|
1447
|
+
<li>Supports Analytics, Session Replay, and Guides & Surveys.</li>
|
|
1448
|
+
<li>Doesn't support Web Experiment or Feature Experiment.</li>
|
|
1449
|
+
<li>Session Replay and Guides & Surveys are disabled by default and require manual checkbox selection.</li>
|
|
1450
|
+
</ul>
|
|
1451
|
+
<h3 id="enable-session-replay-and-guides--surveys-in-gtm">Enable Session Replay and Guides & Surveys in GTM<a href="#enable-session-replay-and-guides--surveys-in-gtm" class="heading-permalink" aria-hidden="true" title="Permalink"></a></h3>
|
|
1452
|
+
<p>To enable these features:</p>
|
|
1453
|
+
<ol>
|
|
1454
|
+
<li>Navigate to your Amplitude tag in GTM.</li>
|
|
1455
|
+
<li>In the tag configuration, check the <strong>Session Replay</strong> checkbox to enable session replays.</li>
|
|
1456
|
+
<li>Check the <strong>Guides & Surveys</strong> checkbox to enable in-product messaging.</li>
|
|
1457
|
+
<li>Save and publish your changes.</li>
|
|
1458
|
+
</ol>
|
|
1459
|
+
<p>Refer to the <a href="/docs/data/source-catalog/google-tag-manager">Google Tag Manager documentation</a> for detailed configuration options.</p>
|
|
1460
|
+
|
|
1461
|
+
|
|
1462
|
+
</div>
|
|
1463
|
+
</div>
|
|
1464
|
+
|
|
1465
|
+
|
|
1466
|
+
|
|
1467
|
+
|
|
1468
|
+
<div class="relative basis-64 shrink-0 hidden lg:block">
|
|
1469
|
+
<div class="flex flex-row ml-8 mb-2">
|
|
1470
|
+
|
|
1471
|
+
|
|
1472
|
+
<div class="copy-page-menu relative" data-md-url="/docs/md/sdks/analytics/browser/browser-unified-sdk.md">
|
|
1473
|
+
<button class="copy-page-toggle group flex items-center font-medium border border-white hover:border-amp-gray-200 rounded-md transition-all duration-200"
|
|
1474
|
+
aria-label="Copy page options" title="Copy page options">
|
|
1475
|
+
<div class="flex items-center justify-center">
|
|
1476
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="16px" viewBox="0 -960 960 960" width="16px" fill="currentColor" class="w-6 h-6 text-amp-gray-500 transition-transform duration-200 group-hover:-translate-y-px"> <path d="M362.31-260Q332-260 311-281q-21-21-21-51.31v-455.38Q290-818 311-839q21-21 51.31-21h335.38Q728-860 749-839q21 21 21 51.31v455.38Q770-302 749-281q-21 21-51.31 21H362.31Zm0-60h335.38q4.62 0 8.46-3.85 3.85-3.84 3.85-8.46v-455.38q0-4.62-3.85-8.46-3.84-3.85-8.46-3.85H362.31q-4.62 0-8.46 3.85-3.85 3.84-3.85 8.46v455.38q0 4.62 3.85 8.46 3.84 3.85 8.46 3.85Zm-140 200Q192-120 171-141q-21-21-21-51.31v-515.38h60v515.38q0 4.62 3.85 8.46 3.84 3.85 8.46 3.85h395.38v60H222.31ZM350-320v-480 480Z" />
|
|
1477
|
+
</svg>
|
|
1478
|
+
</div>
|
|
1479
|
+
</button>
|
|
1480
|
+
|
|
1481
|
+
<!-- Dropdown Menu -->
|
|
1482
|
+
<div class="copy-page-dropdown hidden absolute right-0 mt-2 w-56 bg-white rounded-md shadow-lg border border-amp-gray-200 z-50 opacity-0 scale-95 transition-all duration-100 ease-out">
|
|
1483
|
+
<div class="py-1">
|
|
1484
|
+
<button class="copy-markdown-btn flex items-center w-full px-4 py-2 text-sm text-amp-gray-700 hover:bg-amp-gray-50 hover:text-amp-gray-900 transition-colors duration-150">
|
|
1485
|
+
<svg xmlns="http://www.w3.org/2000/svg" class="w-4 h-4 mr-3" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
1486
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" />
|
|
1487
|
+
</svg>
|
|
1488
|
+
Copy as Markdown
|
|
1489
|
+
</button>
|
|
1490
|
+
|
|
1491
|
+
<a href="/docs/md/sdks/analytics/browser/browser-unified-sdk.md" target="_blank" class="copy-page-link flex items-center w-full px-4 py-2 text-sm text-amp-gray-700 hover:bg-amp-gray-50 hover:text-amp-gray-900 transition-colors duration-150">
|
|
1492
|
+
<svg xmlns="http://www.w3.org/2000/svg" class="w-4 h-4 mr-3" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
1493
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14" />
|
|
1494
|
+
</svg>
|
|
1495
|
+
View as Markdown
|
|
1496
|
+
</a>
|
|
1497
|
+
|
|
1498
|
+
<hr class="my-1 border-amp-gray-100">
|
|
1499
|
+
|
|
1500
|
+
<a href="https://chat.openai.com/?q=Look+at+this+document+from+Amplitude+so+I+can+ask+questions+about+it%3A+https%3A//amplitude.com/docs/md/sdks/analytics/browser/browser-unified-sdk.md" target="_blank" class="open-chatgpt copy-page-link flex items-center w-full px-4 py-2 text-sm text-amp-gray-700 hover:bg-amp-gray-50 hover:text-amp-gray-900 transition-colors duration-150">
|
|
1501
|
+
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 mr-3" viewBox="0 0 320 320">
|
|
1502
|
+
<path d="m297.06 130.97c7.26-21.79 4.76-45.66-6.85-65.48-17.46-30.4-52.56-46.04-86.84-38.68-15.25-17.18-37.16-26.95-60.13-26.81-35.04-.08-66.13 22.48-76.91 55.82-22.51 4.61-41.94 18.7-53.31 38.67-17.59 30.32-13.58 68.54 9.92 94.54-7.26 21.79-4.76 45.66 6.85 65.48 17.46 30.4 52.56 46.04 86.84 38.68 15.24 17.18 37.16 26.95 60.13 26.8 35.06.09 66.16-22.49 76.94-55.86 22.51-4.61 41.94-18.7 53.31-38.67 17.57-30.32 13.55-68.51-9.94-94.51zm-120.28 168.11c-14.03.02-27.62-4.89-38.39-13.88.49-.26 1.34-.73 1.89-1.07l63.72-36.8c3.26-1.85 5.26-5.32 5.24-9.07v-89.83l26.93 15.55c.29.14.48.42.52.74v74.39c-.04 33.08-26.83 59.9-59.91 59.97zm-128.84-55.03c-7.03-12.14-9.56-26.37-7.15-40.18.47.28 1.3.79 1.89 1.13l63.72 36.8c3.23 1.89 7.23 1.89 10.47 0l77.79-44.92v31.1c.02.32-.13.63-.38.83l-64.41 37.19c-28.69 16.52-65.33 6.7-81.92-21.95zm-16.77-139.09c7-12.16 18.05-21.46 31.21-26.29 0 .55-.03 1.52-.03 2.2v73.61c-.02 3.74 1.98 7.21 5.23 9.06l77.79 44.91-26.93 15.55c-.27.18-.61.21-.91.08l-64.42-37.22c-28.63-16.58-38.45-53.21-21.95-81.89zm221.26 51.49-77.79-44.92 26.93-15.54c.27-.18.61-.21.91-.08l64.42 37.19c28.68 16.57 38.51 53.26 21.94 81.94-7.01 12.14-18.05 21.44-31.2 26.28v-75.81c.03-3.74-1.96-7.2-5.2-9.06zm26.8-40.34c-.47-.29-1.3-.79-1.89-1.13l-63.72-36.8c-3.23-1.89-7.23-1.89-10.47 0l-77.79 44.92v-31.1c-.02-.32.13-.63.38-.83l64.41-37.16c28.69-16.55 65.37-6.7 81.91 22 6.99 12.12 9.52 26.31 7.15 40.1zm-168.51 55.43-26.94-15.55c-.29-.14-.48-.42-.52-.74v-74.39c.02-33.12 26.89-59.96 60.01-59.94 14.01 0 27.57 4.92 38.34 13.88-.49.26-1.33.73-1.89 1.07l-63.72 36.8c-3.26 1.85-5.26 5.31-5.24 9.06l-.04 89.79zm14.63-31.54 34.65-20.01 34.65 20v40.01l-34.65 20-34.65-20z"/>
|
|
1503
|
+
</svg>
|
|
1504
|
+
Open in ChatGPT
|
|
1505
|
+
</a>
|
|
1506
|
+
|
|
1507
|
+
<a href="https://claude.ai/chat?q=Look+at+this+document+from+Amplitude+so+I+can+ask+questions+about+it%3A+https%3A//amplitude.com/docs/md/sdks/analytics/browser/browser-unified-sdk.md" target="_blank" class="open-claude copy-page-link flex items-center w-full px-4 py-2 text-sm text-amp-gray-700 hover:bg-amp-gray-50 hover:text-amp-gray-900 transition-colors duration-150">
|
|
1508
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" class="h-4 w-4 mr-3" viewBox="0 0 256 256" xml:space="preserve">
|
|
1509
|
+
<g style="stroke: none; stroke-width: 0; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: none; fill-rule: nonzero; opacity: 1;" transform="translate(1.4065934065934016 1.4065934065934016) scale(2.81 2.81)">
|
|
1510
|
+
<path d="M 17.671 59.85 l 17.699 -9.93 l 0.298 -0.862 l -0.298 -0.48 h -0.862 l -2.958 -0.182 l -10.113 -0.273 l -8.77 -0.364 L 4.17 47.302 l -2.138 -0.456 l -2.004 -2.642 l 0.207 -1.318 l 1.798 -1.209 l 2.575 0.225 l 5.691 0.389 l 8.54 0.589 l 6.195 0.364 l 9.177 0.954 h 1.458 l 0.207 -0.589 l -0.498 -0.364 l -0.389 -0.364 l -8.837 -5.989 l -9.566 -6.329 l -5.011 -3.644 l -2.709 -1.846 l -1.367 -1.731 l -0.589 -3.778 l 2.46 -2.709 l 3.304 0.225 l 0.844 0.225 l 3.347 2.575 l 7.149 5.533 l 9.335 6.875 l 1.367 1.136 l 0.547 -0.389 l 0.067 -0.273 l -0.613 -1.026 l -5.078 -9.177 l -5.418 -9.335 l -2.411 -3.869 l -0.638 -2.32 C 20.945 6.08 20.781 5.278 20.781 4.3 l 2.8 -3.802 L 25.13 0 l 3.735 0.498 l 1.573 1.367 l 2.32 5.308 l 3.76 8.357 l 5.831 11.364 l 1.707 3.371 l 0.911 3.122 l 0.34 0.954 h 0.589 v -0.547 l 0.48 -6.402 l 0.887 -7.859 L 48.125 9.42 l 0.298 -2.849 l 1.409 -3.413 l 2.8 -1.846 l 2.187 1.045 l 1.798 2.575 l -0.249 1.664 l -1.069 6.948 l -2.095 10.884 l -1.367 7.288 h 0.796 l 0.911 -0.911 l 3.687 -4.895 l 6.195 -7.744 l 2.733 -3.073 l 3.189 -3.395 l 2.047 -1.616 h 3.869 l 2.849 4.233 l -1.275 4.373 l -3.984 5.053 l -3.304 4.282 l -4.737 6.377 l -2.958 5.102 l 0.273 0.407 l 0.705 -0.067 l 10.702 -2.278 l 5.782 -1.045 l 6.9 -1.184 l 3.122 1.458 l 0.34 1.482 l -1.227 3.031 l -7.38 1.822 l -8.655 1.731 l -12.888 3.049 l -0.158 0.115 l 0.182 0.225 l 5.806 0.547 l 2.484 0.134 h 6.08 l 11.321 0.844 l 2.958 1.956 l 1.774 2.393 l -0.298 1.822 l -4.555 2.32 l -6.147 -1.458 l -14.346 -3.413 l -4.92 -1.227 h -0.68 v 0.407 l 4.1 4.009 l 7.513 6.784 l 9.408 8.746 l 0.48 2.162 l -1.209 1.707 L 78.044 75.8 l -8.266 -6.219 l -3.189 -2.8 l -7.222 -6.08 h -0.48 v 0.638 l 1.664 2.436 l 8.789 13.21 l 0.456 4.051 l -0.638 1.318 l -2.278 0.796 l -2.502 -0.456 l -5.144 -7.222 l -5.308 -8.133 l -4.282 -7.288 l -0.522 0.298 l -2.527 27.216 l -1.184 1.391 L 42.677 90 l -2.278 -1.731 l -1.209 -2.8 l 1.209 -5.533 l 1.458 -7.222 l 1.184 -5.74 l 1.069 -7.131 l 0.638 -2.369 l -0.043 -0.158 l -0.522 0.067 l -5.375 7.38 l -8.175 11.048 l -6.468 6.924 l -1.549 0.613 l -2.685 -1.391 l 0.249 -2.484 l 1.5 -2.211 l 8.953 -11.388 l 5.4 -7.058 l 3.486 -4.075 l -0.024 -0.589 h -0.207 L 15.509 69.592 l -4.233 0.547 l -1.822 -1.707 l 0.225 -2.8 l 0.862 -0.911 l 7.149 -4.92 l -0.024 0.024 L 17.671 59.85 z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(0,0,0); fill-rule: nonzero; opacity: 1;" transform=" matrix(1 0 0 1 0 0) " stroke-linecap="round"/>
|
|
1511
|
+
</g>
|
|
1512
|
+
</svg>
|
|
1513
|
+
Open in Claude
|
|
1514
|
+
</a>
|
|
1515
|
+
</div>
|
|
1516
|
+
</div>
|
|
1517
|
+
|
|
1518
|
+
</div>
|
|
1519
|
+
|
|
1520
|
+
<style>
|
|
1521
|
+
/* Custom Tippy.js themes for success and error states */
|
|
1522
|
+
.tippy-box[data-theme~='light-success'] {
|
|
1523
|
+
background-color: #dcfce7;
|
|
1524
|
+
color: #166534;
|
|
1525
|
+
border: 1px solid #bbf7d0;
|
|
1526
|
+
}
|
|
1527
|
+
|
|
1528
|
+
.tippy-box[data-theme~='light-success'] .tippy-arrow {
|
|
1529
|
+
color: #dcfce7;
|
|
1530
|
+
}
|
|
1531
|
+
|
|
1532
|
+
.tippy-box[data-theme~='light-error'] {
|
|
1533
|
+
background-color: #fef2f2;
|
|
1534
|
+
color: #dc2626;
|
|
1535
|
+
border: 1px solid #fecaca;
|
|
1536
|
+
}
|
|
1537
|
+
|
|
1538
|
+
.tippy-box[data-theme~='light-error'] .tippy-arrow {
|
|
1539
|
+
color: #fef2f2;
|
|
1540
|
+
}
|
|
1541
|
+
</style>
|
|
1542
|
+
|
|
1543
|
+
<script>
|
|
1544
|
+
(function() {
|
|
1545
|
+
'use strict';
|
|
1546
|
+
|
|
1547
|
+
// Initialize when DOM is ready
|
|
1548
|
+
if (document.readyState === 'loading') {
|
|
1549
|
+
document.addEventListener('DOMContentLoaded', initCopyPageMenu);
|
|
1550
|
+
} else {
|
|
1551
|
+
initCopyPageMenu();
|
|
1552
|
+
}
|
|
1553
|
+
|
|
1554
|
+
function initCopyPageMenu() {
|
|
1555
|
+
const menus = document.querySelectorAll('.copy-page-menu');
|
|
1556
|
+
menus.forEach(menu => {
|
|
1557
|
+
const toggle = menu.querySelector('.copy-page-toggle');
|
|
1558
|
+
const dropdown = menu.querySelector('.copy-page-dropdown');
|
|
1559
|
+
const arrow = menu.querySelector('.copy-page-arrow');
|
|
1560
|
+
const copyBtn = menu.querySelector('.copy-markdown-btn');
|
|
1561
|
+
const links = menu.querySelectorAll('.copy-page-link');
|
|
1562
|
+
const mdUrl = menu.dataset.mdUrl;
|
|
1563
|
+
|
|
1564
|
+
let isOpen = false;
|
|
1565
|
+
let copyTooltip = null;
|
|
1566
|
+
|
|
1567
|
+
// Initialize Tippy.js tooltip for copy button
|
|
1568
|
+
if (window.tippy && copyBtn) {
|
|
1569
|
+
copyTooltip = tippy(copyBtn, {
|
|
1570
|
+
content: 'Copy as Markdown',
|
|
1571
|
+
placement: 'top',
|
|
1572
|
+
trigger: 'manual',
|
|
1573
|
+
theme: 'light',
|
|
1574
|
+
animation: 'fade',
|
|
1575
|
+
duration: [200, 150],
|
|
1576
|
+
hideOnClick: false
|
|
1577
|
+
});
|
|
1578
|
+
}
|
|
1579
|
+
|
|
1580
|
+
// Toggle dropdown
|
|
1581
|
+
toggle.addEventListener('click', (e) => {
|
|
1582
|
+
e.stopPropagation();
|
|
1583
|
+
toggleDropdown();
|
|
1584
|
+
});
|
|
1585
|
+
|
|
1586
|
+
// Close on outside click
|
|
1587
|
+
document.addEventListener('click', (e) => {
|
|
1588
|
+
if (isOpen && !menu.contains(e.target)) {
|
|
1589
|
+
closeDropdown();
|
|
1590
|
+
}
|
|
1591
|
+
});
|
|
1592
|
+
|
|
1593
|
+
// Close dropdown when links are clicked
|
|
1594
|
+
links.forEach(link => {
|
|
1595
|
+
link.addEventListener('click', () => {
|
|
1596
|
+
closeDropdown();
|
|
1597
|
+
});
|
|
1598
|
+
});
|
|
1599
|
+
|
|
1600
|
+
// Copy markdown functionality
|
|
1601
|
+
copyBtn.addEventListener('click', async () => {
|
|
1602
|
+
try {
|
|
1603
|
+
const resp = await fetch(mdUrl);
|
|
1604
|
+
if (!resp.ok) throw new Error(`HTTP ${resp.status}`);
|
|
1605
|
+
const raw = await resp.text();
|
|
1606
|
+
|
|
1607
|
+
// Strip YAML front matter
|
|
1608
|
+
const md = raw.replace(/^---[\r\n]+[\s\S]*?[\r\n]+---[\r\n]*/, '');
|
|
1609
|
+
|
|
1610
|
+
if (navigator.clipboard?.writeText) {
|
|
1611
|
+
await navigator.clipboard.writeText(md);
|
|
1612
|
+
} else {
|
|
1613
|
+
// Fallback for older browsers
|
|
1614
|
+
const ta = document.createElement('textarea');
|
|
1615
|
+
ta.value = md;
|
|
1616
|
+
ta.style.cssText = 'position:fixed;top:0;left:0;width:1px;height:1px;padding:0;border:none;outline:none;box-shadow:none;background:transparent;';
|
|
1617
|
+
document.body.appendChild(ta);
|
|
1618
|
+
ta.focus();
|
|
1619
|
+
ta.select();
|
|
1620
|
+
document.execCommand('copy');
|
|
1621
|
+
document.body.removeChild(ta);
|
|
1622
|
+
}
|
|
1623
|
+
|
|
1624
|
+
showTooltip('✓ Copied to clipboard!', 'success');
|
|
1625
|
+
} catch (err) {
|
|
1626
|
+
showTooltip('✗ Copy failed: ' + err.message, 'error');
|
|
1627
|
+
}
|
|
1628
|
+
});
|
|
1629
|
+
|
|
1630
|
+
function toggleDropdown() {
|
|
1631
|
+
isOpen ? closeDropdown() : openDropdown();
|
|
1632
|
+
}
|
|
1633
|
+
|
|
1634
|
+
function openDropdown() {
|
|
1635
|
+
isOpen = true;
|
|
1636
|
+
dropdown.classList.remove('hidden');
|
|
1637
|
+
// Force reflow before adding animation classes
|
|
1638
|
+
dropdown.offsetHeight;
|
|
1639
|
+
dropdown.classList.remove('opacity-0', 'scale-95');
|
|
1640
|
+
dropdown.classList.add('opacity-100', 'scale-100');
|
|
1641
|
+
if (arrow) arrow.style.transform = 'rotate(180deg)';
|
|
1642
|
+
}
|
|
1643
|
+
|
|
1644
|
+
function closeDropdown() {
|
|
1645
|
+
if (!isOpen) return;
|
|
1646
|
+
isOpen = false;
|
|
1647
|
+
dropdown.classList.remove('opacity-100', 'scale-100');
|
|
1648
|
+
dropdown.classList.add('opacity-0', 'scale-95');
|
|
1649
|
+
if (arrow) arrow.style.transform = '';
|
|
1650
|
+
// Hide after animation
|
|
1651
|
+
setTimeout(() => {
|
|
1652
|
+
if (!isOpen) dropdown.classList.add('hidden');
|
|
1653
|
+
}, 100);
|
|
1654
|
+
}
|
|
1655
|
+
|
|
1656
|
+
function showTooltip(message, type = 'success') {
|
|
1657
|
+
closeDropdown();
|
|
1658
|
+
|
|
1659
|
+
if (copyTooltip) {
|
|
1660
|
+
// Update tooltip content and styling based on type
|
|
1661
|
+
copyTooltip.setContent(message);
|
|
1662
|
+
|
|
1663
|
+
// Set theme based on success/error
|
|
1664
|
+
const theme = type === 'success' ? 'light-success' : 'light-error';
|
|
1665
|
+
copyTooltip.setProps({ theme: theme });
|
|
1666
|
+
|
|
1667
|
+
// Show tooltip
|
|
1668
|
+
copyTooltip.show();
|
|
1669
|
+
|
|
1670
|
+
// Hide after 2 seconds
|
|
1671
|
+
setTimeout(() => {
|
|
1672
|
+
if (copyTooltip) {
|
|
1673
|
+
copyTooltip.hide();
|
|
1674
|
+
// Reset to default content and theme
|
|
1675
|
+
setTimeout(() => {
|
|
1676
|
+
if (copyTooltip) {
|
|
1677
|
+
copyTooltip.setContent('Copy as Markdown');
|
|
1678
|
+
copyTooltip.setProps({ theme: 'light' });
|
|
1679
|
+
}
|
|
1680
|
+
}, 200);
|
|
1681
|
+
}
|
|
1682
|
+
}, 2000);
|
|
1683
|
+
}
|
|
1684
|
+
}
|
|
1685
|
+
});
|
|
1686
|
+
}
|
|
1687
|
+
})();
|
|
1688
|
+
</script>
|
|
1689
|
+
|
|
1690
|
+
|
|
1691
|
+
|
|
1692
|
+
</div>
|
|
1693
|
+
|
|
1694
|
+
|
|
1695
|
+
|
|
1696
|
+
|
|
1697
|
+
<div class="rounded-lg border text-card-foreground bg-amp-gray-50 border-amp-gray-200 shadow-sm mb-8"
|
|
1698
|
+
data-bundle-package="@amplitude/unified"
|
|
1699
|
+
data-bundle-loader="true"
|
|
1700
|
+
data-environment="production">
|
|
1701
|
+
<div class="p-4">
|
|
1702
|
+
<div class="flex items-center gap-2 mb-3">
|
|
1703
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"
|
|
1704
|
+
viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
|
|
1705
|
+
stroke-linejoin="round" class="lucide lucide-package h-4 w-4 text-amp-gray-600">
|
|
1706
|
+
<path d="m7.5 4.27 9 5.15"></path>
|
|
1707
|
+
<path
|
|
1708
|
+
d="M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z">
|
|
1709
|
+
</path>
|
|
1710
|
+
<path d="m3.3 7 8.7 5 8.7-5"></path>
|
|
1711
|
+
<path d="M12 22V12"></path>
|
|
1712
|
+
</svg>
|
|
1713
|
+
<h3 class="font-medium text-amp-gray-900 text-sm m-0">
|
|
1714
|
+
<a href="https://npmjs.com/package/@amplitude/unified" target="_blank">Package Information</a>
|
|
1715
|
+
</h3>
|
|
1716
|
+
</div>
|
|
1717
|
+
<div class="space-y-2.5">
|
|
1718
|
+
<div>
|
|
1719
|
+
<div class="text-xs text-amp-gray-500 mb-1">Package Name</div>
|
|
1720
|
+
<code class="block font-mono text-xs bg-white px-2 py-1.5 rounded border border-amp-gray-200 text-amp-gray-700 w-full overflow-x-auto">@amplitude/unified</code>
|
|
1721
|
+
</div>
|
|
1722
|
+
<div class="flex justify-between items-center">
|
|
1723
|
+
<div>
|
|
1724
|
+
<div class="text-xs text-amp-gray-500 mb-1">Version</div>
|
|
1725
|
+
<div class="bundle-version">
|
|
1726
|
+
<div class="animate-pulse bg-amp-gray-200 h-5 w-16 rounded"></div>
|
|
1727
|
+
</div>
|
|
1728
|
+
</div>
|
|
1729
|
+
<div class="text-right">
|
|
1730
|
+
<div class="text-xs text-amp-gray-500 mb-1">Size (gzip)</div>
|
|
1731
|
+
<div class="bundle-size">
|
|
1732
|
+
<div class="animate-pulse bg-amp-gray-200 h-5 w-12 rounded"></div>
|
|
1733
|
+
</div>
|
|
1734
|
+
</div>
|
|
1735
|
+
</div>
|
|
1736
|
+
</div>
|
|
1737
|
+
</div>
|
|
1738
|
+
</div>
|
|
1739
|
+
|
|
1740
|
+
|
|
1741
|
+
|
|
1742
|
+
<script>
|
|
1743
|
+
document.addEventListener('DOMContentLoaded', function() {
|
|
1744
|
+
const bundleCards = document.querySelectorAll('[data-bundle-loader]');
|
|
1745
|
+
|
|
1746
|
+
// Skip if no cards need loading (server-side data was successful)
|
|
1747
|
+
if (bundleCards.length === 0) return;
|
|
1748
|
+
|
|
1749
|
+
bundleCards.forEach(async (card) => {
|
|
1750
|
+
const packageName = card.dataset.bundlePackage;
|
|
1751
|
+
const environment = card.dataset.environment;
|
|
1752
|
+
|
|
1753
|
+
try {
|
|
1754
|
+
let data;
|
|
1755
|
+
let dataSource = 'unknown';
|
|
1756
|
+
|
|
1757
|
+
// Only try Laravel API in local/development (NOT preview/production)
|
|
1758
|
+
if (environment === 'local' || environment === 'development') {
|
|
1759
|
+
try {
|
|
1760
|
+
const response = await fetch(`/api/bundle-phobia?package=${encodeURIComponent(packageName)}`);
|
|
1761
|
+
if (response.ok) {
|
|
1762
|
+
data = await response.json();
|
|
1763
|
+
if (data._bundlephobia_success) {
|
|
1764
|
+
dataSource = data._bundlephobia_cached ? 'laravel-cache' : 'laravel-live';
|
|
1765
|
+
updateBundleSuccess(card, data, dataSource);
|
|
1766
|
+
return;
|
|
1767
|
+
}
|
|
1768
|
+
}
|
|
1769
|
+
} catch (apiError) {
|
|
1770
|
+
console.warn('Laravel API not available, falling back to direct BundlePhobia API');
|
|
1771
|
+
}
|
|
1772
|
+
} else {
|
|
1773
|
+
console.log(`Skipping Laravel API for environment: ${environment}`);
|
|
1774
|
+
}
|
|
1775
|
+
|
|
1776
|
+
// Direct BundlePhobia API (works in all environments)
|
|
1777
|
+
const response = await fetch(`https://bundlephobia.com/api/size?package=${encodeURIComponent(packageName)}`);
|
|
1778
|
+
|
|
1779
|
+
if (response.ok) {
|
|
1780
|
+
const directData = await response.json();
|
|
1781
|
+
if (directData && directData.size) {
|
|
1782
|
+
// Transform direct API response to match our format
|
|
1783
|
+
const transformedData = {
|
|
1784
|
+
name: directData.name || packageName,
|
|
1785
|
+
version: directData.version || 'Latest',
|
|
1786
|
+
size_gzip_kb: directData.gzip ? Math.round(directData.gzip / 1024 * 100) / 100 : 'N/A'
|
|
1787
|
+
};
|
|
1788
|
+
dataSource = 'bundlephobia-direct';
|
|
1789
|
+
updateBundleSuccess(card, transformedData, dataSource);
|
|
1790
|
+
return;
|
|
1791
|
+
}
|
|
1792
|
+
}
|
|
1793
|
+
|
|
1794
|
+
// Both APIs failed
|
|
1795
|
+
showBundleError(card, packageName, 'Unable to fetch bundle data');
|
|
1796
|
+
|
|
1797
|
+
} catch (error) {
|
|
1798
|
+
console.warn('Bundle size fetch failed:', error);
|
|
1799
|
+
showBundleError(card, packageName, 'Network error');
|
|
1800
|
+
}
|
|
1801
|
+
});
|
|
1802
|
+
|
|
1803
|
+
function updateBundleSuccess(card, data, source) {
|
|
1804
|
+
card.querySelector('.bundle-version').innerHTML =
|
|
1805
|
+
`<div class="font-medium text-amp-gray-900">${data.version}</div>`;
|
|
1806
|
+
card.querySelector('.bundle-size').innerHTML =
|
|
1807
|
+
`<div class="font-medium text-amp-gray-900">${data.size_gzip_kb} kB</div>`;
|
|
1808
|
+
|
|
1809
|
+
// Add source indicator
|
|
1810
|
+
const sourceIndicator = getSourceIndicator(source, data);
|
|
1811
|
+
card.querySelector('h3').innerHTML += sourceIndicator;
|
|
1812
|
+
|
|
1813
|
+
// Mark as loaded
|
|
1814
|
+
card.removeAttribute('data-bundle-loader');
|
|
1815
|
+
card.setAttribute('data-bundle-loaded', 'true');
|
|
1816
|
+
}
|
|
1817
|
+
|
|
1818
|
+
function getSourceIndicator(source, data) {
|
|
1819
|
+
switch (source) {
|
|
1820
|
+
case 'laravel-cache':
|
|
1821
|
+
return '<span class="ml-2 text-xs bg-blue-100 text-blue-700 px-2 py-0.5 rounded" title="Data from Laravel cache">Cached</span>';
|
|
1822
|
+
case 'laravel-live':
|
|
1823
|
+
return '<span class="ml-2 text-xs bg-green-100 text-green-700 px-2 py-0.5 rounded" title="Fresh data from Laravel">Live</span>';
|
|
1824
|
+
case 'bundlephobia-direct':
|
|
1825
|
+
return '<span class="ml-2 text-xs bg-yellow-100 text-yellow-700 px-2 py-0.5 rounded" title="Direct from BundlePhobia API">Direct</span>';
|
|
1826
|
+
default:
|
|
1827
|
+
return '';
|
|
1828
|
+
}
|
|
1829
|
+
}
|
|
1830
|
+
|
|
1831
|
+
function showBundleError(card, packageName, errorMessage) {
|
|
1832
|
+
const flexContainer = card.querySelector('.flex.justify-between');
|
|
1833
|
+
flexContainer.innerHTML = `
|
|
1834
|
+
<div class="p-3 bg-white border border-amp-gray-200 rounded text-sm text-amp-gray-700 w-full">
|
|
1835
|
+
<p class="m-0 mb-2"><strong>Bundle size information temporarily unavailable.</strong></p>
|
|
1836
|
+
<p class="m-0 text-xs text-amp-gray-600">
|
|
1837
|
+
Visit <a href="https://bundlephobia.com/package/${packageName}" target="_blank" class="text-amp-blue-600 underline">BundlePhobia</a>
|
|
1838
|
+
or <a href="https://npmjs.com/package/${packageName}" target="_blank" class="text-app-blue-600 underline">npm</a>
|
|
1839
|
+
for current package details.
|
|
1840
|
+
</p>
|
|
1841
|
+
</div>
|
|
1842
|
+
`;
|
|
1843
|
+
|
|
1844
|
+
card.removeAttribute('data-bundle-loader');
|
|
1845
|
+
card.setAttribute('data-bundle-loaded', 'error');
|
|
1846
|
+
}
|
|
1847
|
+
});
|
|
1848
|
+
</script>
|
|
1849
|
+
|
|
1850
|
+
|
|
1851
|
+
|
|
1852
|
+
|
|
1853
|
+
|
|
1854
|
+
<div class="sticky top-24 ml-8 text-sm js-toc">
|
|
1855
|
+
</div>
|
|
1856
|
+
|
|
1857
|
+
</div>
|
|
1858
|
+
|
|
1859
|
+
|
|
1860
|
+
</div>
|
|
1861
|
+
</div>
|
|
1862
|
+
|
|
1863
|
+
<div class="mt-12 mb-5 max-w-screen-xl mx-auto pl-8">
|
|
1864
|
+
<div class="inline-flex items-center">
|
|
1865
|
+
<span class="text-sm text-amp-gray-600 mr-4">Was this page helpful?</span>
|
|
1866
|
+
<div class="inline-flex flex-row-reverse items-center">
|
|
1867
|
+
<button @click="amplitude.track('Article rating')" class="article-rating inline-flex flex-row-reverse items-center">
|
|
1868
|
+
|
|
1869
|
+
<svg xmlns="http://www.w3.org/2000/svg"
|
|
1870
|
+
class="inline cursor-pointer"
|
|
1871
|
+
height="24px" viewBox="0 -960 960 960" width="24px" fill="#e8eaed">
|
|
1872
|
+
<path
|
|
1873
|
+
d="m354-287 126-76 126 77-33-144 111-96-146-13-58-136-58 135-146 13 111 97-33 143ZM233-120l65-281L80-590l288-25 112-265 112 265 288 25-218 189 65 281-247-149-247 149Zm247-350Z">
|
|
1874
|
+
</path>
|
|
1875
|
+
</svg>
|
|
1876
|
+
|
|
1877
|
+
<svg xmlns="http://www.w3.org/2000/svg"
|
|
1878
|
+
class="inline cursor-pointer"
|
|
1879
|
+
height="24px" viewBox="0 -960 960 960" width="24px" fill="#e8eaed">
|
|
1880
|
+
<path
|
|
1881
|
+
d="m354-287 126-76 126 77-33-144 111-96-146-13-58-136-58 135-146 13 111 97-33 143ZM233-120l65-281L80-590l288-25 112-265 112 265 288 25-218 189 65 281-247-149-247 149Zm247-350Z">
|
|
1882
|
+
</path>
|
|
1883
|
+
</svg>
|
|
1884
|
+
|
|
1885
|
+
<svg xmlns="http://www.w3.org/2000/svg"
|
|
1886
|
+
class="inline cursor-pointer"
|
|
1887
|
+
height="24px" viewBox="0 -960 960 960" width="24px" fill="#e8eaed">
|
|
1888
|
+
<path
|
|
1889
|
+
d="m354-287 126-76 126 77-33-144 111-96-146-13-58-136-58 135-146 13 111 97-33 143ZM233-120l65-281L80-590l288-25 112-265 112 265 288 25-218 189 65 281-247-149-247 149Zm247-350Z">
|
|
1890
|
+
</path>
|
|
1891
|
+
</svg>
|
|
1892
|
+
|
|
1893
|
+
<svg xmlns="http://www.w3.org/2000/svg"
|
|
1894
|
+
class="inline cursor-pointer"
|
|
1895
|
+
height="24px" viewBox="0 -960 960 960" width="24px" fill="#e8eaed">
|
|
1896
|
+
<path
|
|
1897
|
+
d="m354-287 126-76 126 77-33-144 111-96-146-13-58-136-58 135-146 13 111 97-33 143ZM233-120l65-281L80-590l288-25 112-265 112 265 288 25-218 189 65 281-247-149-247 149Zm247-350Z">
|
|
1898
|
+
</path>
|
|
1899
|
+
</svg>
|
|
1900
|
+
|
|
1901
|
+
<svg xmlns="http://www.w3.org/2000/svg"
|
|
1902
|
+
class="inline cursor-pointer"
|
|
1903
|
+
height="24px" viewBox="0 -960 960 960" width="24px" fill="#e8eaed">
|
|
1904
|
+
<path
|
|
1905
|
+
d="m354-287 126-76 126 77-33-144 111-96-146-13-58-136-58 135-146 13 111 97-33 143ZM233-120l65-281L80-590l288-25 112-265 112 265 288 25-218 189 65 281-247-149-247 149Zm247-350Z">
|
|
1906
|
+
</path>
|
|
1907
|
+
</svg>
|
|
1908
|
+
|
|
1909
|
+
</button>
|
|
1910
|
+
</div>
|
|
1911
|
+
</div>
|
|
1912
|
+
|
|
1913
|
+
|
|
1914
|
+
<p class="text-xs text-amp-gray-600"><svg class="inline" xmlns="http://www.w3.org/2000/svg" width="20" height="21" viewBox="0 0 20 21" fill="none"><g id="schedule"><mask id="mask0_388_26358" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="20" height="21"><rect id="Bounding box" y="0.987793" width="20" height="20" fill="#D9D9D9"/></mask><g mask="url(#mask0_388_26358)"><path id="schedule_2" d="M12.7917 14.5295L13.8542 13.467L10.75 10.3628V5.98779H9.25V10.9878L12.7917 14.5295ZM10 18.9878C8.89756 18.9878 7.86153 18.7795 6.89192 18.3628C5.92231 17.9461 5.07292 17.3732 4.34375 16.644C3.61458 15.9149 3.04167 15.0645 2.625 14.0928C2.20833 13.1212 2 12.083 2 10.9783C2 9.8735 2.20833 8.83502 2.625 7.86279C3.04167 6.89057 3.61458 6.04335 4.34375 5.32113C5.07292 4.5989 5.92332 4.02946 6.89496 3.61279C7.86661 3.19613 8.90481 2.98779 10.0095 2.98779C11.1143 2.98779 12.1528 3.19779 13.1251 3.61779C14.0974 4.03779 14.9432 4.60779 15.6625 5.32779C16.3817 6.04779 16.9511 6.89446 17.3707 7.86779C17.7902 8.84113 18 9.88113 18 10.9878C18 12.0902 17.7917 13.1263 17.375 14.0959C16.9583 15.0655 16.3889 15.9149 15.6667 16.644C14.9444 17.3732 14.0963 17.9461 13.1223 18.3628C12.1482 18.7795 11.1075 18.9878 10 18.9878ZM10.0099 17.4878C11.8082 17.4878 13.3395 16.8524 14.6037 15.5815C15.8679 14.3107 16.5 12.7761 16.5 10.9779C16.5 9.17956 15.8679 7.64831 14.6037 6.38411C13.3395 5.1199 11.8082 4.48779 10.0099 4.48779C8.21165 4.48779 6.67708 5.1199 5.40625 6.38411C4.13542 7.64831 3.5 9.17956 3.5 10.9779C3.5 12.7761 4.13542 14.3107 5.40625 15.5815C6.67708 16.8524 8.21165 17.4878 10.0099 17.4878Z" fill="#5A5E68"/></g></g></svg> April 15th, 2026</p>
|
|
1915
|
+
</div>
|
|
1916
|
+
|
|
1917
|
+
<div class="pl-8 border-y border-y-amp-gray-100 py-[2.12rem] gap-2">
|
|
1918
|
+
<div class="flex flex-col max-w-screen-xl mx-auto">
|
|
1919
|
+
<div><svg class="inline" xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="currentColor"><path d="M478-240q21 0 35.5-14.5T528-290q0-21-14.5-35.5T478-340q-21 0-35.5 14.5T428-290q0 21 14.5 35.5T478-240Zm-36-154h74q0-33 7.5-52t42.5-52q26-26 41-49.5t15-56.5q0-56-41-86t-97-30q-57 0-92.5 30T342-618l66 26q5-18 22.5-39t53.5-21q32 0 48 17.5t16 38.5q0 20-12 37.5T506-526q-44 39-54 59t-10 73Zm38 314q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Zm0-320Z"/></svg> <p class="text-[0.875rem] text-amp-gray-600 inline">Need help? <a href="https://help.amplitude.com/hc/en-us/requests/new" class="text-amp-blue-300" target="_blank">Contact Support</a></p></div>
|
|
1920
|
+
<div><svg class="inline" xmlns="http://www.w3.org/2000/svg" width="20" height="21" viewBox="0 0 20 21" fill="none"><g id="icon-amplitude"><path id="Vector" fill-rule="evenodd" clip-rule="evenodd" d="M9.1805 7.21649C9.28367 7.3667 9.462 7.70394 9.72592 8.45712C9.90642 8.97243 10.1034 9.61079 10.3118 10.3556C9.52125 10.3442 8.72133 10.3356 7.94682 10.3275L7.55457 10.3232C7.99767 8.69717 8.53825 7.46332 8.93333 7.17198C8.95858 7.15678 8.99775 7.13881 9.04067 7.13881C9.0925 7.13881 9.13933 7.16553 9.1805 7.21649ZM15.3935 11.1677C15.393 11.1681 15.3924 11.1685 15.3918 11.169C15.3837 11.1756 15.3755 11.1819 15.3669 11.1878C15.3642 11.1897 15.3614 11.1917 15.3587 11.1936C15.3529 11.1973 15.347 11.2009 15.341 11.2043C15.3357 11.2075 15.3303 11.2108 15.3247 11.2137C15.3244 11.2139 15.324 11.214 15.3237 11.2142C15.2685 11.2433 15.2057 11.26 15.139 11.26H11.5864C11.6148 11.3784 11.6459 11.5129 11.6796 11.6593C11.8743 12.5048 12.3915 14.751 12.941 14.751L12.9517 14.7512L12.9578 14.7504L12.9683 14.7505C13.3974 14.7504 13.6165 14.1263 14.0966 12.759L14.1024 12.7425C14.1795 12.523 14.2666 12.2752 14.3608 12.013L14.3847 11.9462C14.4092 11.8808 14.4722 11.8344 14.5459 11.8344C14.6408 11.8344 14.7178 11.9118 14.7178 12.0073C14.7178 12.0245 14.7152 12.0413 14.7104 12.057L14.6906 12.1243C14.6404 12.287 14.5872 12.5087 14.5257 12.7653C14.2396 13.9579 13.8072 15.7596 12.6982 15.7596L12.6901 15.7595C11.9735 15.7539 11.5447 14.6017 11.3616 14.1097C11.0191 13.1897 10.76 12.2094 10.5101 11.26H7.23993L6.56109 13.4451L6.55113 13.4372C6.48906 13.5355 6.38018 13.5985 6.26002 13.5985C6.07048 13.5985 5.91552 13.4433 5.91467 13.2527L5.91509 13.2409L5.95619 12.9937C6.04997 12.4322 6.16233 11.8494 6.29045 11.26H4.90945L4.90435 11.2547C4.65368 11.2184 4.46117 10.996 4.46117 10.7368C4.46117 10.4825 4.64008 10.2661 4.88658 10.2221C4.90926 10.2192 4.95487 10.2153 5.04815 10.2153C5.06812 10.2153 5.09045 10.2155 5.11524 10.2159C5.55302 10.2235 6.01729 10.2305 6.52668 10.237C7.24757 7.29145 8.08242 5.79619 9.00842 5.79196C10.0022 5.79196 10.7393 8.06763 11.3294 10.2936L11.3317 10.3025C12.5441 10.3269 13.8364 10.3625 15.0926 10.4529L15.1452 10.4579C15.1654 10.4581 15.1852 10.4602 15.2045 10.4634L15.2118 10.4641C15.2141 10.4645 15.2161 10.4651 15.2182 10.4655C15.2193 10.4657 15.2205 10.466 15.2216 10.4662C15.4044 10.503 15.5401 10.6645 15.5401 10.8581C15.5401 10.9822 15.483 11.094 15.3935 11.1677ZM10 3.48779C5.85787 3.48779 2.5 6.86485 2.5 11.0306C2.5 15.1965 5.85787 18.5735 10 18.5735C14.1421 18.5735 17.5 15.1965 17.5 11.0306C17.5 6.86485 14.1421 3.48779 10 3.48779Z" fill="#5A5E68"/></g></svg> <p class="text-[0.875rem] text-amp-gray-600 inline">Visit <a href="https://www.amplitude.com" class="text-amp-blue-300" target="_blank">Amplitude.com</a></p></div>
|
|
1921
|
+
<div><svg class="inline" xmlns="http://www.w3.org/2000/svg" width="20" height="21" viewBox="0 0 20 21" fill="none"><g id="Icon Blog"><path id="Vector" d="M16.875 4.04193H3.125C2.39584 4.04193 1.80417 4.6336 1.80417 5.36276V16.6128C1.80417 17.3419 2.39584 17.9336 3.125 17.9336H16.875C17.6042 17.9336 18.1958 17.3419 18.1958 16.6128V5.36276C18.1958 4.6336 17.6042 4.04193 16.875 4.04193ZM16.8042 16.5419H3.2V5.43776H16.8042V16.5419ZM5.55417 8.48776C5.55417 8.10443 5.86667 7.79193 6.25 7.79193H13.75C14.1375 7.79193 14.4458 8.10443 14.4458 8.48776C14.4458 8.8711 14.1333 9.1836 13.75 9.1836H6.25C5.8625 9.1836 5.55417 8.8711 5.55417 8.48776ZM5.55417 10.9878C5.55417 10.6044 5.86667 10.2919 6.25 10.2919H13.75C14.1375 10.2919 14.4458 10.6044 14.4458 10.9878C14.4458 11.3711 14.1333 11.6836 13.75 11.6836H6.25C5.8625 11.6836 5.55417 11.3711 5.55417 10.9878ZM5.55417 13.4878C5.55417 13.1044 5.86667 12.7919 6.25 12.7919H13.75C14.1375 12.7919 14.4458 13.1044 14.4458 13.4878C14.4458 13.8711 14.1333 14.1836 13.75 14.1836H6.25C5.8625 14.1836 5.55417 13.8711 5.55417 13.4878Z" fill="#5A5E68"/></g></svg> <p class="text-[0.875rem] text-amp-gray-600 inline">Have a look at the Amplitude <a href="https://amplitude.com/blog" class="text-amp-blue-300" target="_blank">Blog</a></p></div>
|
|
1922
|
+
<div><svg class="inline" xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="currentColor"><path d="M478-240q21 0 35.5-14.5T528-290q0-21-14.5-35.5T478-340q-21 0-35.5 14.5T428-290q0 21 14.5 35.5T478-240Zm-36-154h74q0-33 7.5-52t42.5-52q26-26 41-49.5t15-56.5q0-56-41-86t-97-30q-57 0-92.5 30T342-618l66 26q5-18 22.5-39t53.5-21q32 0 48 17.5t16 38.5q0 20-12 37.5T506-526q-44 39-54 59t-10 73Zm38 314q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Zm0-320Z"/></svg> <p class="text-[0.875rem] text-amp-gray-600 inline">Learn more at <a href="https://academy.amplitude.com/" class="text-amp-blue-300" target="_blank">Amplitude Academy</a></p></div>
|
|
1923
|
+
|
|
1924
|
+
</div>
|
|
1925
|
+
</div>
|
|
1926
|
+
<div class="pl-8 border-b border-b-amp-gray-100 flex flex-col py-[2.12rem] gap-2">
|
|
1927
|
+
<div class="flex flex-row justify-between items-center max-w-screen-xl">
|
|
1928
|
+
<div class="flex flex-row">
|
|
1929
|
+
|
|
1930
|
+
<a href="https://www.linkedin.com/company/amplitude-analytics" class="mr-4" target="_blank">
|
|
1931
|
+
<svg class="w-6 h-6 fill-amp-gray-600" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><g id="Icon"><path id="Vector" d="M19.7778 2C20.3671 2 20.9324 2.23413 21.3491 2.65087C21.7659 3.06762 22 3.63285 22 4.22222V19.7778C22 20.3671 21.7659 20.9324 21.3491 21.3491C20.9324 21.7659 20.3671 22 19.7778 22H4.22222C3.63285 22 3.06762 21.7659 2.65087 21.3491C2.23413 20.9324 2 20.3671 2 19.7778V4.22222C2 3.63285 2.23413 3.06762 2.65087 2.65087C3.06762 2.23413 3.63285 2 4.22222 2H19.7778ZM19.2222 19.2222V13.3333C19.2222 12.3727 18.8406 11.4513 18.1613 10.772C17.482 10.0927 16.5607 9.71111 15.6 9.71111C14.6556 9.71111 13.5556 10.2889 13.0222 11.1556V9.92222H9.92222V19.2222H13.0222V13.7444C13.0222 12.8889 13.7111 12.1889 14.5667 12.1889C14.9792 12.1889 15.3749 12.3528 15.6666 12.6445C15.9583 12.9362 16.1222 13.3319 16.1222 13.7444V19.2222H19.2222ZM6.31111 8.17778C6.80618 8.17778 7.28098 7.98111 7.63104 7.63104C7.98111 7.28098 8.17778 6.80618 8.17778 6.31111C8.17778 5.27778 7.34444 4.43333 6.31111 4.43333C5.81309 4.43333 5.33547 4.63117 4.98332 4.98332C4.63117 5.33547 4.43333 5.81309 4.43333 6.31111C4.43333 7.34444 5.27778 8.17778 6.31111 8.17778ZM7.85556 19.2222V9.92222H4.77778V19.2222H7.85556Z"/></g></svg>
|
|
1932
|
+
</a>
|
|
1933
|
+
|
|
1934
|
+
<a href="https://twitter.com/Amplitude_HQ" class="mr-4" target="_blank">
|
|
1935
|
+
<svg class="w-6 h-6 fill-amp-gray-600" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"><g id="Frame 4824"><path id="Vector" d="M24 4.29446C23.1166 4.69598 22.1644 4.95985 21.1778 5.08604C22.1874 4.47801 22.9675 3.51434 23.3346 2.35564C22.3824 2.92925 21.327 3.33078 20.2141 3.56023C19.3078 2.57361 18.0344 2 16.5889 2C13.8929 2 11.6902 4.20268 11.6902 6.92161C11.6902 7.31166 11.7361 7.69025 11.8164 8.04589C7.73231 7.83939 4.0956 5.87763 1.67495 2.90631C1.25048 3.62906 1.00956 4.47801 1.00956 5.37285C1.00956 7.08222 1.86998 8.59656 3.20077 9.45698C2.38623 9.45698 1.62906 9.22753 0.963671 8.88337C0.963671 8.88337 0.963671 8.88337 0.963671 8.91778C0.963671 11.304 2.66157 13.3002 4.91013 13.7476C4.49713 13.8623 4.06119 13.9197 3.61377 13.9197C3.30402 13.9197 2.99426 13.8853 2.69599 13.8279C3.31549 15.7667 5.11664 17.2122 7.2849 17.2467C5.60994 18.5774 3.48757 19.3576 1.17017 19.3576C0.780115 19.3576 0.390057 19.3346 0 19.2887C2.17973 20.6883 4.77247 21.5029 7.54876 21.5029C16.5889 21.5029 21.5564 14 21.5564 7.49522C21.5564 7.27725 21.5564 7.07075 21.5449 6.85277C22.5086 6.16444 23.3346 5.29254 24 4.29446Z"/></g></svg>
|
|
1936
|
+
</a>
|
|
1937
|
+
|
|
1938
|
+
<a href="https://www.g2.com/products/amplitude-analytics/reviews" class="mr-4" target="_blank">
|
|
1939
|
+
<svg class="w-6 h-6 fill-amp-gray-600" xmlns="http://www.w3.org/2000/svg" width="21" height="20" viewBox="0 0 21 20"><g id="Frame 4825"><path id="path8" d="M11.0327 20C6.57742 19.9883 2.69803 17.1751 1.42954 12.9766C0.37117 9.45907 1.056 6.24504 3.43733 3.43569C4.90037 1.70805 6.78365 0.649677 9.00155 0.198312C10.2428 -0.0546084 11.5191 -0.0662816 12.7642 0.167183C12.9043 0.194421 12.9043 0.22944 12.8498 0.342281C12.2389 1.61466 11.628 2.89094 11.0249 4.16721C10.9938 4.24892 10.9121 4.29951 10.8226 4.29172C8.19999 4.35787 5.95874 6.20224 5.39064 8.76257C4.77975 11.4824 6.25057 14.2957 8.8498 15.2957C10.9121 16.0856 12.8265 15.7704 14.5736 14.4202C14.6631 14.354 14.6981 14.3385 14.7642 14.4513C15.4335 15.6225 16.1066 16.7899 16.7876 17.9572C16.8459 18.0584 16.8265 18.105 16.737 18.1673C15.4218 19.0973 13.9043 19.6926 12.309 19.9066C11.8809 19.9572 11.4568 19.9883 11.0327 20Z"/><path id="path10" d="M17.9512 17.105C17.8967 17.0739 17.8812 17.0155 17.8539 16.9649C17.0913 15.6497 16.3364 14.3345 15.5815 13.0155C15.5271 12.9065 15.4103 12.8404 15.2897 12.852C13.78 12.8559 12.2702 12.852 10.7605 12.852H10.5737C10.5737 12.7937 10.5932 12.7392 10.6321 12.6964C11.3986 11.3657 12.1652 10.031 12.9356 8.70027C12.9784 8.61078 13.0718 8.5563 13.173 8.56797C14.7177 8.57186 16.2664 8.57186 17.8111 8.56797C17.9084 8.5563 18.0018 8.61078 18.0446 8.70027C18.815 10.0427 19.5893 11.3851 20.3675 12.7275C20.422 12.7976 20.422 12.8949 20.3753 12.9688C19.5932 14.319 18.815 15.6653 18.0407 17.0155C18.0096 17.0427 18.0018 17.0894 17.9512 17.105Z"/><path id="path12" d="M14.6983 2.95331C14.422 2.67704 14.1613 2.41245 13.8967 2.15175C13.815 2.07004 13.8734 2.01167 13.9084 1.94941C14.2158 1.41634 14.7139 1.01945 15.3014 0.844348C16.0213 0.606992 16.8111 0.684814 17.4726 1.05836C18.675 1.70817 18.5699 3.2179 17.8734 3.90273C17.6088 4.15565 17.3131 4.36966 16.9862 4.54087C16.6516 4.71986 16.317 4.88718 15.9901 5.07784C15.7177 5.23348 15.5076 5.44749 15.4065 5.76267C15.3676 5.88718 15.3909 5.9222 15.5232 5.91831C16.4065 5.91442 17.2936 5.91831 18.1769 5.91442C18.3092 5.91442 18.3598 5.94166 18.3559 6.08563C18.3442 6.39691 18.3481 6.71209 18.3559 7.02338C18.3559 7.12065 18.3287 7.15567 18.2275 7.15567C16.8072 7.15178 15.3831 7.15178 13.9629 7.15567C13.8967 7.15567 13.8345 7.15567 13.8345 7.0584C13.8345 6.07395 14.0174 5.15566 14.7878 4.45527C15.1535 4.12842 15.566 3.85993 16.0096 3.6537C16.2547 3.53308 16.4999 3.42024 16.71 3.24903C16.8967 3.09728 17.0251 2.9144 17.0368 2.66537C17.0563 2.27626 16.7489 1.99222 16.2858 1.96109C15.6205 1.91439 15.1419 2.21401 14.8033 2.77043C14.7722 2.81712 14.7411 2.8716 14.6983 2.95331Z"/><path id="path14" d="M18.0869 18.5058V18.1828H17.9702V18.1167H18.2776V18.1828H18.1609V18.5058H18.0869ZM18.3321 18.5058V18.1167H18.4488L18.515 18.3813L18.5811 18.1167H18.6978V18.5058H18.6317V18.2023L18.5539 18.5058H18.4799L18.4021 18.2023V18.5058H18.3321Z"/></g></svg>
|
|
1940
|
+
</a>
|
|
1941
|
+
|
|
1942
|
+
</div>
|
|
1943
|
+
<div class="flex flex-col pr-8">
|
|
1944
|
+
<div class="flex flex-row justify-between">
|
|
1945
|
+
|
|
1946
|
+
<a class="text-amp-gray-600 text-[0.875rem] font-[Gellix]" href="https://amplitude.com/terms" target="_blank">Terms of Service</a>
|
|
1947
|
+
|
|
1948
|
+
<a class="text-amp-gray-600 text-[0.875rem] font-[Gellix]" href="https://amplitude.com/privacy" target="_blank">Privacy Notice</a>
|
|
1949
|
+
|
|
1950
|
+
<a class="text-amp-gray-600 text-[0.875rem] font-[Gellix]" href="https://amplitude.com/aup" target="_blank">Acceptable Use Policy</a>
|
|
1951
|
+
|
|
1952
|
+
<a class="text-amp-gray-600 text-[0.875rem] font-[Gellix]" href="https://amplitude.com/legal" target="_blank">Legal</a>
|
|
1953
|
+
|
|
1954
|
+
</div>
|
|
1955
|
+
<div><p class="text-[0.815rem] text-amp-gray-600 opacity-80 font-[Gellix]">© 2026 Amplitude, Inc. All rights reserved. Amplitude is a registered trademark of Amplitude, Inc.</p></div>
|
|
1956
|
+
</div>
|
|
1957
|
+
</div>
|
|
1958
|
+
</div>
|
|
1959
|
+
</section>
|
|
1960
|
+
</div>
|
|
1961
|
+
</div>
|
|
1962
|
+
|
|
1963
|
+
</div>
|
|
1964
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/tocbot/4.25.0/tocbot.min.js"></script>
|
|
1965
|
+
<script>
|
|
1966
|
+
|
|
1967
|
+
// Get all h2 and h3 elements
|
|
1968
|
+
var headings = document.querySelectorAll('h2, h3');
|
|
1969
|
+
|
|
1970
|
+
// Check if there are more than 3
|
|
1971
|
+
if (headings.length > 2) {
|
|
1972
|
+
// Execute your code here
|
|
1973
|
+
tocbot.init({
|
|
1974
|
+
// Where to render the table of contents.
|
|
1975
|
+
tocSelector: '.js-toc',
|
|
1976
|
+
// Where to grab the headings to build the table of contents.
|
|
1977
|
+
contentSelector: '.prose',
|
|
1978
|
+
// Which headings to grab inside of the contentSelector element.
|
|
1979
|
+
headingSelector: 'h2, h3',
|
|
1980
|
+
// For headings inside relative or absolute positioned containers within content.
|
|
1981
|
+
hasInnerContainers: true,
|
|
1982
|
+
ignoreSelector: '.hint-title, .js-toc-ignore',
|
|
1983
|
+
orderedList: false,
|
|
1984
|
+
ignoreHiddenElements: true,
|
|
1985
|
+
headingsOffset: 96,
|
|
1986
|
+
scrollSmoothOffset: -96
|
|
1987
|
+
}); }
|
|
1988
|
+
|
|
1989
|
+
</script>
|
|
1990
|
+
|
|
1991
|
+
|
|
1992
|
+
|
|
1993
|
+
<script src="https://cdn.jsdelivr.net/npm/@docsearch/js@4"></script>
|
|
1994
|
+
<script type="text/javascript">
|
|
1995
|
+
docsearch({
|
|
1996
|
+
appId: "93SYI9HL20",
|
|
1997
|
+
apiKey: "105a5cad34a7ac8f6a9fb78189d9c113",
|
|
1998
|
+
indexName: "amplitude-vercel",
|
|
1999
|
+
container: '#algolia-search-header',
|
|
2000
|
+
debug: true,
|
|
2001
|
+
placeholder: "Search 'instrumentation' , 'Export API'",
|
|
2002
|
+
transformItems(items) {
|
|
2003
|
+
return items.map((item) => ({
|
|
2004
|
+
...item,
|
|
2005
|
+
url: item.url.replace('https://amplitude.com','')
|
|
2006
|
+
}))
|
|
2007
|
+
}
|
|
2008
|
+
});
|
|
2009
|
+
|
|
2010
|
+
// Amplitude tracking for DocSearch
|
|
2011
|
+
(function() {
|
|
2012
|
+
var lastQuery = '';
|
|
2013
|
+
var searchOpen = false;
|
|
2014
|
+
|
|
2015
|
+
document.addEventListener('click', function(e) {
|
|
2016
|
+
if (e.target.closest('.DocSearch-Button')) {
|
|
2017
|
+
amplitude.track('Search opened');
|
|
2018
|
+
searchOpen = true;
|
|
2019
|
+
}
|
|
2020
|
+
});
|
|
2021
|
+
|
|
2022
|
+
document.addEventListener('input', function(e) {
|
|
2023
|
+
var input = document.querySelector('.DocSearch-Input');
|
|
2024
|
+
if (input && e.target === input) {
|
|
2025
|
+
lastQuery = input.value;
|
|
2026
|
+
}
|
|
2027
|
+
});
|
|
2028
|
+
|
|
2029
|
+
// Use capture phase to run before DocSearch closes the modal
|
|
2030
|
+
document.addEventListener('click', function(e) {
|
|
2031
|
+
var hit = e.target.closest('.DocSearch-Hit');
|
|
2032
|
+
if (hit) {
|
|
2033
|
+
var query = lastQuery; // Capture query before any DOM changes
|
|
2034
|
+
var link = hit.querySelector('a');
|
|
2035
|
+
var url = link ? link.getAttribute('href') : '';
|
|
2036
|
+
var hits = document.querySelectorAll('.DocSearch-Hit');
|
|
2037
|
+
var position = Array.prototype.indexOf.call(hits, hit) + 1;
|
|
2038
|
+
amplitude.track('Search result clicked', { query: query, url: url, position: position });
|
|
2039
|
+
}
|
|
2040
|
+
}, true);
|
|
2041
|
+
|
|
2042
|
+
var observer = new MutationObserver(function(mutations) {
|
|
2043
|
+
var modal = document.querySelector('.DocSearch-Modal');
|
|
2044
|
+
if (searchOpen && !modal) {
|
|
2045
|
+
if (lastQuery) {
|
|
2046
|
+
amplitude.track('Search query', { query: lastQuery });
|
|
2047
|
+
}
|
|
2048
|
+
lastQuery = '';
|
|
2049
|
+
searchOpen = false;
|
|
2050
|
+
} else if (modal && !searchOpen) {
|
|
2051
|
+
// Track search opened for keyboard shortcuts (Cmd+K/Ctrl+K)
|
|
2052
|
+
amplitude.track('Search opened');
|
|
2053
|
+
searchOpen = true;
|
|
2054
|
+
}
|
|
2055
|
+
});
|
|
2056
|
+
|
|
2057
|
+
observer.observe(document.body, { childList: true, subtree: true });
|
|
2058
|
+
})();
|
|
2059
|
+
</script>
|
|
2060
|
+
<script src="/docs/js/site.js?id=078a82617f7dafffff92da951b4ec6c9"></script>
|
|
2061
|
+
<script src="/docs/js/statuspage.js?id=4da5c29a14b085ee38c353c2a7b7713c"></script>
|
|
2062
|
+
|
|
2063
|
+
<!-- Latest Version -->
|
|
2064
|
+
<script src="https://cc.cdn.civiccomputing.com/9/cookieControl-9.x.min.js" type="text/javascript"></script>
|
|
2065
|
+
<script>
|
|
2066
|
+
var config = {
|
|
2067
|
+
apiKey: "106b5e962520ab454786a0d1ba709e47372ef512",
|
|
2068
|
+
product: "PRO_MULTISITE",
|
|
2069
|
+
initialState: 'notify',
|
|
2070
|
+
notifyDismissButton: false,
|
|
2071
|
+
theme: 'light',
|
|
2072
|
+
setInnerHTML: true,
|
|
2073
|
+
branding: {
|
|
2074
|
+
fontFamily: 'IBM Plex Sans, sans-serif',
|
|
2075
|
+
backgroundColor: '#fafcfe',
|
|
2076
|
+
removeIcon: true,
|
|
2077
|
+
removeAbout: true,
|
|
2078
|
+
},
|
|
2079
|
+
statement: {
|
|
2080
|
+
description: 'See our',
|
|
2081
|
+
name: 'Privacy Notice',
|
|
2082
|
+
url: 'https://amplitude.com/privacy#cookies',
|
|
2083
|
+
updated: '25/04/2018',
|
|
2084
|
+
},
|
|
2085
|
+
|
|
2086
|
+
ccpaConfig: {
|
|
2087
|
+
description: 'See our',
|
|
2088
|
+
name: 'Personal Information Notice',
|
|
2089
|
+
url: 'https://amplitude.com/privacy',
|
|
2090
|
+
updated: '25/04/2018',
|
|
2091
|
+
},
|
|
2092
|
+
|
|
2093
|
+
ccpaConfig: {
|
|
2094
|
+
description: 'See our',
|
|
2095
|
+
name: 'Personal Information Notice',
|
|
2096
|
+
url: 'https://amplitude.com/privacy',
|
|
2097
|
+
updated: '25/04/2018',
|
|
2098
|
+
},
|
|
2099
|
+
text: {
|
|
2100
|
+
title: 'This site uses cookies.',
|
|
2101
|
+
intro: 'Some of these cookies are essential, while others help us to improve your experience by providing insights into how the site is being used.',
|
|
2102
|
+
necessaryTitle: 'Necessary Cookies',
|
|
2103
|
+
necessaryDescription: 'Necessary cookies enable core functionality. The website cannot function properly without these cookies, and can only be disabled by changing your browser preferences.',
|
|
2104
|
+
accept: 'Accept',
|
|
2105
|
+
reject: 'Reject',
|
|
2106
|
+
rejectSettings: "Do Not Sell or Share My Personal Information",
|
|
2107
|
+
|
|
2108
|
+
// Regarding opening settings, "openCookieControl" should have been exposed
|
|
2109
|
+
// to the window by instrumentCookieControl() by, in the event it hasn't,
|
|
2110
|
+
// this falls back to CookieControl.open
|
|
2111
|
+
notifyDescription: `
|
|
2112
|
+
<div class="ccc-description">
|
|
2113
|
+
<div class="ccc-inner-description">
|
|
2114
|
+
<h2>Cookie Preferences</h2>
|
|
2115
|
+
<p>
|
|
2116
|
+
Sharing your cookies helps us improve site functionality and optimize your experience.
|
|
2117
|
+
<br><a href="https://amplitude.com/privacy#cookies" data-cta-clicked-type="interstitial" data-cc-policy>Click Here</a> to read our cookie policy.
|
|
2118
|
+
</p>
|
|
2119
|
+
</div>
|
|
2120
|
+
<div class="ccc-actions">
|
|
2121
|
+
<a class="ccc-manage-settings-btn" onclick="(window.openCookieControl || CookieControl.open)()"
|
|
2122
|
+
data-cta-clicked-type="interstitial"
|
|
2123
|
+
data-cc-settings>Manage Settings</a>
|
|
2124
|
+
<button onclick="CookieControl.acceptAll()" data-cc-accept data-cta-clicked-type="interstitial">
|
|
2125
|
+
Accept
|
|
2126
|
+
</button>
|
|
2127
|
+
</div>
|
|
2128
|
+
</div>`,
|
|
2129
|
+
},
|
|
2130
|
+
necessaryCookies: [
|
|
2131
|
+
'__utmzz', // utmz cookie replicator necessary to track utm google values
|
|
2132
|
+
'__utmzzses', // Also used by utmz cookie replciator
|
|
2133
|
+
'corp_utm', // Own cookie used to persist utm values for Marketo
|
|
2134
|
+
'membership_token_*', // Membership cookies for all access program
|
|
2135
|
+
'sj_csrftoken', // Skill Jar Cookie
|
|
2136
|
+
],
|
|
2137
|
+
optionalCookies: [{
|
|
2138
|
+
name: "performance",
|
|
2139
|
+
label: "Performance Cookies",
|
|
2140
|
+
description: 'We use these cookies to monitor and improve website performance.',
|
|
2141
|
+
cookies: [
|
|
2142
|
+
'amplitude_id*', // Amplitude SDK
|
|
2143
|
+
'amp_*', // Newer Amplitude SDK
|
|
2144
|
+
'AMP_*', // Newer Amplitude SDK
|
|
2145
|
+
'1P_JAR', // Google Analytics
|
|
2146
|
+
'DV', // Google Analytics
|
|
2147
|
+
'NID', // Google Analytics
|
|
2148
|
+
'OGPC', // Google Analytics
|
|
2149
|
+
'_ga', // Google Analytics
|
|
2150
|
+
'_gid', // Google Analytics
|
|
2151
|
+
'_gat*', // Google Analytics
|
|
2152
|
+
],
|
|
2153
|
+
onRevoke: function () {
|
|
2154
|
+
amplitude.setOptOut(true)
|
|
2155
|
+
}
|
|
2156
|
+
},
|
|
2157
|
+
{
|
|
2158
|
+
name: "advertising",
|
|
2159
|
+
label: "Advertising Cookies",
|
|
2160
|
+
description: 'We use these cookies to help us improve the relevancy of advertising campaigns you receive.',
|
|
2161
|
+
cookies: [
|
|
2162
|
+
'BizoID', // LinkedIn
|
|
2163
|
+
'UserMatchHistory', // LinkedIn
|
|
2164
|
+
'lang', // LinkedIn
|
|
2165
|
+
'bcookie', // LinkedIn
|
|
2166
|
+
'bscookie', // LinkedIn
|
|
2167
|
+
'lidc', // LinkedIn
|
|
2168
|
+
'fr', // Facebook
|
|
2169
|
+
'vc', // AddThis
|
|
2170
|
+
'uvc', // AddThis
|
|
2171
|
+
'uid', // AddThis
|
|
2172
|
+
'loc', // AddThis
|
|
2173
|
+
'ouid', // AddThis
|
|
2174
|
+
'di2', // AddThis
|
|
2175
|
+
'__atuvc', // AddThis
|
|
2176
|
+
'__atuvs', // AddThis
|
|
2177
|
+
'__d_mkto', // Marketo
|
|
2178
|
+
'_mkto_trk', // Marketo
|
|
2179
|
+
'BIGipServerab13web-app_https', // Marketo
|
|
2180
|
+
'IDE', // Doubleclick,
|
|
2181
|
+
'csv', // Reddit
|
|
2182
|
+
'edgebucket', // Reddit
|
|
2183
|
+
'loid', // Reddit
|
|
2184
|
+
'over18', // Reddit
|
|
2185
|
+
'recent_srs', // Reddit
|
|
2186
|
+
'session_tracker', // Reddit
|
|
2187
|
+
'token_v2', // Reddit
|
|
2188
|
+
'IDE', // Doubleclick
|
|
2189
|
+
'_uetsid', // Bing
|
|
2190
|
+
'_uetvid', // Bing
|
|
2191
|
+
'_uetsid_exp', // Bing
|
|
2192
|
+
'_uetvid_exp', // Bing
|
|
2193
|
+
'_uetmsclkid', // Bing
|
|
2194
|
+
'_clsk', // Bing
|
|
2195
|
+
'sa-user-id', // Stackadapt
|
|
2196
|
+
'sa-user-id-v2', // Stackadapt
|
|
2197
|
+
],
|
|
2198
|
+
onAccept: function () {
|
|
2199
|
+
|
|
2200
|
+
},
|
|
2201
|
+
onRevoke: function () {
|
|
2202
|
+
|
|
2203
|
+
},
|
|
2204
|
+
}
|
|
2205
|
+
]
|
|
2206
|
+
}
|
|
2207
|
+
|
|
2208
|
+
CookieControl.load(config);
|
|
2209
|
+
</script>
|
|
2210
|
+
|
|
2211
|
+
</body>
|
|
2212
|
+
</html>
|