Mixpanel Community Icon

How can I implement "Session replay" in Google Tag Manager?

·
·

How can I implement "Session replay" in Google Tag Manager?

  • Avatar of kapa.ai
    kapa.ai
    APP
    ·
    ·

    Hi Natsuki I., Please stand by as I search the Mixpanel knowledge base for an AI-powered answer. I normally take about 15 seconds or so. In case AI cannot answer your question, feel free to reach out to Mixpanel support at mixpanel.com/get-support. If you have follow-up questions for this thread, please tag me again with your question: @kapa.ai <follow-up question> đź‘‹

    Feel free to ask a follow-up question once I've answered by mentioning me with @kapa.ai

  • Avatar of kapa.ai
    kapa.ai
    APP
    ·
    ·

    To implement Session Replay in Google Tag Manager (GTM) with Mixpanel, follow these steps: 1. Install the Mixpanel GTM Template Make sure you have the Mixpanel GTM Template installed in your GTM workspace.2. Add a New Mixpanel Tag - Add a new tag and choose the Mixpanel tag type. - For Project Token, enter your Mixpanel project’s token. - For Tag Type, select init from the dropdown. - For Initialization, choose Set Options Manually. - In the Option key / Option value section, add record_sessions_percent as the key and set its value to a number between 1 and 100 (this determines the percentage of sessions to record). - You can also configure other Session Replay options here, such as record_block_class, record_block_selector, etc.3. Set Triggering - For the Triggering section, select an early GTM lifecycle event, such as Initialization - All Pages or Consent Initialization - All Pages. This ensures Session Replay starts recording as soon as the GTM container is initialized.4. Save and Deploy - Save and deploy the template to your website.This setup will enable Mixpanel Session Replay via GTM. You can further customize the initialization options as needed for your use case. For more details and a visual example, refer to the official documentation: Implement Session Replay (Web) / Google Tag Manager.For advanced options (like enabling heatmaps or custom autocapture), you can add additional initialization options in the same way, or use a custom JavaScript variable for more complex configurations. See the GTM integration guide for details.

    kapa.ai is still learning and improving, please let me know how I did by reacting below.

    ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.