> ## Documentation Index
> Fetch the complete documentation index at: https://watermelon.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Install the widget

> Step-by-step guide for installing and integrating the Watermelon Widget on your website or app, including setup, login, and logout instructions.

It only takes a few minutes to install the Widget on your website. Once installed, you’ll be able to answer Frequently Asked Questions automatically in no-time.

You have two ways to install your widget:

1. [**For visitors on your website**](#installing-the-widget-for-visitors-on-your-website) – the widget appears for anyone browsing your site. Conversations will be saved in the browser via a cookie.
2. [**For both visitors and logged-in users**](#installing-the-widget-for-both-visitors-and-logged-in-users) – the widget is available across your website and inside your platform or app. The widget will show information like customer names and previous conversations across devices.

<Tip>
  We recommend installing the Widget for both visitors and logged-in users to give everyone instant access to your team.
</Tip>

## Installing the widget **for visitors on your website**

### Getting your Chat Widget snippet

Let's first get your chat widget snippet, before we can place it onto your website. Follow the steps below:

<Steps>
  <Step title="Open Integrations">
    Navigate to **Integrations** in the menu on the left-hand side of your Watermelon dashboard.

    <Frame>
      <img src="https://mintcdn.com/watermelon/5ICJ1HQsAHXk-_ws/images/developer-resources/install-widget/install-widget-integrations.png?fit=max&auto=format&n=5ICJ1HQsAHXk-_ws&q=85&s=5e4eb65a9e757ddde50703a544d21b80" alt="Install Widget Integrations" width="2938" height="1390" data-path="images/developer-resources/install-widget/install-widget-integrations.png" />
    </Frame>
  </Step>

  <Step title="Open Chat Widget">
    Go to the section Channels, click on Chat Widget and select the widget you want to place on your website.

    <Frame>
      <img src="https://mintcdn.com/watermelon/5ICJ1HQsAHXk-_ws/images/developer-resources/install-widget/install-widget-channel.png?fit=max&auto=format&n=5ICJ1HQsAHXk-_ws&q=85&s=5a9b262c8c4f006c8f8442758d6ad2d5" alt="Install Widget Channel" width="2938" height="1390" data-path="images/developer-resources/install-widget/install-widget-channel.png" />
    </Frame>
  </Step>

  <Step title="Go to placement">
    In the widget settings, open the **Placement** tab.

    <Frame>
      <img src="https://mintcdn.com/watermelon/5ICJ1HQsAHXk-_ws/images/developer-resources/install-widget/install-widget-placement.png?fit=max&auto=format&n=5ICJ1HQsAHXk-_ws&q=85&s=6e82b28e5d970628e9777a90f8ae247a" alt="Install Widget Placement" width="2938" height="1390" data-path="images/developer-resources/install-widget/install-widget-placement.png" />
    </Frame>
  </Step>

  <Step title="Copy your widget code">
    Under **Code**, you’ll find your installation snippet. Click **copy code** in the top-right corner to copy the code to your clipboard.

    <Frame>
      <img src="https://mintcdn.com/watermelon/5ICJ1HQsAHXk-_ws/images/developer-resources/install-widget/install-widget-copy-code.png?fit=max&auto=format&n=5ICJ1HQsAHXk-_ws&q=85&s=d5c376458bae6e0306eeb71102c782d7" alt="Install Widget Copy Code" width="2938" height="1390" data-path="images/developer-resources/install-widget/install-widget-copy-code.png" />
    </Frame>
  </Step>
</Steps>

### **Install yourself**

Click **Copy code** and paste it before the `</head>` tag on every page you want the Widget to appear on your app and website.

After adding the code, open your app and website and the Widget will appear.

You can also use one of our guides to install the widget in a CMS:

<Tabs>
  <Tab title="Wordpress">
    Add your chat widget to your WordPress website so visitors can chat directly with your team or AI Agent. You can install the widget in two ways:

    1. By adding your snippet directly to your theme’s footer
    2. By using a plugin (recommended for most users)

    ### **Add your chat widget via your theme (Theme File Editor)**

    <Steps>
      <Step title="Open the Theme File Editor">
        In your WordPress admin panel, go to **Tools → Theme File Editor**.

        <Frame>
          <img src="https://mintcdn.com/watermelon/LdmIpS4PxN86SUTr/images/wordpress-start.png?fit=max&auto=format&n=LdmIpS4PxN86SUTr&q=85&s=e8071e6bcbe9ed8d653795829644f849" alt="Wordpress Start" width="1440" height="730" data-path="images/wordpress-start.png" />
        </Frame>
      </Step>

      <Step title="Open the footer file">
        In the file list, expand **Patterns** and select **Footer-default.php**.

        <Frame>
          <img src="https://mintcdn.com/watermelon/LdmIpS4PxN86SUTr/images/wordpress-patterns-footer.png?fit=max&auto=format&n=LdmIpS4PxN86SUTr&q=85&s=0066497f53cb0293e0eea91ae9d03cf1" alt="Wordpress Patterns Footer" width="1440" height="730" data-path="images/wordpress-patterns-footer.png" />
        </Frame>
      </Step>

      <Step title="Paste your chat widget code">
        Scroll to the bottom of the file and paste your chat widget snippet.

        Place it just before the closing \</body> tag if present.

        <Frame>
          <img src="https://mintcdn.com/watermelon/LdmIpS4PxN86SUTr/images/wordpress-add-code.png?fit=max&auto=format&n=LdmIpS4PxN86SUTr&q=85&s=ed8912ac1a3dfdc50ce530be32c7c991" alt="Wordpress Add Code" width="1440" height="730" data-path="images/wordpress-add-code.png" />
        </Frame>
      </Step>

      <Step title="Save your changes">
        Click **Update File** at the bottom of the code editor to apply your changes.

        <Frame>
          <img src="https://mintcdn.com/watermelon/ZjTP5hU4lKtWz8eK/images/wordpress-add-code-save.png?fit=max&auto=format&n=ZjTP5hU4lKtWz8eK&q=85&s=0134a15da3055cbcf299408d67c1c531" alt="Wordpress Add Code Save" width="1440" height="730" data-path="images/wordpress-add-code-save.png" />
        </Frame>
      </Step>

      <Step title="Preview your site">
        Open your website in a browser (not the editor preview) to confirm your chat widget is now live.

        <Note>
          Editing theme files directly requires caution. If you switch or update your theme, your changes may be lost.

          If you prefer a safer option, use the **WPCode plugin** instead.
        </Note>
      </Step>
    </Steps>

    ### **Add your chat widget using the WPCode plugin (recommended)**

    <Steps>
      <Step title="Install WPCode">
        Install and activate the **WPCode** plugin (formerly *Insert Headers and Footers*).

        <Frame>
          <img src="https://mintcdn.com/watermelon/LdmIpS4PxN86SUTr/images/wordpress-wp-code-start.png?fit=max&auto=format&n=LdmIpS4PxN86SUTr&q=85&s=5266274cfd95d3116dc016c4ba14f215" alt="Wordpress Wp Code Start" width="1440" height="730" data-path="images/wordpress-wp-code-start.png" />
        </Frame>
      </Step>

      <Step title="Create a new snippet">
        Go to **Code Snippets → + Add Snippet**.

        Hover over **Add Your Custom Code (New Snippet)** and click **Use Snippet**.

        <Frame>
          <img src="https://mintcdn.com/watermelon/LdmIpS4PxN86SUTr/images/wordpress-wp-code-add-custom-code.png?fit=max&auto=format&n=LdmIpS4PxN86SUTr&q=85&s=d2df0a054e42da50084fe2dec8173db2" alt="Wordpress Wp Code Add Custom Code" width="1440" height="730" data-path="images/wordpress-wp-code-add-custom-code.png" />
        </Frame>
      </Step>

      <Step title="Configure your snippet">
        * Give your snippet a **title** (e.g., “Chat widget”).
        * Set **Code Type** to *JavaScript Snippet*.

        Paste your widget code in the **Code Preview** area.

        <Frame>
          <img src="https://mintcdn.com/watermelon/LdmIpS4PxN86SUTr/images/wordpress-wp-code-create-custom-snippet.png?fit=max&auto=format&n=LdmIpS4PxN86SUTr&q=85&s=f15077b0240c11a934352ae791146fb7" alt="Wordpress Wp Code Create Custom Snippet" width="1440" height="730" data-path="images/wordpress-wp-code-create-custom-snippet.png" />
        </Frame>
      </Step>

      <Step title="Choose where to load the snippet">
        Under **Insertion**, select where the script should appear:

        * **Header** (most reliable)
        * **Footer** (better performance)
        * Or target specific pages using WPCode’s conditional logic
                  <Frame>
                    <img src="https://mintcdn.com/watermelon/LdmIpS4PxN86SUTr/images/wordpress-wp-code-create-insertion-options.png?fit=max&auto=format&n=LdmIpS4PxN86SUTr&q=85&s=dc968fd259d74b0cf1acd267f8f138b7" alt="Wordpress Wp Code Create Insertion Options" width="1440" height="730" data-path="images/wordpress-wp-code-create-insertion-options.png" />
                  </Frame>

        <Tip>
          You can load the widget only on certain pages or for specific users, thanks to WPCode’s Smart Conditional Logic.
        </Tip>
      </Step>

      <Step title="Save and activate">
        Click **Save Snippet**, then switch the toggle to **Active**.

        <Frame>
          <img src="https://mintcdn.com/watermelon/LdmIpS4PxN86SUTr/images/wordpress-wp-code-activate-and-save.png?fit=max&auto=format&n=LdmIpS4PxN86SUTr&q=85&s=d5625c440f2d87d151198a4cc627142c" alt="Wordpress Wp Code Activate And Save" width="1440" height="730" data-path="images/wordpress-wp-code-activate-and-save.png" />
        </Frame>

        Your chat widget is now live on your site.
      </Step>
    </Steps>
  </Tab>

  <Tab title="Wix">
    Add your chat widget to your Wix website so visitors can chat directly with your team or AI Agent. To add custom JavaScript in Wix, you need a paid Wix plan with a connected domain. Free Wix sites don’t support adding custom code snippets.

    <Steps>
      <Step title="Open your Wix Dashboard">
        Go to your **Wix Website Dashboard**.

        Scroll down and click **Settings** in the left-hand menu.

        <Frame>
          <img src="https://mintcdn.com/watermelon/JIROo-rZJo_yCPtA/images/wix-start.png?fit=max&auto=format&n=JIROo-rZJo_yCPtA&q=85&s=29e055f8765e17422cdaa5163afd26f5" alt="Wix Start" width="1440" height="727" data-path="images/wix-start.png" />
        </Frame>
      </Step>

      <Step title="Open the Custom Code settings">
        Scroll to the bottom of the Settings page and open **Advanced → Custom Code**.

        <Frame>
          <img src="https://mintcdn.com/watermelon/JIROo-rZJo_yCPtA/images/wix-custom-code.png?fit=max&auto=format&n=JIROo-rZJo_yCPtA&q=85&s=9195acc575b45e701aa36addf8236ff6" alt="Wix Custom Code" width="1440" height="730" data-path="images/wix-custom-code.png" />
        </Frame>
      </Step>

      <Step title="Add your chat widget code">
        Click **Add Code**, then choose **Head** as the placement location.

        Paste your chat widget JavaScript code into the code editor.

        <Frame>
          <img src="https://mintcdn.com/watermelon/E5Q4zF7hmZrfaIaJ/images/wix-add-code-to-head.png?fit=max&auto=format&n=E5Q4zF7hmZrfaIaJ&q=85&s=869ed58f1ce46c4531790b437ba71649" alt="Wix Add Code To Head" width="1440" height="730" data-path="images/wix-add-code-to-head.png" />
        </Frame>

        <Frame>
          <img src="https://mintcdn.com/watermelon/JIROo-rZJo_yCPtA/images/wix-adding-code.png?fit=max&auto=format&n=JIROo-rZJo_yCPtA&q=85&s=9255936ec80436197d05d45dfab37ee4" alt="Wix Adding Code" width="1440" height="730" data-path="images/wix-adding-code.png" />
        </Frame>
      </Step>

      <Step title="Enable the snippet">
        After applying your code, turn on the toggle switch to **enable** the snippet on your website.

        <Frame>
          <img src="https://mintcdn.com/watermelon/JIROo-rZJo_yCPtA/images/wix-enable.png?fit=max&auto=format&n=JIROo-rZJo_yCPtA&q=85&s=445924fc4e6ec7639ac84170844d8403" alt="Wix Enable" width="1440" height="730" data-path="images/wix-enable.png" />
        </Frame>
      </Step>

      <Step title="Disable the built-in Wix Chat (optional)">
        If you don’t want Wix’s native chat to appear next to your own chat widget:

        1. Open the **Wix Editor**
        2. Select the **Wix Chat** element
        3. Delete it from the page
      </Step>

      <Step title="Publish and preview your live site">
        Click **Publish** to make the changes live.

        Open your website in a browser — not in preview mode — to confirm that your chat widget is now visible
      </Step>
    </Steps>
  </Tab>

  <Tab title="Lightspeed">
    Add your chat widget to your Lightspeed eCom C-Series store so visitors can chat directly with your team or AI Agent.

    Lightspeed eCom C-Series allows you to add custom code to the \<head> section of your entire website. This is the best—and only—location for adding your chat widget script.

    <Steps>
      <Step title="Open your eCom settings">
        From your Lightspeed **eCom admin**, go to **Settings**.

        <Frame>
          <img src="https://mintcdn.com/watermelon/CCXBZWJ6BhbhyvjS/images/lightspeed-start.png?fit=max&auto=format&n=CCXBZWJ6BhbhyvjS&q=85&s=ffb57b7edd693c9c9a15bf1c676411cd" alt="Lightspeed Start" width="1440" height="730" data-path="images/lightspeed-start.png" />
        </Frame>
      </Step>

      <Step title="Open Web extras">
        Under the **Website Settings** column, select **Web extras**.

        <Frame>
          <img src="https://mintcdn.com/watermelon/CCXBZWJ6BhbhyvjS/images/lightspeed-settings.png?fit=max&auto=format&n=CCXBZWJ6BhbhyvjS&q=85&s=c5b1c7c04e83225e5234693fac0b21eb" alt="Lightspeed Settings" width="1440" height="730" data-path="images/lightspeed-settings.png" />
        </Frame>
      </Step>

      <Step title="Add your custom code">
        In the **Custom head code** section, click **Add code**.\
        Paste your chat widget script or URL in the field.

        <Frame>
          <img src="https://mintcdn.com/watermelon/CCXBZWJ6BhbhyvjS/images/lightspeed-custom-head-code.png?fit=max&auto=format&n=CCXBZWJ6BhbhyvjS&q=85&s=6d0ce49d6b8681f12218cd591584530d" alt="Lightspeed Custom Head Code" width="1440" height="730" data-path="images/lightspeed-custom-head-code.png" />
        </Frame>

        <Note>
          Code added here is injected into the \<head> section on **every page** of your website.

          Lightspeed eCom C-Series does **not** support page-specific custom code.
        </Note>
      </Step>

      <Step title="Save your changes">
        Click **Save** to apply your code.

        <Frame>
          <img src="https://mintcdn.com/watermelon/CCXBZWJ6BhbhyvjS/images/lightspeed-add-code-pop-up-save.png?fit=max&auto=format&n=CCXBZWJ6BhbhyvjS&q=85&s=994d9f12981dde42ced56c6d9c3dae32" alt="Lightspeed Add Code Pop Up Save" width="1440" height="730" data-path="images/lightspeed-add-code-pop-up-save.png" />
        </Frame>
      </Step>

      <Step title="Preview your live store">
        Open your website in a browser to confirm that your chat widget appears.

        <Tip>
          Custom code may not appear in previews — always check your **live** store.
        </Tip>
      </Step>
    </Steps>
  </Tab>

  <Tab title="Google tag manager">
    ### Add your chat widget to your website using Google Tag Manager (GTM).

    With GTM, you can install your widget across your entire website or only on selected pages using triggers.

    ### Add your chat widget to your entire website

    <Steps>
      <Step title="Open Google Tag Manager">
        Log in at [**tagmanager.google.com**](http://tagmanager.google.com) and select the container for your website.
      </Step>

      <Step title="Create a new tag">
        In the left-hand menu, click **Tags → New**.

        <Frame>
          <img src="https://mintcdn.com/watermelon/QwFtQaRwZL2E0oDG/images/gtm-start.png?fit=max&auto=format&n=QwFtQaRwZL2E0oDG&q=85&s=3738328e7ba2ff1bc0840b58b6184785" alt="Gtm Start" width="1440" height="730" data-path="images/gtm-start.png" />
        </Frame>
      </Step>

      <Step title="Configure your tag">
        Click **Tag Configuration** and choose **Custom HTML**.

        Paste your chat widget code into the HTML field.

        <Frame>
          <img src="https://mintcdn.com/watermelon/QwFtQaRwZL2E0oDG/images/gtm-select-custom-html.png?fit=max&auto=format&n=QwFtQaRwZL2E0oDG&q=85&s=2c19a78c509fbaf0a6f0c465647bc198" alt="Gtm Select Custom Html" width="1440" height="730" data-path="images/gtm-select-custom-html.png" />
        </Frame>

        <Frame>
          <img src="https://mintcdn.com/watermelon/QwFtQaRwZL2E0oDG/images/gtm-adding-widget-code.png?fit=max&auto=format&n=QwFtQaRwZL2E0oDG&q=85&s=10e361f0bb8952a9c07913eea580d5e3" alt="Gtm Adding Widget Code" width="1440" height="730" data-path="images/gtm-adding-widget-code.png" />
        </Frame>
      </Step>

      <Step title="Set the trigger">
        Click **Triggering → All Pages**.

        This will load your chat widget everywhere your GTM container is installed.

        <Frame>
          <img src="https://mintcdn.com/watermelon/QwFtQaRwZL2E0oDG/images/gtm-select-all-pages.png?fit=max&auto=format&n=QwFtQaRwZL2E0oDG&q=85&s=33db2e4f254893dcdc8fc1a991825c86" alt="Gtm Select All Pages" width="1440" height="730" data-path="images/gtm-select-all-pages.png" />
        </Frame>
      </Step>

      <Step title="Save and publish">
        Click **Save**, then **Submit** in the top right to publish your changes.

        Your chat widget is now active across your entire website.

        <Frame>
          <img src="https://mintcdn.com/watermelon/QwFtQaRwZL2E0oDG/images/gtm-click-on-save.png?fit=max&auto=format&n=QwFtQaRwZL2E0oDG&q=85&s=bac708d228a1bca7a9e90e3fcf0e988f" alt="Gtm Click On Save" width="1440" height="729" data-path="images/gtm-click-on-save.png" />
        </Frame>

        <Frame>
          <img src="https://mintcdn.com/watermelon/QwFtQaRwZL2E0oDG/images/gtm-click-on-submit.png?fit=max&auto=format&n=QwFtQaRwZL2E0oDG&q=85&s=f10438e8a057487efbf6155e0ac9f03b" alt="Gtm Click On Submit" width="1440" height="730" data-path="images/gtm-click-on-submit.png" />
        </Frame>
      </Step>
    </Steps>

    ### **Add your chat widget to specific pages**

    If you want your widget to appear only on one or more selected pages, you can use a **page view trigger**.

    <Steps>
      <Step title="Create a new tag">
        Go to **Tags → New**, choose **Custom HTML**, and paste your chat widget code.

        <Frame>
          <img src="https://mintcdn.com/watermelon/QwFtQaRwZL2E0oDG/images/gtm-start.png?fit=max&auto=format&n=QwFtQaRwZL2E0oDG&q=85&s=3738328e7ba2ff1bc0840b58b6184785" alt="Gtm Start" width="1440" height="730" data-path="images/gtm-start.png" />
        </Frame>

        <Frame>
          <img src="https://mintcdn.com/watermelon/QwFtQaRwZL2E0oDG/images/gtm-adding-widget-code.png?fit=max&auto=format&n=QwFtQaRwZL2E0oDG&q=85&s=10e361f0bb8952a9c07913eea580d5e3" alt="Gtm Adding Widget Code" width="1440" height="730" data-path="images/gtm-adding-widget-code.png" />
        </Frame>
      </Step>

      <Step title="Create a page-specific trigger">
        Click **Triggering → + → Page View**.

        Set the trigger to:

        * **Some Page Views**
        * **Page URL → contains/equal → your-page-url**
                  <Frame>
                    <img src="https://mintcdn.com/watermelon/QwFtQaRwZL2E0oDG/images/gtm-select-some-pages.png?fit=max&auto=format&n=QwFtQaRwZL2E0oDG&q=85&s=b876cbd1f611c0bf7456f3b2f80b4c31" alt="Gtm Select Some Pages" width="1440" height="730" data-path="images/gtm-select-some-pages.png" />
                  </Frame>

        > Examples:
        >
        > * Show only on the contact page → *Page URL contains “/contact”*
        > * Show only on the pricing page → *Page URL contains “/pricing”*
        >
        > You can add multiple conditions for multiple pages.
      </Step>

      <Step title="Save and publish">
        Click **Save**, then **Submit** in the top right to publish your changes.

        Your chat widget is now active across your entire website.

        <Frame>
          <img src="https://mintcdn.com/watermelon/QwFtQaRwZL2E0oDG/images/gtm-click-on-save.png?fit=max&auto=format&n=QwFtQaRwZL2E0oDG&q=85&s=bac708d228a1bca7a9e90e3fcf0e988f" alt="Gtm Click On Save" width="1440" height="729" data-path="images/gtm-click-on-save.png" />
        </Frame>

        <Frame>
          <img src="https://mintcdn.com/watermelon/QwFtQaRwZL2E0oDG/images/gtm-click-on-submit.png?fit=max&auto=format&n=QwFtQaRwZL2E0oDG&q=85&s=f10438e8a057487efbf6155e0ac9f03b" alt="Gtm Click On Submit" width="1440" height="730" data-path="images/gtm-click-on-submit.png" />
        </Frame>
      </Step>
    </Steps>

    ### Verify the installation

    Use GTM Preview Mode

    Click **Preview** in Google Tag Manager and open your website to confirm your tag is firing correctly.

    ### Check on your live website

    Open your published website in a browser and confirm the widget appears in the correct places.
  </Tab>

  <Tab title="Shopify">
    ### **Add the chat widget to your Shopify website**

    Add your chat widget to your Shopify store and let visitors chat directly with your team or AI Agent.

    You can install your widget across your entire website, or place it on a single page only whichever fits your use case.

    ### Add your chat widget to your entire website

    <Steps>
      <Step title="Open your theme">
        From your Shopify admin, navigate to **Online Store → Themes**.

        <Frame>
          <img src="https://mintcdn.com/watermelon/ZjTP5hU4lKtWz8eK/images/shopify-start.png?fit=max&auto=format&n=ZjTP5hU4lKtWz8eK&q=85&s=256a6c93358fd30e455fe2c2ca09f860" alt="Shopify Start" width="1440" height="730" data-path="images/shopify-start.png" />
        </Frame>

        <Frame>
          <img src="https://mintcdn.com/watermelon/ZjTP5hU4lKtWz8eK/images/shopify-select-theme.png?fit=max&auto=format&n=ZjTP5hU4lKtWz8eK&q=85&s=5e8f0895981e121686d8a40027e6aad2" alt="Shopify Select Theme" width="1440" height="730" data-path="images/shopify-select-theme.png" />
        </Frame>
      </Step>

      <Step title="Open the code editor">
        On your active theme, click **… → Edit code**.

        <Frame>
          <img src="https://mintcdn.com/watermelon/ZjTP5hU4lKtWz8eK/images/shopify-edit-code-element.png?fit=max&auto=format&n=ZjTP5hU4lKtWz8eK&q=85&s=cece71e349a87593180480cea52c427b" alt="Shopify Edit Code Element" width="1440" height="731" data-path="images/shopify-edit-code-element.png" />
        </Frame>
      </Step>

      <Step title="Open the theme.liquid file">
        In the left sidebar, expand the **Layout** folder and select **theme.liquid**.

        <Frame>
          <img src="https://mintcdn.com/watermelon/ZjTP5hU4lKtWz8eK/images/shopify-select-theme-in-code.png?fit=max&auto=format&n=ZjTP5hU4lKtWz8eK&q=85&s=799b5b548dec854b89ad0d8fafcbdbf8" alt="Shopify Select Theme In Code" width="1440" height="730" data-path="images/shopify-select-theme-in-code.png" />
        </Frame>
      </Step>

      <Step title="Paste your chat widget code">
        Scroll until you find the \<head> tag.

        Paste your chat widget code **inside the \<head> section**.

        <Frame>
          <img src="https://mintcdn.com/watermelon/ZjTP5hU4lKtWz8eK/images/shopify-add-code.png?fit=max&auto=format&n=ZjTP5hU4lKtWz8eK&q=85&s=23f57fd389d014ce3052a0244c692796" alt="Shopify Add Code" width="1440" height="730" data-path="images/shopify-add-code.png" />
        </Frame>

        <Tip>
          Placing your script in the \<head> ensures that the widget loads correctly on every page of your store.
        </Tip>
      </Step>

      <Step title="Save your changes">
        Click **Save** in the top-right corner.

        <Frame>
          <img src="https://mintcdn.com/watermelon/ZjTP5hU4lKtWz8eK/images/shopify-save.png?fit=max&auto=format&n=ZjTP5hU4lKtWz8eK&q=85&s=87f40e5f401619f0baedccf10b5d0e89" alt="Shopify Save" width="1440" height="730" data-path="images/shopify-save.png" />
        </Frame>

        Your chat widget is now added to your entire Shopify website.
      </Step>
    </Steps>

    ### Add your Chat Widget to a specific page

    If you only want your Chat Widget to appear on certain pages, follow these steps instead.

    <Steps>
      <Step title="Create or open a page">
        Go to **Online Store → Pages** and select an existing page or create a new one.
      </Step>

      <Step title="Open the HTML editor">
        In the page content toolbar, click the **\<>** icon to switch to HTML editing mode.
      </Step>

      <Step title="Paste your chat widget code">
        Paste your chat widget code into the HTML area, wrapped inside \<script>...\</script> tags.

        <Note>
          This method only adds the chat widget to that one specific page.

          It won’t appear elsewhere on your store unless added to theme.liquid.
        </Note>
      </Step>

      <Step title="Save and preview">
        Click **Save**, then open your page in a browser to confirm that the widget appears.
      </Step>
    </Steps>
  </Tab>

  <Tab title="Joomla">
    ### **Add the chat widget to your Joomla website**

    You can easily place your chat widget by adding a short code snippet to your Joomla site’s template file.

    <Steps>
      <Step title="Log in to your Joomla admin panel">
        Open your **Joomla Administrator** panel and log in with your admin credentials.
      </Step>

      <Step title="Go to System settings">
        From the left-hand menu, navigate to **System**.

        <Frame>
          <img src="https://mintcdn.com/watermelon/LCSm56vFu9Pi5rec/images/joomla-start.png?fit=max&auto=format&n=LCSm56vFu9Pi5rec&q=85&s=53606e7c7291aac3d49034b34a5ff64f" alt="Joomla Start Pn" width="1440" height="731" data-path="images/joomla-start.png" />
        </Frame>
      </Step>

      <Step title="Open Site Templates">
        Under the **Templates** section, click **Site Templates**.

        <Frame>
          <img src="https://mintcdn.com/watermelon/LCSm56vFu9Pi5rec/images/joomla-site-templates.png?fit=max&auto=format&n=LCSm56vFu9Pi5rec&q=85&s=1e38049291df3d570b500fb52b8c6338" alt="Joomla Site Templates Pn" width="1439" height="730" data-path="images/joomla-site-templates.png" />
        </Frame>
      </Step>

      <Step title="Select your active template">
        Choose the template you want to add your chat widget to.

        <Frame>
          <img src="https://mintcdn.com/watermelon/LCSm56vFu9Pi5rec/images/joomla-select-template.png?fit=max&auto=format&n=LCSm56vFu9Pi5rec&q=85&s=150db60c5721c3931166503dad73415d" alt="Joomla Select Template Pn" width="1440" height="730" data-path="images/joomla-select-template.png" />
        </Frame>
      </Step>

      <Step title="Edit the index.php file">
        In your template’s file editor, locate and open the **index.php** file.

        <Frame>
          <img src="https://mintcdn.com/watermelon/LCSm56vFu9Pi5rec/images/joomla-go-to-index.png?fit=max&auto=format&n=LCSm56vFu9Pi5rec&q=85&s=10563f02b92b6cefdaf9c2ca6c07ee7c" alt="Joomla Go To Index Pn" width="1440" height="731" data-path="images/joomla-go-to-index.png" />
        </Frame>
      </Step>

      <Step title="Paste your chat widget code">
        Scroll to the middle of the **index.php** file and paste your chat widget embed code \*\*just before the closing \*\*`</head>`**tag** .

        <Frame>
          <img src="https://mintcdn.com/watermelon/LCSm56vFu9Pi5rec/images/joomla-add-code.png?fit=max&auto=format&n=LCSm56vFu9Pi5rec&q=85&s=8f63f76b65bd4dc736effa2034b86bf9" alt="Joomla Add Code Pn" width="1440" height="729" data-path="images/joomla-add-code.png" />
        </Frame>

        <Tip>
          **Tip:** You can also use the search function on the bottom left and type in \<head> to go to the correct spot in the index.php file to add your code, as seen in the screenshot above.
        </Tip>
      </Step>

      <Step title="Save your changes">
        Click **Save & Close** to apply your changes.

        <Frame>
          <img src="https://mintcdn.com/watermelon/LCSm56vFu9Pi5rec/images/joomla-add-code-save.png?fit=max&auto=format&n=LCSm56vFu9Pi5rec&q=85&s=04cad11ad2a0462283e4e472b2e3f1d1" alt="Joomla Add Code Save Pn" width="1440" height="729" data-path="images/joomla-add-code-save.png" />
        </Frame>
      </Step>
    </Steps>
  </Tab>

  <Tab title="Squarespace">
    ### **Add the chat widget to your Squarespace website**

    <Note>
      To use Code Injection, make sure your site is on one of the following plans:\
      **Core**, **Plus**, **Advanced**, **Business**, **Commerce Basic**, or **Commerce Advanced**.
    </Note>

    <Steps>
      <Step title="Open Settings">
        From your Squarespace dashboard, click **Website**.

        <Frame>
          <img src="https://mintcdn.com/watermelon/4oHzYW5PC0C6ujKV/images/squarespace-start.png?fit=max&auto=format&n=4oHzYW5PC0C6ujKV&q=85&s=3fdacbc7b80bdaa07878bfaf7af2f510" alt="Squarespace Start Pn" width="1440" height="730" data-path="images/squarespace-start.png" />
        </Frame>
      </Step>

      <Step title="Go to Custom Code → Code Injection">
        In the menu, select **Custom Code**, then click **Code Injection**.

        <Frame>
          <img src="https://mintcdn.com/watermelon/4oHzYW5PC0C6ujKV/images/squarespace-custom-code.png?fit=max&auto=format&n=4oHzYW5PC0C6ujKV&q=85&s=87c1aeabe7555ada773be1fbd2b85997" alt="Squarespace Custom Code Pn" width="1440" height="729" data-path="images/squarespace-custom-code.png" />
        </Frame>
      </Step>

      <Step title="Add your widget code">
        Under **Header**, paste your chat widget code.\
        This will inject the widget into the `<head>` tag on every page of your site.

        <Frame>
          <img src="https://mintcdn.com/watermelon/4oHzYW5PC0C6ujKV/images/squarespace-code-injection.png?fit=max&auto=format&n=4oHzYW5PC0C6ujKV&q=85&s=ddc2f946d99abd9274ff14f54232ffce" alt="Squarespace Code Injection Pn" width="1440" height="727" data-path="images/squarespace-code-injection.png" />
        </Frame>

        <Note>
          The Header field adds the code to all pages.

          If you prefer, you can also add your code to the Footer section — this loads the widget before the closing `</body>` tag, which can slightly improve page performance.
        </Note>
      </Step>

      <Step title="Save your changes">
        Click **Save** to apply your chat widget code.

        <Frame>
          <img src="https://mintcdn.com/watermelon/4oHzYW5PC0C6ujKV/images/squarespace-code-injection-save.png?fit=max&auto=format&n=4oHzYW5PC0C6ujKV&q=85&s=802424fe7eca0cfef5b05c63a5be7fa5" alt="Squarespace Code Injection Save Pn" width="1440" height="727" data-path="images/squarespace-code-injection-save.png" />
        </Frame>
      </Step>
    </Steps>

    <Tip>
      If you don’t see the widget check if the selected chat widget is set on "**Show on website**".
    </Tip>

    ### **Add the chat widget to a specific page (optional)**

    If you’d like to add the chat widget only to certain pages, follow these steps:

    <Steps>
      <Step title="Open the Pages panel">
        In your Squarespace dashboard, go to **Website** and click on **Pages.**

        <Frame>
          <img src="https://mintcdn.com/watermelon/4oHzYW5PC0C6ujKV/images/squarespace-start.png?fit=max&auto=format&n=4oHzYW5PC0C6ujKV&q=85&s=3fdacbc7b80bdaa07878bfaf7af2f510" alt="Squarespace Start Pn" width="1440" height="730" data-path="images/squarespace-start.png" />
        </Frame>

        Then hover over the page you want to edit and click the **gear icon** to open **Page Settings**.

        <Frame>
          <img src="https://mintcdn.com/watermelon/4oHzYW5PC0C6ujKV/images/squarespace-single-page-selection.png?fit=max&auto=format&n=4oHzYW5PC0C6ujKV&q=85&s=7b4223f9a9a65d7a14a7ea8ee5cfd4e1" alt="Squarespace Single Page Selection Pn" width="1440" height="728" data-path="images/squarespace-single-page-selection.png" />
        </Frame>
      </Step>

      <Step title="Inject the code on the page">
        Click **Advanced**, then scroll to **Page Header Code Injection**. Paste your chat widget code here.

        <Frame>
          <img src="https://mintcdn.com/watermelon/4oHzYW5PC0C6ujKV/images/squarespace-single-page-code-injection.png?fit=max&auto=format&n=4oHzYW5PC0C6ujKV&q=85&s=fc662a9d9b42b3296a5aec60cb2c680e" alt="Squarespace Single Page Code Injection Pn" width="1440" height="728" data-path="images/squarespace-single-page-code-injection.png" />
        </Frame>

        <Note>
          The code you add here is injected into the \<head> tag of this specific page.

          Blog pages also include a Post Blog Item Code Injection option if you want the widget on each post.
        </Note>
      </Step>

      <Step title="Save and publish">
        Click **Save**, then **Publish** your site. Open the page in your browser to confirm that your Watermelon chat widget appears correctly.

        <Frame>
          <img src="https://mintcdn.com/watermelon/4oHzYW5PC0C6ujKV/images/squarespace-single-page-code-injection-save.png?fit=max&auto=format&n=4oHzYW5PC0C6ujKV&q=85&s=04e475e7daf2005370537f75efb9fda1" alt="Squarespace Single Page Code Injection Save Pn" width="1440" height="728" data-path="images/squarespace-single-page-code-injection-save.png" />
        </Frame>
      </Step>
    </Steps>
  </Tab>

  <Tab title="Framer">
    ### **Add the widget to your entire website**

    Now that you have your chat widget code, follow the steps below to add it to your Framer website.

    <Steps>
      <Step title="Open project settings">
        In Framer, click **Project Settings** in the top right corner of your dashboard.

        <Frame>
          <img src="https://mintcdn.com/watermelon/41DYAQurnl0hpms-/images/framer-go-to-settings.png?fit=max&auto=format&n=41DYAQurnl0hpms-&q=85&s=9c872880935cd412ed45de77d83b3d16" alt="Framer Go To Settings Pn" width="1440" height="730" data-path="images/framer-go-to-settings.png" />
        </Frame>
      </Step>

      <Step title="Open the General tab">
        Navigate to the **General** tab and scroll down to the **Custom Code** section.

        <Frame>
          <img src="https://mintcdn.com/watermelon/41DYAQurnl0hpms-/images/framer-go-to-general.png?fit=max&auto=format&n=41DYAQurnl0hpms-&q=85&s=f78352cebc7567bd8e471d570b8573c6" alt="Framer Go To General Pn" width="1440" height="730" data-path="images/framer-go-to-general.png" />
        </Frame>
      </Step>

      <Step title="Add your chat widget code">
        In the **Custom Code** section, you’ll see fields for adding code to the **Head**, **Body**, and **Footer**.

        Paste your Watermelon chat widget code at the \*\*start of the \*\*`<head>`**tag**  code area.

        <Frame>
          <img src="https://mintcdn.com/watermelon/41DYAQurnl0hpms-/images/framer-add-custom-code.png?fit=max&auto=format&n=41DYAQurnl0hpms-&q=85&s=551fdd868c519da0a0ca29a0ee7cb617" alt="Framer Add Custom Code Pn" width="1440" height="730" data-path="images/framer-add-custom-code.png" />
        </Frame>
      </Step>

      <Step title="Save changes">
        Your script will now run across the entire website after you publish your project.

        <Frame>
          <img src="https://mintcdn.com/watermelon/41DYAQurnl0hpms-/images/framer-publish-button.png?fit=max&auto=format&n=41DYAQurnl0hpms-&q=85&s=b79799929139fbcfc1d6e462f129d9cc" alt="Framer Publish Button Pn" width="1440" height="730" data-path="images/framer-publish-button.png" />
        </Frame>

        <Tip>
          **Tip:** The custom code will only appear after publishing your website.

          The chat widget won’t show up in Framer’s preview — open your live site in a browser to see it in action.
        </Tip>
      </Step>
    </Steps>

    <Tip>
      If you don’t see the widget, double-check if you have published your website. And also check if the selected chat widget is set on "**Show on website**"
    </Tip>

    ### **Add the widget to a specific page (optional)**

    If you prefer to display the chat widget on a single page instead of the whole site, follow these steps:

    <Steps>
      <Step title="Go to project settings">
        Click **Project Settings** in the top right corner.

        <Frame>
          <img src="https://mintcdn.com/watermelon/41DYAQurnl0hpms-/images/framer-go-to-settings.png?fit=max&auto=format&n=41DYAQurnl0hpms-&q=85&s=9c872880935cd412ed45de77d83b3d16" alt="Framer Go To Settings Pn" width="1440" height="730" data-path="images/framer-go-to-settings.png" />
        </Frame>
      </Step>

      <Step title="Select your page">
        Open **Page Settings** and select the page where you want to add the chat widget.

        <Frame>
          <img src="https://mintcdn.com/watermelon/41DYAQurnl0hpms-/images/framer-specific-page.png?fit=max&auto=format&n=41DYAQurnl0hpms-&q=85&s=2823c91e120964746c5ce8fe1c904851" alt="Framer Specific Page Pn" width="1440" height="730" data-path="images/framer-specific-page.png" />
        </Frame>
      </Step>

      <Step title="Paste your code">
        In the **Custom Code** section for that page, paste your Watermelon chat widget code inside the `<head>` tag code area.

        <Frame>
          <img src="https://mintcdn.com/watermelon/41DYAQurnl0hpms-/images/framer-specific-page-add-code.png?fit=max&auto=format&n=41DYAQurnl0hpms-&q=85&s=0d8d3d26d910db726490126d55297c5e" alt="Framer Specific Page Add Code Pn" width="1440" height="730" data-path="images/framer-specific-page-add-code.png" />
        </Frame>
      </Step>

      <Step title="Save and publish">
        Click **Save**, then **Publish** your project.

        Your Watermelon chat widget will now appear on the selected page.

        <Frame>
          <img src="https://mintcdn.com/watermelon/41DYAQurnl0hpms-/images/framer-specific-page-publish.png?fit=max&auto=format&n=41DYAQurnl0hpms-&q=85&s=73718acadf53b8259966530fa49eda48" alt="Framer Specific Page Publish Pn" width="1440" height="730" data-path="images/framer-specific-page-publish.png" />
        </Frame>

        <Tip>
          Just like with the full-site setup, the widget only appears **after publishing** — it won’t be visible in the preview.
        </Tip>
      </Step>
    </Steps>
  </Tab>

  <Tab title="Webflow">
    ### **Add the widget to your Webflow website**

    Now that you have your chat widget code, follow the steps below to add it to your Webflow website.

    <Steps>
      <Step title="Open your Webflow project">
        From your **Webflow dashboard**, find your project thumbnail and click the **three dots icon** to view more options.

        <Frame>
          <img src="https://mintcdn.com/watermelon/rwCrMEcHyf3HMmHb/images/webflow-start.png?fit=max&auto=format&n=rwCrMEcHyf3HMmHb&q=85&s=bbd9cf3d24b524f0a2f5caa555ccc9e2" alt="Webflow Start Pn" width="1440" height="730" data-path="images/webflow-start.png" />
        </Frame>
      </Step>

      <Step title="Open project settings">
        Click **Settings** to open the project configuration page.

        <Frame>
          <img src="https://mintcdn.com/watermelon/rwCrMEcHyf3HMmHb/images/webflow-go-to-settings.png?fit=max&auto=format&n=rwCrMEcHyf3HMmHb&q=85&s=7ff6ad355036d910c35cad13ccdffff4" alt="Webflow Go To Settings Pn" width="1440" height="730" data-path="images/webflow-go-to-settings.png" />
        </Frame>
      </Step>

      <Step title="Go to Custom Code">
        From the left sidebar, navigate to **Custom Code**.

        <Frame>
          <img src="https://mintcdn.com/watermelon/rwCrMEcHyf3HMmHb/images/webflow-go-to-custom-code.png?fit=max&auto=format&n=rwCrMEcHyf3HMmHb&q=85&s=c6e6bcce9924c8e9c501574a3b3ab428" alt="Webflow Go To Custom Code Pn" width="1440" height="730" data-path="images/webflow-go-to-custom-code.png" />
        </Frame>
      </Step>

      <Step title="Add your widget code">
        Scroll down to the section \*\*Add code in the \*\*`<head>`**tag**  and paste your chat widget code here.

        <Tip>
          **Tip:** For best performance, place your code before the closing \<footer> tag instead of in the head. This makes sure your site loads faster while the widget still appears correctly.
        </Tip>

        Make sure your code is wrapped in `<script>` and `</script>` tags. Do **not** include `<body>` or `</body>` tags — Webflow automatically places your code inside them.

        <Frame>
          <img src="https://mintcdn.com/watermelon/rwCrMEcHyf3HMmHb/images/webflow-add-code.png?fit=max&auto=format&n=rwCrMEcHyf3HMmHb&q=85&s=87dbc46de683f301a43b613ed07d7714" alt="Webflow Add Code Pn" width="1440" height="730" data-path="images/webflow-add-code.png" />
        </Frame>
      </Step>

      <Step title="Save changes">
        Any code added here will be applied to **all pages** of your Webflow project.

        <Frame>
          <img src="https://mintcdn.com/watermelon/rwCrMEcHyf3HMmHb/images/webflow-publish.png?fit=max&auto=format&n=rwCrMEcHyf3HMmHb&q=85&s=2fb3ac988874a8f5ac01aa97c6d6e2a8" alt="Webflow Publish Pn" width="1440" height="730" data-path="images/webflow-publish.png" />
        </Frame>
      </Step>
    </Steps>

    <Tip>
      If you don’t see the widget, double-check that you selected “All pages” in the Script Manager and that the full code was pasted correctly. And also check if the selected chat widget is set on "**Show on website**"
    </Tip>

    ### **Add the widget to a specific page (optional)**

    If you want to display the chat widget on just one page, follow these steps instead:

    <Steps>
      <Step title="Open the page settings">
        In the Webflow **Designer**, open the **Pages** tab from the left sidebar.

        <Frame>
          <img src="https://mintcdn.com/watermelon/rwCrMEcHyf3HMmHb/images/webflow-single-page-start.png?fit=max&auto=format&n=rwCrMEcHyf3HMmHb&q=85&s=1a04ea59ed6fcb91267fd51f49f13d99" alt="Webflow Single Page Start Pn" width="1440" height="730" data-path="images/webflow-single-page-start.png" />
        </Frame>

        Hover over the page name and click the **gear icon** to open **Page Settings**.

        <Frame>
          <img src="https://mintcdn.com/watermelon/rwCrMEcHyf3HMmHb/images/webflow-single-page-select-page.png?fit=max&auto=format&n=rwCrMEcHyf3HMmHb&q=85&s=8e86e39d5fc05fb0fce5136661551249" alt="Webflow Single Page Select Page Pn" width="1440" height="730" data-path="images/webflow-single-page-select-page.png" />
        </Frame>
      </Step>

      <Step title="Add custom code to the page">
        Scroll down to **Custom Code → Before  tag**. \
        Paste your Watermelon chat widget code inside this section

        <Frame>
          <img src="https://mintcdn.com/watermelon/rwCrMEcHyf3HMmHb/images/webflow-single-page-add-code.png?fit=max&auto=format&n=rwCrMEcHyf3HMmHb&q=85&s=0c63a7cbb3f9fdb580ef904221511f0a" alt="Webflow Single Page Add Code Pn" width="1440" height="730" data-path="images/webflow-single-page-add-code.png" />
        </Frame>

        <Tip>
          **Tip:** Just like before, make sure your code is wrapped inside `<script>` tags and do not include `<body>` tags.
        </Tip>
      </Step>

      <Step title="Save and publish">
        After adding the code, click **Save**.

        <Frame>
          <img src="https://mintcdn.com/watermelon/rwCrMEcHyf3HMmHb/images/webflow-single-page-save.png?fit=max&auto=format&n=rwCrMEcHyf3HMmHb&q=85&s=9721f84f33c7b2b7957aeb9c1dae4e8c" alt="Webflow Single Page Save Pn" width="1439" height="730" data-path="images/webflow-single-page-save.png" />
        </Frame>

        And lastly, **Publish** your project to make the chat widget live on your website.

        <Frame>
          <img src="https://mintcdn.com/watermelon/rwCrMEcHyf3HMmHb/images/webflow-single-page-publish.png?fit=max&auto=format&n=rwCrMEcHyf3HMmHb&q=85&s=4ef4d384ac5f20fa17ebff5e8b63b0c1" alt="Webflow Single Page Publish Pn" width="1440" height="730" data-path="images/webflow-single-page-publish.png" />
        </Frame>
      </Step>
    </Steps>
  </Tab>

  <Tab title="BigCommerce">
    ### **Add the widget to BigCommerce**

    Now that you have your chat widget code, follow the steps below to add it to your BigCommerce store.

    <Steps>
      <Step title="Open Script Manager">
        In your BigCommerce control panel, go to **Storefront → Script Manager**.

        <Frame>
          <img src="https://mintcdn.com/watermelon/37PRxBXQLR9ccUhb/images/bigcommerce-go-to-storefront.png?fit=max&auto=format&n=37PRxBXQLR9ccUhb&q=85&s=45aa0bf735763b86907f1e8be9db24cb" alt="Bigcommerce Go To Storefront Pn" width="1440" height="730" data-path="images/bigcommerce-go-to-storefront.png" />
        </Frame>
      </Step>

      <Step title="Create a new script">
        Click on **Create a Script**.

        <Frame>
          <img src="https://mintcdn.com/watermelon/37PRxBXQLR9ccUhb/images/bigcommerce-go-to-scriptmanager.png?fit=max&auto=format&n=37PRxBXQLR9ccUhb&q=85&s=07aa4074d4e0c5debe475e53872b39df" alt="Bigcommerce Go To Scriptmanager Pn" width="1440" height="730" data-path="images/bigcommerce-go-to-scriptmanager.png" />
        </Frame>
      </Step>

      <Step title="Enter script details">
        * **Name:** Watermelon Chat Widget
        * **Location on page:** Header (recommended), for faster page loads, you can also paste the script in the Footer.
        * **Select pages where script will be added:** All pages (or select a specific page you want the widget to show)
        * **Script type:** Script

        <Frame>
          <img src="https://mintcdn.com/watermelon/37PRxBXQLR9ccUhb/images/bigcommerce-in-script-manager-1.png?fit=max&auto=format&n=37PRxBXQLR9ccUhb&q=85&s=b88277160c632e1591b71dc26155abb5" alt="Bigcommerce In Script Manager 1 Pn" width="1440" height="730" data-path="images/bigcommerce-in-script-manager-1.png" />
        </Frame>
      </Step>

      <Step title="Paste your widget code">
        In the **Script contents** field, paste the chat widget code you copied from Watermelon.

        <Frame>
          <img src="https://mintcdn.com/watermelon/37PRxBXQLR9ccUhb/images/bigcommerce-in-script-manager-2.png?fit=max&auto=format&n=37PRxBXQLR9ccUhb&q=85&s=0dc83a5e9721a39781c09a6b040a637c" alt="Bigcommerce In Script Manager 2 Pn" width="1440" height="730" data-path="images/bigcommerce-in-script-manager-2.png" />
        </Frame>
      </Step>

      <Step title="Save your script">
        Click **Save** to apply your changes.
      </Step>

      <Step title="Verify installation">
        Visit your BigCommerce store and refresh the page. Your chat widget should now appear in the bottom corner of your website.
      </Step>
    </Steps>

    <Tip>
      If you don’t see the widget, double-check that you selected “All pages” in the Script Manager and that the full code was pasted correctly. And also check if the selected chat widget is set on "**Show on website**"
    </Tip>
  </Tab>

  <Tab title="Weebly">
    ### **Add the widget to Weebly website**

    Now that you have your chat widget code, follow the steps below to add it to your Weebly website.

    <Steps>
      <Step title="Open Settings">
        In your Weebly dashboard, click **Settings** in the left-hand menu.

        <Frame>
          <img src="https://mintcdn.com/watermelon/mN_HduCNBi_ZAFNF/images/weebly-select-settings.png?fit=max&auto=format&n=mN_HduCNBi_ZAFNF&q=85&s=9f6265005f1c2f1f35bef62b35fcb0c8" alt="Weebly Select Settings Pn" width="1439" height="726" data-path="images/weebly-select-settings.png" />
        </Frame>
      </Step>

      <Step title="Select Tracking Tools">
        Go to **Tracking Tools** in the settings menu.

        <Frame>
          <img src="https://mintcdn.com/watermelon/mN_HduCNBi_ZAFNF/images/weebly-settings-selected.png?fit=max&auto=format&n=mN_HduCNBi_ZAFNF&q=85&s=d9078669df0950d06405f1be3c0d73d1" alt="Weebly Settings Selected Pn" width="1440" height="730" data-path="images/weebly-settings-selected.png" />
        </Frame>
      </Step>

      <Step title="Add custom header code">
        Scroll down to **Add custom header code** and click **Add new code**.

        <Frame>
          <img src="https://mintcdn.com/watermelon/mN_HduCNBi_ZAFNF/images/weebly-tracking-tools-selected.png?fit=max&auto=format&n=mN_HduCNBi_ZAFNF&q=85&s=42f483dd6ccd380ddd92af7b500185b0" alt="Weebly Tracking Tools Selected Pn" width="1440" height="726" data-path="images/weebly-tracking-tools-selected.png" />
        </Frame>
      </Step>

      <Step title="Paste your chat widget code">
        Fill in a name — for example, **Watermelon Chat Widget**.\
        Paste your Watermelon chat widget script into the code box.

        Make sure  is selected under *Where would you like to place this code?* (this is selected by default).

        <Frame>
          <img src="https://mintcdn.com/watermelon/mN_HduCNBi_ZAFNF/images/weebly-add-new-code-selected.png?fit=max&auto=format&n=mN_HduCNBi_ZAFNF&q=85&s=a5bbfb24562ec136ca72669de1635560" alt="Weebly Add New Code Selected Pn" width="1439" height="725" data-path="images/weebly-add-new-code-selected.png" />
        </Frame>
      </Step>

      <Step title="Save changes and open your site">
        Click **Save**, then navigate to **Website → Edit Site**.

        <Frame>
          <img src="https://mintcdn.com/watermelon/mN_HduCNBi_ZAFNF/images/weebly-back-to-website.png?fit=max&auto=format&n=mN_HduCNBi_ZAFNF&q=85&s=2afeb707e4f0dce055620902d9dcb681" alt="Weebly Back To Website Pn" width="1440" height="724" data-path="images/weebly-back-to-website.png" />
        </Frame>
      </Step>

      <Step title="Publish your website">
        Click **Publish** to make the chat widget live on your website.

        <Frame>
          <img src="https://mintcdn.com/watermelon/mN_HduCNBi_ZAFNF/images/weebly-publish.png?fit=max&auto=format&n=mN_HduCNBi_ZAFNF&q=85&s=7993abfb5923100061cd81d4db982e21" alt="Weebly Publish Pn" width="1440" height="724" data-path="images/weebly-publish.png" />
        </Frame>

        <Tip>
          **Tip:** The widget won’t appear in preview mode — open your published site in a browser to see it active.
        </Tip>
      </Step>
    </Steps>

    <Tip>
      If you don’t see the widget, double-check if you have published your website. And also check if the selected chat widget is set on "**Show on website**"
    </Tip>

    If you only want your chat widget to appear on certain pages, follow these steps instead.If you only want your chat widget to appear on certain pages, follow these steps instead.If you only want your chat widget to appear on certain pages, follow these steps instead.
  </Tab>
</Tabs>

### **Installing the widget with Content Security Policy (CSP)**

If your website uses a Content Security Policy (CSP) that restricts external styles, you need to allow Watermelon’s widget styles.

The widget loads its CSS from:

```text theme={null}
https://chatwidget-css.web.app
```

Add this domain to your CSP:

* <Badge>style-src-elem</Badge> (recommended), or
* <Badge>style-src</Badge> if you’re not splitting directives

**Example**

```text theme={null}
Content-Security-Policy:
  style-src-elem 'self' https://chatwidget-css.web.app;
```

Without this, the widget may load without styling or will be blocked entirely.

### **Ask your developer to help (optional)**

If you’d prefer someone else from your team to take care of the installation, you can add them to Watermelon so they have direct access to the code. Alternatively, you can share the code and this documentation guide with a developer, they’ll be able to handle it from there.

## Installing the widget **for both visitors and logged-in users**

You can install the widget directly using our **NPM package**, which works with **any framework**. The package includes a script to embed the widget into your application.

Add Watermelon to your application using the following command in your terminal:

```text theme={null}
npm install watermelon-widget-injection --legacy-peer-deps
```

Get the variables from your system API response, localstorage or wherever you've saved them and pass them to the inject widget functionality. Example below

<Warning>
  user\_id is a required field to store conversation history accross devices and browsers
</Warning>

```typescript theme={null}
// ----- These are variables comming from your request ---- //
const first = response.me.first_name 
const last = response.me.last_name 
const email = response.me.email 
const phone = response.me.phone_number 
const userId = response.me.id.toString() // Required
```

To initialize Watermelon, copy and paste the code snippet into every page or a shared component where you want the Widget to appear. **Make sure to do this in your client-side code.**

```typescript theme={null}
import {injectWidget} from "watermelon-widget-injection"; in the component

// Initialize and assign variables first before passing them to the function

injectWidget(widgetId, settingsId, 'prod', first, last, email, phone, userId)
setTimeout(() => {
  const iframe = document.querySelector('.watermelon-embed-frame') as HTMLIFrameElement;
  iframe.contentWindow.postMessage(
   {
    type: 'login',
    payload: {
     first_name: first,
     last_name: last,
     email: email,
     phone: phone,
     user_id: userId,
    }
   },
   '*' // Security target origin
  );
}, 10000)
```

<Warning>
  The timeout is set to 10 seconds in this example. Replace with the duration that represents how long it takes before the user is logged in, in milliseconds
</Warning>

Click **Copy code** and paste it before the `</body>` tag on every page you want the Widget to appear on your app and/or website.

Then edit the code to send Watermelon the email address, name, or phone number of the user who is currently logged in.

After adding the code, open your app and the Widget will appear.

## Passing values for custom fields

In addition to the standard user attributes (first name, last name, email, phone and user ID), you can also pass **custom fields** to Watermelon. These fields allow you to attach additional information about the logged-in user.

Custom fields must first be created in your Watermelon dashboard before they can be sent from your application.

Once the fields exist, you can include them in the login payload when initializing the widget. Field names within the Watermelon application can be stored with spaces, uppercase and lowercase letters. And in the custom fields page there will also be displayed **internal name** which is how the name of field needs to be passed in the payload in order to map it correctly.

<Tip>
  For instance if the custom field in the Watermelon custom fields page is stored as 'Company Name', internal name would result in 'company\_name'
</Tip>

**Example: sending custom fields**

Below is a simple example showing how to pass custom fields along with the standard login payload. In order to pass the custom fields value, they need to be added to the initial `postMessage` payload and then sent to the iframe using a second `postMessage` call after the widget is initialized. Field values passed in that payload need to be of string value. If in your system the value is stored as a number or boolean, make sure to convert it to a string before sending it to Watermelon using methods like toString().

```ts theme={null}
const iframe = document.querySelector('.watermelon-embed-frame') as HTMLIFrameElement;

const companyName = 'Watermelon'
const yearOfEstablishment = 1998.toString() // example of value stored as a number in your system, but needs to be converted to string before sending to Watermelon
const companyField = 'Support'

const chatWidgetCustomFields = [
				{
				    name: "company_name",
				    value: companyName
				 },
				 {
                 	name: "year_of_establishment",
                 	value: yearOfEstablishment
                 },
				{
				    name: "company_field",
				    value: companyField
				},
			];

iframe.contentWindow.postMessage(
{
  type: 'login',
  payload: {
    first_name: first,
    last_name: last,
    email: email,
    phone: phone,
    user_id: userId,

    // Custom fields
    custom_fields: {
        company_name: chatWidgetCustomFields.companyName
        company_establishment: chatWidgetCustomFields.yearOfEstablishment,
        company_field: chatWidgetCustomFields.companyField

    }
  }
},
'*'
);
```

### **Shut down your user sessions on user logout**

This step should take place either right before or after the logout call — the order doesn’t matter.

Two postMessage calls are required:

1. The first one hides the widget from the top-level iframe.
2. The second one tells the iframe app to clear everything from local storage and reset its state, such as conversation ID and contact ID.

```typescript theme={null}
const iframe = document.querySelector('.watermelon-embed-frame') as HTMLIFrameElement;
window.postMessage(
  {
   type: 'logout',
   payload: {}
  },
  '*'
);
// @ts-ignore
iframe.contentWindow.postMessage(
  {
   type: 'logout'
  },
  '*'
);
```
