Using a plugin (recommended)
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.
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 yourfunctions.php:
functions.php
WooCommerce — specific pages only
To load the widget only on certain WooCommerce pages, use conditional tags infunctions.php:
functions.php
is_checkout() and is_cart() for any WordPress conditional tag to target the pages you need.