Adding ZapDigits Tracking Script to a WordPress Website
If you want to integrate ZapDigits tracking into your WordPress site, you’ll need to add the tracking script to your theme. Since WordPress doesn’t use next/script
like Next.js, we’ll insert the script directly into your site’s <head>
or via a plugin.
✅ Option 1: Add via functions.php
You can enqueue the ZapDigits tracking script by adding the following code to your theme’s functions.php
file:
function add_zapdigits_tracking() { ?> <script src="https://www.zapdigits.com/script/track.js" data-site-id="{replace_with_your_site_id}"></script> <?php } add_action('wp_head', 'add_zapdigits_tracking');
This will automatically insert the script into the <head>
section of every page on your WordPress site.
✅ Option 2: Add via Theme Settings or Customizer
Some WordPress themes (like Astra, GeneratePress, or Divi) allow you to add custom scripts directly from the Customizer or Theme Settings panel.
- Log in to your WordPress admin panel.
- Go to Appearance → Customize → Additional Scripts (or your theme’s equivalent).
- Paste the following snippet:
<script src="https://www.zapdigits.com/script/track.js" data-site-id="{replace_with_your_site_id}"></script>
✅ Option 3: Use a Plugin (No Code Needed)
If you don’t want to edit theme files, use a plugin like Insert Headers and Footers or Code Snippets:
- Install and activate the plugin.
- Navigate to Settings → Insert Headers and Footers.
- Paste the tracking code into the Scripts in Header section:
<script src="https://www.zapdigits.com/script/track.js" data-site-id="{replace_with_your_site_id}"></script>
- Save changes — the script will now be loaded site-wide.
🚀 Summary
- Developers → Add it in
functions.php
(Option 1). - Non-developers → Use your theme’s Customizer or a plugin (Options 2 & 3).
- Replace
{replace_with_your_site_id}
with your actual site ID from ZapDigits. - Once added, ZapDigits will start tracking visitors across your WordPress site.