NudgeDocs

Install on WordPress

Add the Nudge snippet to every page of your WordPress site, with a code-insertion plugin or in your theme.

What you need

  • Your Nudge snippet (see where to copy it).
  • An administrator account on your WordPress site.

In Nudge, copy the snippet from Agents › Website Agent › On your site › Copy the snippet, or from Settings › Integrations › Website › WordPress.

<script src="https://app.asknudge.ai/widget/loader.js"
  data-org="your-workspace"
  data-form="your-form" async></script>

Choose a method

A plugin that inserts code in the header or footer of every page is the safest choice: the snippet survives theme updates and theme changes. Any plugin of this kind works, for example WPCode (formerly "Insert Headers and Footers").

  1. In your WordPress admin, go to Plugins › Add New, search for the plugin, install it and activate it.
  2. Open the plugin's header and footer settings (with WPCode: Code Snippets › Header & Footer).
  3. Paste the snippet in the Footer box. The Header box works too.
  4. Save.

Then open a page of your site and, in Nudge, click Re-check installation. See Verify the installation.

Inline mode

If your form uses the Inline embed display mode, keep the script in the header or footer as above, and add a Custom HTML block to the page where the form must appear, with:

<div data-nudge-embed></div>

Add the booking form

On your Contact page, add a Custom HTML block and paste the tag Nudge gives you for the booking form. The site-wide script must stay: it is what displays the form. See Booking form.

Caching and optimization plugins

Performance plugins can change how scripts load. If the widget is slow to appear or does not appear at all:

  • Delay JavaScript options (load scripts only after the first click or scroll) delay the widget too. Exclude app.asknudge.ai/widget/loader.js from the delay.
  • Combine or minify JavaScript options must leave external scripts alone. Exclude the Nudge loader if your plugin merges it.
  • After changing the snippet or these options, clear the cache of the plugin and of your host or CDN, otherwise visitors keep the old pages.

Troubleshooting

On this page