Self-hosted session replay for WordPress

There is no Replayowl plugin for WordPress yet. You can add the recorder with a few lines in your theme or with any plugin that inserts scripts into the page head.

You need a running Replayowl server first. See Deploy to Cloudflare Workers. Below, replace replay.example.com with your server’s domain.

Most “insert headers and footers” plugins let you paste code into every page. Paste this into the header section:

<script src="https://replay.example.com/recorder.js"
  data-endpoint="https://replay.example.com/api/ingest" defer></script>

In a child theme

Add this to your child theme’s functions.php:

add_action('wp_enqueue_scripts', function () {
    if (is_user_logged_in() && current_user_can('manage_options')) {
        return; // do not record administrators
    }
    wp_enqueue_script('replayowl', 'https://replay.example.com/recorder.js', [], null, ['strategy' => 'defer']);
});

add_filter('script_loader_tag', function ($tag, $handle) {
    if ($handle !== 'replayowl') {
        return $tag;
    }
    return str_replace(' src=', ' data-endpoint="https://replay.example.com/api/ingest" src=', $tag);
}, 10, 2);

Things to mask

WooCommerce checkout fields are text inputs, so they are masked by default. Card fields are never recorded in readable form. If your theme shows customer details in plain text, such as an order summary or account page, wrap them in an element with data-ro-mask. See Masking and privacy.

Heatmaps

Replayowl does not do heatmaps. If you mainly want heatmaps on a WordPress site, see the options in Hotjar alternatives.

A plugin

A WordPress plugin is something we would like to build. If you would use one, say so in an issue.