Install — Web
Install With the Google Tag Manager Template
Install AnyReplay from the Google Tag Manager template gallery: the fields it asks for, Consent Mode, the permissions it needs, and how to test it in Preview.
The template is the AnyReplay script tag as a Google Tag Manager tag type. Instead of pasting code into a Custom HTML tag you fill in a few fields, and Tag Manager checks what the template is allowed to do: load the recorder from cdn.anyreplay.com, set up window.anyreplay, and read your consent state.
Add the tag
Add the template
In your container open Templates → Tag Templates → Search Gallery, search for AnyReplay and choose Add to workspace.
Create the tag
Open Tags → New → Tag Configuration and pick AnyReplay Session Replay. Paste your project key from the project's setup page in AnyReplay.
Trigger it on every page
Choose the Initialization - All Pages trigger, or All Pages, so every page load starts or resumes the session.
Preview, then publish
Use Preview to open your site, check that the tag fired, and watch the setup page in AnyReplay switch to Connected. Then submit and publish the container.
What to enter
| Field | Value |
|---|---|
| Project key | YOUR_PROJECT_KEY |
| Advanced → Ingest URL | https://in.anyreplay.com |
| Mask everything typed into form fields | On (the default) |
Under Advanced you can also set a sample rate between 0 and 1, a monthly session cap, and debug logging. Each field maps to the option of the same name in the browser SDK reference; see sampling and session caps. Passwords, one-time codes and payment card fields are masked whatever you choose — read masking before you turn the form-field option off on a site with a checkout.
Consent Mode
Tick Record only after the visitor grants consent and the template starts the recorder with requireConsent: true: nothing is recorded or stored on the device until the consent type you choose — analytics_storage by default — is granted. If it is already granted when the tag fires, recording starts at once; if the visitor grants it later on the page, it starts then; if they deny it after granting it, recording stops and AnyReplay's stored ids are removed. Your consent platform has to set Consent Mode for this to work. See consent.
Permissions the template asks for
- Injects scripts from
https://cdn.anyreplay.com/v1/— the recorder. - Reads, writes and calls
window.anyreplay, and reads and writeswindow.anyreplay.q— the same queue the script tag sets up. - Reads consent state for
analytics_storage,functionality_storageandpersonalization_storage. - Logs to the console in debug mode only.
A self-hosted install that serves the recorder from its own host should use the Custom HTML tag instead, because the gallery template only loads from cdn.anyreplay.com. The ingest URL field works with any host.
Check that it works
- In Tag Assistant the AnyReplay tag shows as Fired; a tag that shows Failed usually means the project key is wrong.
- In the network panel
ar.min.jsloads fromcdn.anyreplay.com, and requests toin.anyreplay.comare answered with202. - If nothing arrives, see no sessions and Content Security Policy.