Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add engagement.init to third-part Analytics provider installation #549

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

tkainrad
Copy link

@tkainrad tkainrad commented Mar 7, 2025

Context: https://amplitude.slack.com/archives/C08BLQDFT98/p1739877518424259

If you use Amplitude Analytics, we will call init automatically on plugin initialization. If you boot Guides and Surveys manually, you also need to call init manually. Before calling init, the boot method will not even be available on the global.

@tkainrad tkainrad requested a review from markzegarelli as a code owner March 7, 2025 12:33
Copy link

vercel bot commented Mar 7, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
amplitude-docs ✅ Ready (Inspect) Visit Preview Mar 7, 2025 0:44am

@@ -51,6 +51,24 @@ amplitude.add(engagementPlugin());

Using the Guides and Surveys standalone SDK with another analytics provider requires extra configuration to help map properties to Amplitude. This initialization code accepts parameters that define the user and any integrations.

First, call `init` to initialize the SDK. After calling this function, it will be possible to acccess `window.engagement` and call the SDK functions:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
First, call `init` to initialize the SDK. After calling this function, it will be possible to acccess `window.engagement` and call the SDK functions:
First, call `init` to initialize the SDK. After calling this function, you can access `window.engagement` and call the SDK functions:

@@ -51,6 +51,24 @@ amplitude.add(engagementPlugin());

Using the Guides and Surveys standalone SDK with another analytics provider requires extra configuration to help map properties to Amplitude. This initialization code accepts parameters that define the user and any integrations.

First, call `init` to initialize the SDK. After calling this function, it will be possible to acccess `window.engagement` and call the SDK functions:

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

| ------------------------ | ---------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `apiKey` | `string` | Required. API key of the Amplitude project you want to use. |
| `initOptions.serverZone` | `EU` or `US` | Optional. Sets the Amplitude server zone. Set this to EU for Amplitude projects created in EU data center. Default: `US` |
| `initOptions.logger` | [Logger interface](https://github.com/amplitude/Amplitude-TypeScript/blob/main/packages/analytics-types/src/logger.ts#L1-L8) | Optional. Sets a custom loggign provider class. Default: [Amplitude Logger](https://github.com/amplitude/Amplitude-TypeScript/blob/main/packages/analytics-core/src/logger.ts) |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `initOptions.logger` | [Logger interface](https://github.com/amplitude/Amplitude-TypeScript/blob/main/packages/analytics-types/src/logger.ts#L1-L8) | Optional. Sets a custom loggign provider class. Default: [Amplitude Logger](https://github.com/amplitude/Amplitude-TypeScript/blob/main/packages/analytics-core/src/logger.ts) |
| `initOptions.logger` | [Logger interface](https://github.com/amplitude/Amplitude-TypeScript/blob/main/packages/analytics-types/src/logger.ts#L1-L8) | Optional. Sets a custom logging provider class. Default: [Amplitude Logger](https://github.com/amplitude/Amplitude-TypeScript/blob/main/packages/analytics-core/src/logger.ts) |

| `initOptions.logLevel` | `LogLevel.None` or `LogLevel.Error` or `LogLevel.Warn` or `LogLevel.Verbose` or `LogLevel.Debug`. | Optional. Sets the log level. Default: `LogLevel.Warn` |


However, Guides and Surveys will not be fully functional until you call `boot`:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
However, Guides and Surveys will not be fully functional until you call `boot`:
However, Guides and Surveys isn't fully functional until you call `boot`:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants