Two methods available: using a plugin or adding custom code.
<!-- tokwork Widget -->
<script async src="https://js.tokwork.com/loader.js"
data-website-id="YOUR_WEBSITE_ID"
data-website-domain="yourdomain.com">
</script>
Add to your theme's functions.php:
function tokwork_widget_script() {
?>
<script async src="https://js.tokwork.com/loader.js"
data-website-id="YOUR_WEBSITE_ID"
data-website-domain="yourdomain.com">
</script>
<?php
}
add_action('wp_footer', 'tokwork_widget_script');
functions.php may be lost during theme updates. Use a child theme or plugin method instead.If you're using a child theme, add to functions.php in your child theme:
<?php
// Add tokwork widget
function tokwork_widget_script() {
?>
<script async src="https://js.tokwork.com/loader.js"
data-website-id="YOUR_WEBSITE_ID"
data-website-domain="yourdomain.com">
</script>
<?php
}
add_action('wp_footer', 'tokwork_widget_script', 100);
?>
function tokwork_widget() {
echo '<script async src="https://js.tokwork.com/loader.js"
data-website-id="YOUR_WEBSITE_ID"
data-website-domain="yourdomain.com">
</script>';
}
add_action('wp_footer', 'tokwork_widget');
tokwork works automatically with WooCommerce. No special configuration needed!
The widget will appear on:
✅ tokwork Widget loaded successfullyTo load only on specific pages:
function tokwork_widget_conditional() {
// Only load on posts
if (is_single()) {
?>
<script async src="https://js.tokwork.com/loader.js"
data-website-id="YOUR_WEBSITE_ID"
data-website-domain="yourdomain.com">
</script>
<?php
}
}
add_action('wp_footer', 'tokwork_widget_conditional');
Examples:
is_home() - Homepage onlyis_page() - Pages onlyis_single() - Posts onlyis_product() - WooCommerce products only