Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion content/collections/browser_sdk/en/browser-sdk-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Install the [Browser Unified SDK](/docs/sdks/analytics/browser/browser-unified-s
{{partial:tabs tabs="Script loader, npm, yarn"}}
{{partial:tab name="Script loader"}}
When you use the script loader and enable Autocapture, Browser SDK track interactions on your site automatically. For more information, see [Autocapture](#autocapture).
{{partial:partials/code/snippet autocapture="true" unified="false"}}
{{partial:partials/code/snippet autocapture="true" unified="true"}}
{{/partial:tab}}
{{partial:tab name="npm"}}
```bash
Expand Down
53 changes: 20 additions & 33 deletions content/collections/pages/en/components.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,47 +5,34 @@
package: "@amplitude/session-replay-browser"
---

{{partial:admonition type="warning" heading="test"}}
Here's some **formatted** *text*. And `this`.
## Unified with Autocapture, and Session Replay

Check warning on line 8 in content/collections/pages/en/components.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Microsoft.Headings] 'Unified with Autocapture, and Session Replay' should use sentence-style capitalization. Raw Output: {"message": "[Microsoft.Headings] 'Unified with Autocapture, and Session Replay' should use sentence-style capitalization.", "location": {"path": "content/collections/pages/en/components.md", "range": {"start": {"line": 8, "column": 4}}}, "severity": "INFO"}

```js
import { pageUrlEnrichmentPlugin } from '@amplitude/plugin-page-url-enrichment-browser';
{{partial:partials/code/snippet autocapture="true" unified="true" session_replay="true"}}

const pageUrlEnrichment = pageUrlEnrichmentPlugin();
amplitude.add(pageUrlEnrichment);
amplitude.init(API_KEY);
```
{{/partial:admonition}}
## Unified with autocapture

{{partial:partials/code/snippet autocapture="true" unified="true"}}

## test
## Unified with session replay

```swift
// Basic boot with user ID
amplitudeEngagement.boot("USER_ID")
{{partial:partials/code/snippet autocapture="false" unified="true" session_replay="true"}}

// Advanced boot with options
## Unified only

let bootOptions = AmplitudeBootOptions(
user_id: "USER_ID",
device_id: "DEVICE_ID",
user_properties: ["key": "value"]
)
amplitudeEngagement.boot(options: bootOptions)
```
{{partial:partials/code/snippet autocapture="false" unified="true"}}

More content **here**
## Legacy with Autocapture, and Session Replay

Check warning on line 24 in content/collections/pages/en/components.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Microsoft.Headings] 'Legacy with Autocapture, and Session Replay' should use sentence-style capitalization. Raw Output: {"message": "[Microsoft.Headings] 'Legacy with Autocapture, and Session Replay' should use sentence-style capitalization.", "location": {"path": "content/collections/pages/en/components.md", "range": {"start": {"line": 24, "column": 4}}}, "severity": "INFO"}

```swift
// Basic boot with user ID
amplitudeEngagement.boot("USER_ID")
{{partial:partials/code/snippet autocapture="true" unified="false" session_replay="true"}}

// Advanced boot with options
## Legacy with autocapture

let bootOptions = AmplitudeBootOptions(
user_id: "USER_ID",
device_id: "DEVICE_ID",
user_properties: ["key": "value"]
)
amplitudeEngagement.boot(options: bootOptions)
```
{{partial:partials/code/snippet autocapture="true" unified="false"}}

## Legacy with session replay

{{partial:partials/code/snippet autocapture="false" unified="false" session_replay="true"}}

## Legacy only

{{partial:partials/code/snippet autocapture="false" unified="false"}}
29 changes: 16 additions & 13 deletions content/collections/session-replay/en/session-replay-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,15 @@
platform: browser
parent: 467a0fe0-6ad9-4375-96a2-eea5b04a7bcf
package_name: '@amplitude/plugin-session-replay-browser'
full_details: false
full_details: true
public: true
description: 'Use the Session Replay plugin if you instrument your site with Amplitude Browser SDK 2.'
---
{{partial:admonition type="note" heading="Session Replay instrumentation"}}
Session Replay isn't enabled by default, and requires setup beyond the standard Amplitude instrumentation.
{{/partial:admonition}}

This article covers the installation of Session Replay using the Browser SDK plugin. If your site is already instrumented with Amplitude, use this option. If you use a provider other than Amplitude for in-product analytics, choose the [standalone implementation](/docs/session-replay/session-replay-standalone-sdk). For more information about the Browser SDK, see
[Browser SDK 2](/docs/sdks/analytics/browser/browser-sdk-2).
This article covers the installation of Session Replay using the Browser SDK plugin. If your site is already instrumented with Amplitude, use this option. If you use a provider other than Amplitude for in-product analytics, choose the [standalone implementation](/docs/session-replay/session-replay-standalone-sdk). For more information about the Browser SDK, see [Browser SDK 2](/docs/sdks/analytics/browser/browser-sdk-2).

Check warning on line 22 in content/collections/session-replay/en/session-replay-plugin.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Amplitude.WordChoice] Use 'go to', 'navigate to', or 'review' instead of 'see'. Raw Output: {"message": "[Amplitude.WordChoice] Use 'go to', 'navigate to', or 'review' instead of 'see'.", "location": {"path": "content/collections/session-replay/en/session-replay-plugin.md", "range": {"start": {"line": 22, "column": 361}}}, "severity": "WARNING"}

{{partial:admonition type="info" heading="Session Replay and performance"}}
Amplitude built Session Replay to minimize impact on the performance of web pages on which it's installed by:
Expand Down Expand Up @@ -109,17 +108,21 @@
{{/partial:tab}}
{{/partial:tabs}}

You can also add the code directly to the `<head>` of your site. With this method, be sure that the Browser SDK isn't initialized elsewhere in your application. If you initialize the Browser SDK more than once, you may see mismatches in Device ID or Session ID.
You can also add the code directly to the `<head>` of your site. The implementation depends on the way you instrument your site. If you call `analytics-browser-#.##.##.js.gz` directly, use the Legacy script. If you call `AMPLITUDE_API_KEY.js`, use the Unified script

Be sure that the Browser SDK isn't initialized elsewhere in your application. If you initialize the Browser SDK more than once, you may have mismatches in Device ID or Session ID.

Check warning on line 113 in content/collections/session-replay/en/session-replay-plugin.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Amplitude.WordChoice] Use 'after' instead of 'once'. Raw Output: {"message": "[Amplitude.WordChoice] Use 'after' instead of 'once'.", "location": {"path": "content/collections/session-replay/en/session-replay-plugin.md", "range": {"start": {"line": 113, "column": 123}}}, "severity": "WARNING"}

{{partial:tabs tabs="Legacy script, Unified script"}}
{{partial:tab name="Legacy script"}}
{{partial:partials/code/snippet autocapture="false" unified="false" session_replay="true"}}

{{/partial:tab}}
{{partial:tab name="Unified script"}}
{{partial:partials/code/snippet autocapture="false" unified="true" session_replay="true"}}

{{/partial:tab}}
{{/partial:tabs}}

```html
<script src="https://cdn.amplitude.com/libs/analytics-browser-2.9.0-min.js.gz"></script>
<script src="https://cdn.amplitude.com/libs/plugin-session-replay-browser-1.19.3-min.js.gz"></script>
<script>
const sessionReplayTracking = window.sessionReplay.plugin();
window.amplitude.add(sessionReplayTracking);
window.amplitude.init(API_KEY)
</script>
```

{{partial:admonition type="info" heading=""}}
Session Replay instrumentation happens in the context of an Amplitude Project. Your replay quota is defined on the Organization level. As a result, you may have multiple Session Replay implementations, across multiple projects each with their own sample rate, that pull from the same quota.
Expand Down
4 changes: 2 additions & 2 deletions content/globals/en/sdk_versions.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
browser: 2.11.12
browser: 2.22.0
android: 1.19.4
node: 1.3.6
ios: 1.11.9
Expand All @@ -10,7 +10,7 @@ unity: '2.8'
unreal: 0.1.0
go: 1.0.2
visual_labeling_plugin: 1.0.0
session_replay_plugin: 1.13.10
session_replay_plugin: 1.22.0
session_replay_standalone: 1.20.1
session_replay_android_plugin: 0.18.0
session_replay_android_standalone: 0.18.0
Expand Down
18 changes: 11 additions & 7 deletions resources/views/partials/code/_snippet.antlers.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,13 @@
{{markdown}}

```html
<script src="https://cdn.amplitude.com/libs/analytics-browser-{{sdk_versions.browser}}-min.js.gz"></script>
<script src="https://cdn.amplitude.com/libs/plugin-session-replay-browser-{{sdk_versions.session_replay_plugin}}-min.js.gz"></script>
<script src="https://cdn.amplitude.com/script/AMPLITUDE_API_KEY.js"></script>
<script>
window.amplitude.add(window.sessionReplay.plugin({ sampleRate: 1 })).promise.then(function () {
window.amplitude.init("AMPLITUDE_API_KEY");
});
window.amplitude.add(window.sessionReplay.plugin({sampleRate: 1}));
window.amplitude.init('AMPLITUDE_API_KEY', {
fetchRemoteConfig: true,
autocapture: false
});
</script>
```
{{/markdown}}
Expand All @@ -80,9 +81,12 @@

{{markdown}}
```html
<script src="https://cdn.amplitude.com/libs/analytics-browser-{{sdk_versions.browser}}-min.js.gz"></script>
<script src="https://cdn.amplitude.com/script/AMPLITUDE_API_KEY.js"></script>
<script>
window.amplitude.init("AMPLITUDE_API_KEY");
window.amplitude.init('AMPLITUDE_API_KEY', {
fetchRemoteConfig: true,
autocapture: false
});
</script>
```
{{/markdown}}
Expand Down
Loading