Install The Little Ask on your website

One small script per site, added through your HTML, Google Tag Manager or WordPress. You only do this once.

Last reviewed

What you'll do

You add one script to every page of your site. After that, all surveys are managed from your dashboard - publishing or changing a campaign never needs a new install.

The script loads asynchronously and never blocks your page. It also follows page changes on single-page sites without a reload.

Get your snippet

  1. Open Sites and choose your site.
  2. In the Install panel, copy the snippet. It contains your own site ID.

It looks like this. YOUR-SITE-ID is a placeholder - always copy your personal snippet from the dashboard.

Example snippet
<script>
  (function(w,d,s,n){w[n]=w[n]||function(){(w[n].q=w[n].q||[]).push(arguments)};
  var j=d.createElement('script');j.async=1;j.src=s;d.head.appendChild(j)})(window,document,'https://thelittleask.com/sdk/littleask.js','littleask');
  littleask('init',{site:'YOUR-SITE-ID'});
</script>

HTML websites

Paste the snippet just before the closing </head> tag, on every page. If your pages share a template or layout file, add it there once.

Google Tag Manager

  1. In Google Tag Manager, create a new tag of type Custom HTML.
  2. Paste the snippet.
  3. Set the trigger to All Pages - or behind your consent trigger if you use one.
  4. Save, then publish the container.

Google Tag Manager only loads the script. It doesn't decide where inline surveys appear - those need a placement box in your page.

WordPress

Paste the snippet into your theme's header, or into the header and footer script tool your site already uses. There is no official plugin.

Optional: form events

For reliable form-abandonment targeting, a developer can send form events. Only event names and a form ID are used - never what visitors type.

Example event
littleask.track('form_submitted', { formId: 'lead-form' });

The full list of events is under the Form events tab in the Install panel. Without code, you can instead set a form CSS selector in a campaign's Audience step.

Check that it works

  1. Open any page of your website.
  2. Back in the dashboard, open the site. The badge changes to "Script seen".
  3. The Health panel on the same page shows whether surveys are being shown and answered.

You can also choose Open test page in the Install panel to try your campaigns without touching your site.

Common problems

  • Still "Waiting for first page load": the snippet isn't on the page yet, the GTM container isn't published, or consent hasn't been given.
  • Works on one domain but not another: add the missing domain under Allowed domains.
  • Two copies of the script: harmless - it only runs once.

More troubleshooting →