On every plan, including Free

WordPress

WordPress surveys, no plugin to update.

UserLoop has no WordPress plugin to install. One script tag goes in your site's head, through a header code plugin or your theme, and every survey you publish shows from there.

Read the docs
Works on WordPress and WooCommerce. Sets no cookies.
13 KBon every page, gzipped
5ways to appear
6triggers

How do I add a survey to a WordPress site?

Create a website survey in UserLoop and copy its script tag. In WordPress, install a plugin that adds code to the head, such as WPCode, or open your theme's header settings. Add a new header snippet, paste the tag, and save it switched on for the whole site. Open any page, and UserLoop marks the survey Live once it sees your site. There is no UserLoop plugin to keep updated.

Where it goes
A header snippet, on for the whole site
UserLoop plugin
None. One script tag
WooCommerce
Works. Answers are not joined to orders
Plans
Free, Unlimited and Plus

Install

Three steps in WordPress admin

In UserLoop, open the survey's Launch stage, set Your site is built with to WordPress and copy the code. Then:

  1. 01

    Open a header code tool

    Install a plugin that adds code to the head, such as WPCode, or open your theme's header settings if your theme has them.

  2. 02

    Add a header snippet

    Create a new header snippet and paste the code. It is one script tag with your site key in it.

  3. 03

    Save it for the whole site

    Save the snippet switched on for the whole site, then open any page. Back in UserLoop, select I've added it. It checks for 5 minutes and turns the survey Live when it sees your site.

The snippet

What you paste into WordPress

Most sites use the first tab in a header code plugin. The second is for developers who would rather keep it in a child theme.

<script async src="https://cdn.userloop.io/sdk-3/userloop.js" data-site-key="YOUR_SITE_KEY"></script>
Add it once. A second copy on the same page does nothing, and your site key only works on the addresses you list.

On WordPress

What WordPress site owners ask about

Stores, members and caches are where a WordPress install differs from any other site.

WooCommerce

It works on WooCommerce, with one honest limit

WooCommerce pages are WordPress pages, so the same snippet covers the shop, the cart and the page shoppers see after paying. What UserLoop does not have is a WooCommerce plugin.

  • Target store pages by address. A Show on rule that contains order-received puts a question on the order received page of a default WooCommerce setup.

  • No order join. Answers arrive with the page and the visitor, not the WooCommerce order. Revenue per answer needs the Shopify integration.

  • Email after an order. On Plus, your own order events can start a survey email through the API.

Ask how customers found you

Members

Tell UserLoop who is logged in

On a membership site, a course site or a store with accounts, a few lines of PHP hand the logged-in user to the SDK, so answers arrive with a name behind them.

  • identify. Sends your user ID with each answer, and the email the answers belong to.

  • Every page load. The email is kept in memory only, never stored in the browser, so the snippet runs on each page.

  • Target by attribute. Pass a role or a membership level as an attribute, up to 50 of them, and show a survey only to the visitors it describes.

SDK for developers
functions.php
<?php
// functions.php in a child theme, or a code snippets plugin
add_action('wp_footer', function () {
  if (!is_user_logged_in()) {
    return;
  }
  $user = wp_get_current_user();
  ?>
  <script>
    (function () {
      function identify() {
        userloop.identify(<?php echo wp_json_encode((string) $user->ID); ?>, {
          email: <?php echo wp_json_encode($user->user_email); ?>
        });
      }
      // With the plain tag, userloop exists only once the script has loaded
      if (window.userloop && window.userloop.version) identify();
      else window.addEventListener("UserLoopReady", identify);
    })();
  </script>
  <?php
});
Use it only where your page cache does not store pages for logged-in visitors, or one member's details could be served to another.

Caches and themes

Know it is on the page, and still on the page

WordPress sites change under you: a cache serves yesterday's page, a new theme drops header code. UserLoop checks from real page loads and says what it found.

  • Clear the cache once. If a caching plugin serves saved pages, clear it after adding the snippet, then look for cdn.userloop.io in the page source.

  • No cache clear for survey edits. The snippet fetches your live surveys itself, so a change you publish in UserLoop reaches the site within 2 minutes.

  • Told when it goes missing. If UserLoop has not seen the snippet for 30 days, the dashboard says so and suggests checking it is still there.

Platform facts

UserLoop on WordPress, in one table

Where the code goes
A header snippet in a plugin that adds code to the head, such as WPCode, or your theme's header settings, switched on for the whole site
UserLoop plugin
None. There is nothing to install from the plugin directory and nothing to update
WordPress plan
Any WordPress site where you can install a plugin or edit header code. A hosted plan that blocks both cannot take the snippet
WooCommerce
Works on every store page. No WooCommerce plugin, and answers are not joined to orders
Page caches
Clear the cache after adding the snippet. Survey changes need no cache clear
Page weight
13 KB gzipped on every page, loaded asynchronously. A further 24 KB only when a survey shows
Consent
Sets no cookies. State is kept in the browser's local storage, and a developer can keep it in memory until consent is given

Once it is in

What to ask first on a WordPress site

The snippet shows any website survey you publish. These are the ones WordPress sites tend to start with.

Frequently asked questions

Is there a UserLoop survey plugin for WordPress?

No. UserLoop is added with one script tag in your site's head, pasted into a plugin that adds header code, such as WPCode, or into your theme's header settings. There is no UserLoop plugin to install or update.

Can I add a survey to WordPress without any plugin?

Yes, if your theme has header settings or you can edit a child theme. Paste the script tag there so it is on every page. A header code plugin is only the easier way to do the same thing.

Does it work with WooCommerce?

Yes. The snippet runs on every WooCommerce page and you target the cart or the order received page by its address. There is no WooCommerce plugin, and answers are not joined to WooCommerce orders.

Will the snippet slow my WordPress site down?

The loader is 13 KB gzipped and loads asynchronously. The code that draws a survey is a further 24 KB and is fetched only when a survey is about to show.

Can I show a survey on one page or post only?

Yes. On the survey's Targeting stage, add a Show on rule with the page's address, or part of it such as /blog/ for every post. Test a page tells you whether a given address would show the survey.

Does it work with a caching plugin?

Yes. Clear the page cache once after adding the snippet so saved pages include it. After that, survey changes reach the site within 2 minutes of publishing, with no cache clear.

Does it set cookies on my WordPress site?

No. The SDK sets no cookies. It keeps the visitor's state in local storage or session storage, or in memory only if a developer sets that option.

Is it free?

Website surveys are on every plan, including Free. Free allows 1 live survey with 3 questions and 50 responses a month. Unlimited is $19 a month with unlimited responses.

Keep reading

Paste one tag into WordPress, then publish surveys from UserLoop

Start on the Free plan: 1 live survey, 3 questions and 50 responses a month.