Site builder integration
Session Replay for Wix Sites
Add AnyReplay session replay to a Wix site with custom code in the site settings, choose which pages load it, keep personal data out and check it records.
Updated · 4 min read
To add Wix session replay with AnyReplay, add the script tag as custom code in your site's settings, set it to load in the head on all pages, and publish. AnyReplay then records visits to your live Wix site, and one option masks every form input when you want them hidden.
Why record sessions on your Wix site
Wix gives you traffic numbers, but not the reason a booking form was left half-filled or a button went unnoticed on mobile. Wix session recording lets you watch those visits: where people hesitated, what they clicked that did nothing, and the step at which they gave up. Form abandonment covers what to look for in forms specifically.
How to add session replay to Wix
<script>
(function (w, d) {
w.anyreplay = w.anyreplay || function () {
(w.anyreplay.q = w.anyreplay.q || []).push(arguments);
};
var s = d.createElement('script');
s.async = 1;
s.src = 'https://cdn.anyreplay.com/v1/ar.min.js?k=YOUR_PROJECT_KEY';
d.head.appendChild(s);
})(window, document);
anyreplay('init', {
projectKey: 'YOUR_PROJECT_KEY',
ingestUrl: 'https://in.anyreplay.com',
// Stop recording after this many sessions in a calendar month.
// maxSessionsPerMonth: 10000,
// Form fields are masked: what visitors type replays as asterisks.
// Passwords, one-time codes and card fields are masked either way.
// Uncomment the first line to record what visitors type, or the
// second to hide rich-text editors too.
// maskAllInputs: false,
// maskAllTyping: true
});
</script>Open custom code
In your site's dashboard, open Settings and find Custom code, in the advanced or development and integrations area.
Add the snippet
Choose Add custom code, paste the snippet with YOUR_PROJECT_KEY replaced by your key, and give it a name such as AnyReplay.
Choose where it loads
Select All pages, choose to load the code once rather than on each new page, and place it in the Head. Apply the change.
Visit the live site
Open the published site and browse a few pages. The setup page in AnyReplay switches to Connected once events arrive.
Wix only allows custom code on sites that meet its requirements, which include a connected domain and a paid plan; Wix's help centre lists the current requirements and menu names. Loading the code once is enough because AnyReplay follows page changes within the visit on its own. The script tag guide explains the snippet in detail.
Which pages are recorded (and which are not)
With All pages selected, every page of the published site that runs your custom code is recorded, and page changes appear as route markers within the session. The Wix editor and your site dashboard are not recorded. Member areas, bookings and store checkout pages may be handled differently by Wix, so open a test session and confirm which pages appear before relying on them.
How do I keep customer data out of recordings?
By default every value typed into contact, booking and login forms replays as asterisks of the same length. If you want to read those forms back, add maskAllInputs: false to the init options. Passwords and one-time codes, payment card fields and anything shaped like a card number are masked whatever you set. Email and telephone fields are ordinary fields, recorded only once you opt out. Text shown on the page is recorded as it appears. AnyReplay masks an element's text when it has the ar-mask class and removes it with ar-block, but the standard Wix Editor does not let you add CSS classes to elements; Wix Studio or Velo may. If you cannot add a class, avoid showing personal data on recorded pages, or switch from All pages to Choose specific pages and leave those pages out. See masking.
Consent banners on Wix
Add requireConsent: true to the init options and nothing is recorded or sent until anyreplay('consent', true) runs. AnyReplay does not store the choice, so call it on every page load for visitors who already agreed. Whether you can connect that call to your cookie banner depends on the banner; check Wix's documentation for consent options, or manage both through Google Tag Manager and fire the consent call from its consent trigger. See consent.
Allowed domains
If your project lists allowed domains, AnyReplay checks each request's Origin header against them. Add your connected domain, and any other domain the site is served from, or sessions from it are refused.
How do I check it is working?
- The project's setup page switches to Connected after the first accepted event.
- In the browser's network panel on the live site, requests to
in.anyreplay.comshould be answered with202. - Add
debug: trueto theinitoptions to log in the console why the recorder is not recording. - Still nothing? See no sessions and Content Security Policy.
Frequently asked questions
Can I add AnyReplay to a free Wix site?
Wix restricts custom code to sites that meet its requirements, such as a connected domain and a paid plan. Check Wix's help centre for what applies to your site.
Should the code load once or on each new page?
Load it once. AnyReplay follows page changes within a visit by itself, so loading it again on every page is not needed.
Can I exclude some pages from recording?
Yes. When you add the custom code, choose specific pages instead of all pages and leave out the ones you do not want recorded.
Does AnyReplay record the Wix editor?
No. Custom code runs on your published site, so only real visits to the live site are recorded.