Skip to main content
The easiest way to add the widget without editing theme files is with the Insert Headers and Footers plugin.
1

Install the plugin

In your WordPress admin, go to Plugins → Add New, search for Insert Headers and Footers, and click Install Now, then Activate.
2

Add the script

Go to Settings → Insert Headers and Footers. Paste the script into the Scripts in Footer field.
<script
  src="https://app.audyr.com/widget/widget.min.js"
  data-token="YOUR_TOKEN">
</script>
3

Save

Click Save. The widget will now appear on every page of your site.

Using functions.php

If you prefer to keep the widget inside your theme, add this to your functions.php:
functions.php
function audyr_widget_script() {
    echo '<script src="https://app.audyr.com/widget/widget.min.js" data-token="YOUR_TOKEN"></script>';
}
add_action( 'wp_footer', 'audyr_widget_script' );
Edit functions.php in a child theme. Changes to a parent theme’s files are overwritten whenever the theme updates.

WooCommerce — specific pages only

To load the widget only on certain WooCommerce pages, use conditional tags in functions.php:
functions.php
function audyr_widget_script() {
    if ( is_checkout() || is_cart() ) {
        echo '<script src="https://app.audyr.com/widget/widget.min.js" data-token="YOUR_TOKEN"></script>';
    }
}
add_action( 'wp_footer', 'audyr_widget_script' );
Swap is_checkout() and is_cart() for any WordPress conditional tag to target the pages you need.