The easiest way to add Modovisa to WordPress is our official plugin. Paste your Tracking Token into the plugin settings and you’re done. Admin pages (wp-admin) are automatically excluded from tracking.
If your site can’t install plugins directly from the directory, download the plugin ZIP from WordPress.org and upload it in your dashboard.
modovisa-analytics.zip).header.phpGo to Appearance → Theme File Editor, open header.php, and paste this just before the closing </head> tag:
<script>
!function(){
var s=document.createElement("script");
s.src="https://cdn.modovisa.com/modovisa.min.js";
s.async=1;
s.dataset.token="YOUR_TRACKING_TOKEN";
document.head.appendChild(s);
}();
</script>
</head>
functions.php (optional)Add this to your theme’s functions.php to print the script in <head> without editing templates:
function add_modovisa_script_to_head() {
?>
<script>
!function(){
var s=document.createElement("script");
s.src="https://cdn.modovisa.com/modovisa.min.js";
s.async=1;
s.dataset.token="YOUR_TRACKING_TOKEN";
document.head.appendChild(s);
}();
</script>
<?php
}
add_action('wp_head', 'add_modovisa_script_to_head');
modovisa.min.js.