To ensure Trackboxx records your visitors reliably, you need to add the tracking script to your website. You only need to do this once; after that, Trackboxx automatically tracks every page view.
Where should the tracking script go?
Add the script to the header of your website , between<head> and </head>.
This ensures that all pages on your website are tracked .
Get your personal tracking code
A pop-up will then appear with your personal tracking code.
- Log in to the Trackboxx dashboard.
- Add a new website (name + URL).
- A pop-up will then appear with your personal tracking code.
Here is an example of what the code looks like:
<script>
(function(d, s, id, w, f){
w[f] = w[f] || function() {
(w[f].q = w[f].q || []).push(arguments)
};
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)){ return; }
js = d.createElement(s); js.id = id;
js.onload = function(){
// remote script has loaded
};
js.async = true;
js.src = "https://cdn.trackboxx.info/p/tracker.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', trackboxx-script', window, trackboxx'));
trackboxx('set', siteId', 'TB-66377283');
trackboxx(trackPageview');
</script>Code language: HTML, XML (xml)
Important: This is only an example. You will find your personal code in the dashboard after clicking Add website.
Once the code is installed, Trackboxx starts tracking visits to your website.
Add the tracking script to WordPress
WordPress offers several ways to add the code to your site's header. The best method depends on your setup, theme, and technical experience.
1. header.php (manual integration)
You can add the code directly to your theme's header.php file.
Important: use a child theme, otherwise the code will be overwritten during the next update.
2. Code fields in the theme settings
Many modern themes include a field for adding code to the header, usually in the theme options or Customizer.
This is common in page-builder themes such as Avada, Divi, and Enfold.
3. Hooks and theme integrations
Some themes and frameworks provide hooksthat let you add code cleanly to the header, often without editing a file directly.
Check your theme's documentation for the correct hook.
4. Add the script with a plugin
Many plugins are designed to add tracking and header scripts to WordPress.
Simply search for:
"WordPress Header Script Plugin" or "WordPress Tracking Script Plugin".
If you want to use e-commerce tracking with WooCommerce, for example, we recommend a plugin because it handles the additional setup more easily.
