WordPress
Inject the snippet globally so tours run on every template that exposes your selectors.
Option A — Theme functions.php
Add this to your theme's functions.php (child theme recommended). Replace YOUR_SCRIPT_KEY with your TourKit script key.
function add_tourkit_script() {
wp_enqueue_script(
'tourkit',
'https://cdn.jsdelivr.net/gh/webdev-raj/Tourkit@sdk-v11/sdk/dist/tourkit.min.js
',
array(),
null,
true
);
add_filter('script_loader_tag', function($tag, $handle) {
if ($handle === 'tourkit') {
return str_replace(
'<script',
'<script data-key="YOUR_SCRIPT_KEY" data-api="https://tourkit-phi.vercel.app"',
$tag
);
}
return $tag;
}, 10, 2);
}
add_action('wp_enqueue_scripts', 'add_tourkit_script');Option B — Header / Footer plugin
Paste the script tag directly in your site footer using a header/footer injection plugin (for example "Insert Headers and Footers").
<script
src="https://cdn.jsdelivr.net/gh/webdev-raj/Tourkit@sdk-v11/sdk/dist/tourkit.min.js"
data-key="YOUR_SCRIPT_KEY"
data-api="https://tourkit-phi.vercel.app"
async>
</script>Typical approaches
- Theme footer — edit
footer.phpif you control the theme. - Plugin — enqueue from
functions.phpas above.