# Implement Session Replay with Google Tag Manager

Choose this option if you use Google Tag Manager to instrument Amplitude on your site.

Source: https://amplitude.com/docs/sdks/session-replay/session-replay-google-tag-manager

---

On this page

- [Enable Session Replay](#enable-session-replay)
- [Troubleshooting](#troubleshooting)

# Implement Session Replay with Google Tag Manager

Instrumenting Amplitude Session Replay with Google Tag Manager requires a different procedure than with the standard [Browser SDK Plugin](/docs/sdks/session-replay/session-replay-plugin).

This article pertains to **client-side** GTM instrumentations **only**.

## Enable Session Replay

To instrument Session Replay with Google Tag Manager:

1. Add the [Google Tag Manager Web Template for Amplitude Analytics Browser SDK](/docs/data/source-catalog/google-tag-manager) if it's not yet enabled.

Update the Amplitude tag template

A Session Replay toggle is available in the latest version of the Amplitude Analytics Browser SDK template.

2. In Google Tag Manager, create a new tag using the Amplitude template, or edit an existing tag you created based on the template.
3. In the tag's *Initialization* section, select **Enable Session Replay Plugin**.
4. In Amplitude, navigate to *Organization Settings > Session Replay Settings*. Update any [masking](/docs/sdks/session-replay/session-replay-plugin#mask-on-screen-data), [sample rate](/docs/sdks/session-replay/session-replay-plugin#sampling-rate), or other settings.

## Troubleshooting

Multiple instantiation of the Amplitude SDKs. This is a common problem seen with GTM and other code injection frameworks. Ensure that the initialization logic is only run once on your app. This could happen if:

- There is more than 1 "Init Tag" or another custom tag that’s running Amplitude.
- You have another Code Injection Framework (for example, SquareSpace or Bubble) that also runs Amplitude.

This template uses the Amplitude Browser SDK Plugin. For help troubleshooting, see [Troubleshooting | Session Replay Plugin](/docs/sdks/session-replay/session-replay-plugin#troubleshooting)

Was this helpful?

<!--$-->

<!--/$-->
