Mava Docs
  • 👋Introducing Mava
    • Book a demo
    • What is Mava?
  • 🟢Getting Started
    • Create a free account
    • Integration Setup
      • Web Chat Setup
        • Automatically capture custom user data (SDK)
        • Automatically open the web chat on page load
        • Create custom launch event
        • Hide web chat icon
        • Delay script load
        • Customize the position & Size of the Web chat
      • Discord Setup
        • Discord Ticket Setup
        • Discord Public Channel AI Setup
        • Changing the Discord Bot Name
        • Automatically add users or all users with a role into a Discord private thread
        • Responding to tickets within Discord
        • Discord Thread Limits & Archiving
      • Telegram Setup
        • Telegram Group Ticketing
      • Email Setup
        • Email Forwarding
        • Custom Email Domains
    • Inviting Team Members
      • Transferring account ownership
      • Existing Wallet User - How To Verify Your Email
    • Linking your Discord Profile to Mava
    • Chatbot Builder
    • Attributes
  • 🔄Ticket Automations
  • 🤖AI Support
    • AI Training
    • Private Support Ticket AI
    • Public Discord Channel AI
    • Public Telegram Group AI
    • Public Slack AI Channel
  • 🔗Webhooks & API
    • 🪝Webhooks
      • 📋Schemas
      • 🔐 Webhook Security Guide
      • 📩Deliverability
    • 💻API
    • No-Code Integrations
  • 📥The Support Inbox
    • Inbox Keyboard Shortcuts
    • Ticket Status
    • How to create a custom inbox view
    • How to copy a user's Telegram/Discord ID or email address
    • Tags
    • Changing your team's workspace name
  • 🎟️Ticket Behavior & Settings
    • How to open a ticket in Discord
    • Spam & Ticket limits
    • Auto-Resolve Tickets
    • Re-opening Resolved Tickets
    • Discord Threads & Limits
    • Discord Ticket Transcripts
  • 🔔Notifications
    • Personal Notifications
    • Team Notifications
  • 💲Price Plans
    • Pricing FAQs
  • 💸Affiliate Program
  • 📱Using Mava on Mobile
  • 🔐Data Protection & Security
  • ✅Going Live Checklist
  • ⚠️Workspace Account Deletion
Powered by GitBook
On this page

Was this helpful?

  1. Getting Started
  2. Integration Setup
  3. Web Chat Setup

Delay script load

There may be times when you only want the Web chat to load for certain users, or on certain pages of your site. For this we offer the delayed load.

Use case: Support should only be offered to logged in customers, or customers of a particular plan / subscription type.

<script
  defer
  src="https://widget.mava.app"
  widget-version="v2"
  id="MavaWebChat"
  data-token="YOUR_DATA_TOKEN"
  delay-load="true" // This is the important line
></script>

Adding this to your script will ensure that the Mava web chat doesn't automatically run on page load. Instead you will need to dispatch a custom window event to trigger the script to run.

<button
  onclick="
    var newEvent = new Event('loadMavaWebchat');
    window.dispatchEvent(newEvent);
    ">
  Load Mava Script
</button>

You can trigger this event from any source in your code, e.g as a reaction to a fetch event where the users credentials are checked and verified. After this event has been dispatched you can then use Mava in the normal manner, either with our default Mava web chat icon launcher, or a custom launcher.

PreviousHide web chat iconNextCustomize the position & Size of the Web chat

Last updated 1 year ago

Was this helpful?

🟢