WordPress
Add privacy-first analytics to your WordPress site
WordPress Integration
Add Databuddy's privacy-first analytics to your WordPress site without slowing it down. No cookies, fully GDPR compliant, and 247x smaller than Google Analytics.
Installation Methods
Method 1: WordPress Plugin (Recommended)
The easiest way to add Databuddy to WordPress:
- Download the Databuddy WordPress Plugin
- Go to Plugins > Add New > Upload Plugin
- Upload and activate the plugin
- Go to Settings > Databuddy Analytics
- Enter your Site ID from your Databuddy dashboard
- Configure your tracking preferences
- Save changes
Method 2: Manual Header Installation
If you prefer manual installation:
- Get your tracking script from your Databuddy dashboard
- Go to Appearance > Theme Editor
- Select header.php
- Add your script before the closing
</head>
tag:
<script
src="https://app.databuddy.cc/databuddy.js"
data-site-id="YOUR_SITE_ID"
async
></script>
</head>
Method 3: Using a Plugin (Insert Headers and Footers)
For a safer approach without editing theme files:
- Install the "Insert Headers and Footers" plugin
- Go to Settings > Insert Headers and Footers
- Paste your Databuddy script in the "Scripts in Header" section
- Save settings
WordPress-Specific Features
WooCommerce Integration
Track e-commerce events automatically:
<script
src="https://app.databuddy.cc/databuddy.js"
data-site-id="YOUR_SITE_ID"
data-track-interactions="true"
data-track-ecommerce="true"
async
></script>
Contact Form Tracking
Track form submissions from popular WordPress form plugins:
<!-- Track Contact Form 7 submissions -->
<input type="hidden" data-track="form_submit" data-form-type="contact">
<!-- Track Gravity Forms submissions -->
<input type="hidden" data-track="form_submit" data-form-type="gravity">
Custom Post Type Tracking
Track views of custom post types:
// Add to your theme's functions.php
function databuddy_track_custom_post() {
if (is_singular('your_custom_post_type')) {
echo '<script>
databuddy("track", "custom_post_view", {
post_type: "' . get_post_type() . '",
post_id: ' . get_the_ID() . '
});
</script>';
}
}
add_action('wp_footer', 'databuddy_track_custom_post');
Configuration Options
Basic Setup
<script
src="https://app.databuddy.cc/databuddy.js"
data-site-id="YOUR_SITE_ID"
data-track-screen-views="true"
data-track-hash-changes="true"
async
></script>
Advanced Configuration
<script
src="https://app.databuddy.cc/databuddy.js"
data-site-id="YOUR_SITE_ID"
data-track-attributes="true"
data-track-outgoing-links="true"
data-track-performance="true"
data-track-web-vitals="true"
data-track-engagement="true"
data-track-scroll-depth="true"
async
></script>
WordPress Performance Benefits
- Faster Loading: Improves your WordPress Core Web Vitals scores
- Lower Bounce Rate: Better user experience leads to longer session times
- SEO Boost: Improved performance metrics help search rankings
- Resource Efficient: Minimal server load compared to other analytics solutions
Common WordPress Scenarios
Membership Sites
Track member engagement and content consumption:
<!-- Track premium content views -->
<button data-track="premium_content_view" data-content-type="video">
Watch Premium Video
</button>
Blog Sites
Track reading engagement and popular content:
<!-- Track article engagement -->
<article data-track="article_view" data-category="tutorials" data-author="john-doe">
<!-- article content -->
</article>
Business Sites
Track lead generation and conversions:
<!-- Track CTA clicks -->
<a href="/contact" data-track="cta_click" data-cta-type="contact">
Get Quote
</a>
Troubleshooting
Common Issues
Plugin Conflicts: If experiencing issues, temporarily deactivate other analytics plugins to identify conflicts.
Caching Issues: Clear your WordPress cache after installation (WP Rocket, W3 Total Cache, etc.).
Theme Issues: If manual installation doesn't work, ensure your theme includes wp_head()
in header.php.
Verification Steps
- Check browser console for "Databuddy initialized" message
- Visit your Databuddy dashboard after 2-3 minutes
- Use browser dev tools to verify script is loading
- Test in incognito mode to avoid cache issues
WordPress Multisite
For WordPress multisite networks:
- Install as a network plugin
- Configure each site individually with its own Site ID
- Use network admin settings for global configurations
Need help with your WordPress integration? Contact us at help@databuddy.cc.