From a55111fc58756b19918872e41dc9f57147ccebbf Mon Sep 17 00:00:00 2001 From: "promptless[bot]" <179508745+promptless[bot]@users.noreply.github.com> Date: Fri, 3 Oct 2025 19:50:38 +0000 Subject: [PATCH 1/5] Documentation updates from Promptless --- .../browser_sdk/en/browser-unified-sdk.md | 26 ++++++++++++++++--- .../collections/guides_and_surveys/en/sdk.md | 14 ++++++++++ 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/content/collections/browser_sdk/en/browser-unified-sdk.md b/content/collections/browser_sdk/en/browser-unified-sdk.md index fadbfea99..9737ba181 100644 --- a/content/collections/browser_sdk/en/browser-unified-sdk.md +++ b/content/collections/browser_sdk/en/browser-unified-sdk.md @@ -18,20 +18,19 @@ package_name: '@amplitude/unified' platform: Browser full_details: true --- -The Unified SDK provides a single entry point for all Amplitude features, including Analytics, Experiment, and Session Replay. It simplifies the integration process by handling the initialization and configuration of all components. +The Unified SDK provides a single entry point for all Amplitude features, including Analytics, Experiment, Session Replay, and Guides and Surveys. It simplifies the integration process by handling the initialization and configuration of all components. {{partial:admonition type="beta" heading="Beta Release"}} The Browser Unified SDK is currently in beta. There may be breaking changes before the stable release. Amplitude recommends testing thoroughly in a development environment before you deploy to production. {{/partial:admonition}} {{partial:admonition type="info" heading="Individual Product Installation"}} -The Unified SDK installs Analytics, Experiment, and Session Replay. If you're concerned about bundle size and only need specific products, you can install them individually: +The Unified SDK installs Analytics, Experiment, Session Replay, and Guides and Surveys. If you're concerned about bundle size and only need specific products, you can install them individually: - [Analytics](/docs/sdks/analytics/browser/browser-sdk-2) - For tracking user events and behavior - [Experiment](/docs/sdks/experiment-sdks/experiment-javascript) - For running A/B tests and feature flags - [Session Replay](/docs/session-replay/session-replay-standalone-sdk) - For capturing and replaying user sessions - -The Unified SDK doesn't support Guides and Surveys. If you need Guides and Surveys functionality, use the [Guides and Surveys SDK](/docs/guides-and-surveys/sdk) directly. +- [Guides and Surveys](/docs/guides-and-surveys/sdk) - For in-product messaging and surveys {{/partial:admonition}} ## Install the SDK @@ -119,6 +118,11 @@ initAll('YOUR_API_KEY', { // Experiment options experiment: { // Experiment configuration options + }, + + // Guides and Surveys options + engagement: { + // Guides and Surveys configuration options } }); ``` @@ -144,3 +148,17 @@ Sample Rate controls the rate at which Amplitude captures session replays. For e ### Experiment options All options from `@amplitude/plugin-experiment-browser` are supported. See the [Experiment documentation](/docs/sdks/experiment-sdks/experiment-javascript#configuration) for details. + +### Guides and Surveys options + +{{partial:admonition type="note" heading="Dashboard Enablement Required"}} +Enable Guides and Surveys in your Amplitude project settings before guides and surveys can display. + +To enable Guides and Surveys: +1. Navigate to your project settings in Amplitude +2. Enable the Guides and Surveys feature for your target app/environment + +See [Supported apps](/docs/guides-and-surveys/get-started#supported-apps) for more information. +{{/partial:admonition}} + +The Unified Browser SDK supports all [Guides and Surveys options](/docs/guides-and-surveys/sdk#initialize-the-sdk). The engagement plugin initializes automatically when you pass engagement options in the configuration. diff --git a/content/collections/guides_and_surveys/en/sdk.md b/content/collections/guides_and_surveys/en/sdk.md index 887411c8c..435b7c4c0 100644 --- a/content/collections/guides_and_surveys/en/sdk.md +++ b/content/collections/guides_and_surveys/en/sdk.md @@ -50,8 +50,22 @@ amplitude.add(engagementPlugin()); For additional configuration, supply `InitOptions` to the `plugin` function. See [Initialize the SDK](#initialize-the-sdk) below for the available options. +### Amplitude Unified SDK +If you're using the [Amplitude Unified SDK](/docs/sdks/analytics/browser/browser-unified-sdk), Guides and Surveys comes out of the box. Just provide the engagement options during initialization: +```ts +import { initAll } from '@amplitude/unified'; + +initAll('YOUR_API_KEY', { + // Other Amplitude SDK options... + engagement: { + // Guides and Surveys options go here... + } +}); +``` + +Enable Guides and Surveys in your Amplitude project settings before guides and surveys can display. See the [Unified SDK documentation](/docs/sdks/analytics/browser/browser-unified-sdk#guides-and-surveys-options) for details. ### Other Amplitude SDK's and third-party analytics providers From 2d1f2e092321700ae7410540ccb11807d180c2bf Mon Sep 17 00:00:00 2001 From: lchoward Date: Fri, 3 Oct 2025 13:49:08 -0700 Subject: [PATCH 2/5] clarify sdk installation details --- .../browser_sdk/en/browser-unified-sdk.md | 11 +-------- .../collections/guides_and_surveys/en/sdk.md | 24 ++++++++++++++----- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/content/collections/browser_sdk/en/browser-unified-sdk.md b/content/collections/browser_sdk/en/browser-unified-sdk.md index 9737ba181..d1746977d 100644 --- a/content/collections/browser_sdk/en/browser-unified-sdk.md +++ b/content/collections/browser_sdk/en/browser-unified-sdk.md @@ -69,6 +69,7 @@ For detailed information about each product's features and APIs, refer to their - [Analytics Browser SDK](/docs/sdks/analytics/browser/browser-sdk-2) - [Experiment JavaScript SDK](/docs/sdks/experiment-sdks/experiment-javascript) - [Session Replay Standalone SDK](/docs/session-replay/session-replay-standalone-sdk) +- [Guides and Surveys Web SDK](/docs/guides-and-surveys/sdk) {{/partial:admonition}} ```typescript @@ -151,14 +152,4 @@ All options from `@amplitude/plugin-experiment-browser` are supported. See the [ ### Guides and Surveys options -{{partial:admonition type="note" heading="Dashboard Enablement Required"}} -Enable Guides and Surveys in your Amplitude project settings before guides and surveys can display. - -To enable Guides and Surveys: -1. Navigate to your project settings in Amplitude -2. Enable the Guides and Surveys feature for your target app/environment - -See [Supported apps](/docs/guides-and-surveys/get-started#supported-apps) for more information. -{{/partial:admonition}} - The Unified Browser SDK supports all [Guides and Surveys options](/docs/guides-and-surveys/sdk#initialize-the-sdk). The engagement plugin initializes automatically when you pass engagement options in the configuration. diff --git a/content/collections/guides_and_surveys/en/sdk.md b/content/collections/guides_and_surveys/en/sdk.md index 435b7c4c0..6f1f4548d 100644 --- a/content/collections/guides_and_surveys/en/sdk.md +++ b/content/collections/guides_and_surveys/en/sdk.md @@ -13,7 +13,7 @@ Amplitude's Guides and Surveys SDK enables you to deploy [Guides and Surveys](/d Guides and Surveys supports different installation options to work best with your existing Amplitude implementation, if you have one. -### Amplitude Browser SDK +### Amplitude Browser SDK 2 Install the Guides and Surveys SDK with a script, or as a package with npm or Yarn. @@ -47,9 +47,16 @@ amplitude.add(engagementPlugin()); {{/partial:tab}} {{/partial:tabs}} - For additional configuration, supply `InitOptions` to the `plugin` function. See [Initialize the SDK](#initialize-the-sdk) below for the available options. +{{partial:admonition type="note" heading=""}} +If you are using the above install approach, then Guides and Surveys is now installed! By default, all Guides and Surveys events are sent to your project. +{{/partial:admonition}} + +Behind the scenes, `amplitude.add(engagementPlugin())` takes care of both `init` and `boot`. However, this option can only be used with the [Amplitude Analytics Browser SDK 2](/docs/sdks/analytics/browser/browser-sdk-2). + +You should only call `init` and `boot` if you (a) want to use a proxy; (b) want to customize the event handling via the `integrations` option. You can learn more about using a proxy [here](/docs/guides-and-surveys/proxy). You can find details about the `integrations` option [here](/docs/guides-and-surveys/sdk#other-amplitude-sdks-and-third-party-analytics-providers). + ### Amplitude Unified SDK If you're using the [Amplitude Unified SDK](/docs/sdks/analytics/browser/browser-unified-sdk), Guides and Surveys comes out of the box. Just provide the engagement options during initialization: @@ -69,7 +76,7 @@ Enable Guides and Surveys in your Amplitude project settings before guides and s ### Other Amplitude SDK's and third-party analytics providers -If you don't use the Amplitude Analytics [Browser SDK 2](/docs/sdks/analytics/browser/browser-sdk-2), you can still use Guides and Surveys but you need to configure the SDK to work with your other Amplitude Analytics SDK or third-party analytics provider. First, add the SDK to your project using the script tag, or through npm or Yarn as outlined above. +If you don't use the [Amplitude Analytics Browser SDK 2](/docs/sdks/analytics/browser/browser-sdk-2) or the [Amplitude Analytics Unified SDK](/docs/sdks/analytics/browser/browser-unified-sdk), you can still use Guides and Surveys but you need to configure the SDK to work with your other Amplitude Analytics SDK or third-party analytics provider. First, add the SDK to your project using the script tag, or through npm or Yarn as outlined above. But, instead of calling `amplitude.add(window.engagement.plugin())`, you need to call `init` and `boot`. #### Initialize the SDK @@ -113,6 +120,10 @@ engagement.init("YOUR_API_KEY", { }); ``` +{{partial:admonition type="note" heading=""}} +When using a proxy, you need to call `window.engagement.boot` to fully install Guides and Surveys, even if you are using the Browser SDK v2. Make sure to set up event handling via the `integrations` option. +{{/partial:admonition}} + ##### Example: Initialization with CSP nonce For Content Security Policy (CSP) compliance, include a nonce value: @@ -148,11 +159,11 @@ await window.engagement.boot({ device_id: 'DEVICE_ID', user_properties: {}, }, - // needed for insights and responses to populate + // needed for insights and responses to populate integrations: [ { track: (event) => { - analytics.track(event.event_type, event.event_properties) + amplitude.track(event.event_type, event.event_properties) } }, ], @@ -162,7 +173,8 @@ await window.engagement.boot({ To use *On event tracked* [triggers](/docs/guides-and-surveys/guides/setup-and-target#triggers), forward events from your third-party analytics provider to Guides and Surveys. The Guides and Surveys SDK doesn't send these events to the server. ```js -analytics.on('track', (event, properties, options) => { // Example for Segment Analytics +analytics.on('track', (event, properties, options) => { + // Example for Segment Analytics window.engagement.forwardEvent({ event_type: event, event_properties: properties}); }); ``` From b0e2c1c7cf9a65a5298fe291a980df7bad0a89a9 Mon Sep 17 00:00:00 2001 From: JeffScattini-amplitude Date: Mon, 6 Oct 2025 10:05:33 -0700 Subject: [PATCH 3/5] Update sdk.md --- content/collections/guides_and_surveys/en/sdk.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/collections/guides_and_surveys/en/sdk.md b/content/collections/guides_and_surveys/en/sdk.md index 6f1f4548d..38c95d2a6 100644 --- a/content/collections/guides_and_surveys/en/sdk.md +++ b/content/collections/guides_and_surveys/en/sdk.md @@ -47,10 +47,10 @@ amplitude.add(engagementPlugin()); {{/partial:tab}} {{/partial:tabs}} -For additional configuration, supply `InitOptions` to the `plugin` function. See [Initialize the SDK](#initialize-the-sdk) below for the available options. +For additional configuration, supply `InitOptions` to the `plugin` function. Go to [Initialize the SDK](#initialize-the-sdk) below for the available options. {{partial:admonition type="note" heading=""}} -If you are using the above install approach, then Guides and Surveys is now installed! By default, all Guides and Surveys events are sent to your project. +After the installation steps are complete, by default all Guides and Surveys events are sent to your project. {{/partial:admonition}} Behind the scenes, `amplitude.add(engagementPlugin())` takes care of both `init` and `boot`. However, this option can only be used with the [Amplitude Analytics Browser SDK 2](/docs/sdks/analytics/browser/browser-sdk-2). From 35293d64f36a215316f6c7e1cdea71165e3ff640 Mon Sep 17 00:00:00 2001 From: JeffScattini-amplitude Date: Mon, 6 Oct 2025 10:06:32 -0700 Subject: [PATCH 4/5] Update sdk.md --- content/collections/guides_and_surveys/en/sdk.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/collections/guides_and_surveys/en/sdk.md b/content/collections/guides_and_surveys/en/sdk.md index 38c95d2a6..541110ca3 100644 --- a/content/collections/guides_and_surveys/en/sdk.md +++ b/content/collections/guides_and_surveys/en/sdk.md @@ -72,7 +72,7 @@ initAll('YOUR_API_KEY', { }); ``` -Enable Guides and Surveys in your Amplitude project settings before guides and surveys can display. See the [Unified SDK documentation](/docs/sdks/analytics/browser/browser-unified-sdk#guides-and-surveys-options) for details. +Enable Guides and Surveys in your Amplitude project settings before guides and surveys can display. Go to [Unified SDK documentation](/docs/sdks/analytics/browser/browser-unified-sdk#guides-and-surveys-options) for details. ### Other Amplitude SDK's and third-party analytics providers From 19c45d8544920b91bef5e6258dc90b8150786155 Mon Sep 17 00:00:00 2001 From: JeffScattini-amplitude Date: Mon, 6 Oct 2025 10:07:32 -0700 Subject: [PATCH 5/5] Update sdk.md --- content/collections/guides_and_surveys/en/sdk.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/collections/guides_and_surveys/en/sdk.md b/content/collections/guides_and_surveys/en/sdk.md index 541110ca3..32831a88b 100644 --- a/content/collections/guides_and_surveys/en/sdk.md +++ b/content/collections/guides_and_surveys/en/sdk.md @@ -121,7 +121,7 @@ engagement.init("YOUR_API_KEY", { ``` {{partial:admonition type="note" heading=""}} -When using a proxy, you need to call `window.engagement.boot` to fully install Guides and Surveys, even if you are using the Browser SDK v2. Make sure to set up event handling via the `integrations` option. +When using a proxy, call `window.engagement.boot` to fully install Guides and Surveys, even if you are using the Browser SDK v2. Make sure to set up event handling through the `integrations` option. {{/partial:admonition}} ##### Example: Initialization with CSP nonce