Scalar DevelopersScalar Developers
User Guide
API Reference
FAQs
User Guide
API Reference
FAQs
  • Getting started

    • User Guide
    • Getting Started
  • Scalar Script

    • Installing the Script
    • Identifying Users
  • Managing content

    • Managing Ideas
    • Managing Announcements
    • Managing Surveys
  • Configuration

    • Team Management
    • Customising Topics
    • User Segments
    • Subscription Plans
  • API integrations

    • Generating API Keys
    • Setting Up Webhooks
    • Syncing Customers
    • Submitting Feedback

Installing the script

The Scalar script enables surveys and widgets on your website. Follow these steps to install it.


Step 1: Copy the embed code

  1. Go to Settings > Scalar Script (in the API & Integrations section)
  2. Click Copy to copy the embed script to your clipboard

The script looks like this:

<script src="https://your-workspace.scalar.co.za/widget-loader.js"></script>
<script>
  window.ScalarWidget.init({
    companySlug: 'your-company',
    testToken: 'abc123...'
  });
</script>

Step 2: Add to your website

Paste the script into your website's HTML, just before the closing </body> tag:

<!DOCTYPE html>
<html>
<head>
    <title>Your Website</title>
</head>
<body>
    <!-- Your website content -->
    
    <!-- Scalar Script - place before closing body tag -->
    <script src="https://your-workspace.scalar.co.za/widget-loader.js"></script>
    <script>
      window.ScalarWidget.init({
        companySlug: 'your-company',
        testToken: 'abc123...'
      });
    </script>
</body>
</html>

Step 3: Verify installation

  1. Return to Settings > Scalar Script
  2. Click Check status
  3. Visit your website in a browser to trigger the connection test
  4. Return to Settings and click Check status again

If successful, you'll see "Script installed" with a green badge.


Installing via Google Tag Manager

If you use Google Tag Manager (GTM):

  1. Log in to your GTM account
  2. Create a new Custom HTML tag
  3. Paste the Scalar embed script
  4. Set the trigger to All Pages
  5. Save and publish your container

See the Google Tag Manager installation guide for detailed instructions.


Troubleshooting

Script not detected

If the script status shows "Script not installed":

  1. Check placement: Make sure the script is before the closing </body> tag
  2. Check for typos: Verify the script was pasted correctly without modifications
  3. Clear cache: Try a hard refresh (Ctrl+Shift+R or Cmd+Shift+R)
  4. Check console: Open browser developer tools and look for JavaScript errors
  5. Disable blockers: Some ad blockers or privacy extensions may block the script

Surveys not appearing

If surveys aren't showing:

  1. Check publish status: Make sure the survey is published
  2. Check targeting: Verify the survey's page location settings match your page
  3. Check display rules: Review "show once" settings; the survey may have already been shown
  4. Check timing: If using a trigger delay, wait for the specified time

Security notes

  • The script loads from your unique workspace URL
  • Connection is always over HTTPS
  • User data is isolated to your company
  • The test token is only used for verifying installation

Next steps

Once the script is installed, you can:

  • Identify users for personalised surveys and segmentation
  • Create surveys that appear on your website
  • Configure widget display settings in survey options
Last Updated: 19/02/2026, 05:48
Contributors: Tlotlego Mogapi
Next
Identifying Users