IntegrationsWordpress

WordPress Plugin

WordPress and WooCommerce plugin for easy analytics integration

WordPress Plugin

The @entro314labs/entrolytics-wp plugin provides seamless analytics integration for WordPress and WooCommerce sites with WooCommerce support.

Installation

Download Plugin

Download the latest release from GitHub.

Upload to WordPress

  1. Go to Plugins → Add New → Upload Plugin
  2. Choose the downloaded ZIP file
  3. Click Install Now
  4. Click Activate Plugin

Configure Settings

  1. Go to Settings → Entrolytics
  2. Enter your Website ID
  3. (Optional) Enter custom host for self-hosted instances
  4. Click Save Changes

Configuration

Basic Settings

Go to Settings → Entrolytics in your WordPress admin:

SettingDescription
Website IDYour Entrolytics website ID (required)
Custom HostCustom analytics host (optional, for self-hosted)
Track AdminEnable tracking for logged-in administrators
Track Logged-in UsersTrack authenticated users

Advanced Settings

SettingDescription
Exclude PathsComma-separated list of paths to exclude
Track Outbound LinksAutomatically track external link clicks
Track File DownloadsTrack PDF, ZIP, and other file downloads
Enable WooCommerceTrack e-commerce events

WooCommerce Integration

WooCommerce integration requires WooCommerce 8.0+ to be installed and activated.

When enabled, the plugin automatically tracks:

  • Product views
  • Add to cart events
  • Checkout started
  • Purchases (with revenue tracking)
  • Category browsing

Tracked Events

EventDescriptionData Tracked
product_viewUser views a productProduct ID, name, price, category
add_to_cartUser adds item to cartProduct ID, quantity, price
checkout_startedUser initiates checkoutCart total, item count
purchaseOrder completedRevenue, currency, order ID, products
category_viewUser browses categoryCategory name, product count

Custom Tracking

PHP Functions

Track custom events in your theme or plugins:

<?php

// Track custom event
if (function_exists('entrolytics_track')) {
    entrolytics_track('button_click', [
        'button_id' => 'hero-cta',
        'page' => get_the_title()
    ]);
}

// Identify user
if (function_exists('entrolytics_identify') && is_user_logged_in()) {
    $user = wp_get_current_user();
    entrolytics_identify($user->ID, [
        'email' => $user->user_email,
        'username' => $user->user_login,
        'role' => implode(',', $user->roles)
    ]);
}

// Track page view (manually)
if (function_exists('entrolytics_page_view')) {
    entrolytics_page_view([
        'url' => $_SERVER['REQUEST_URI'],
        'title' => get_the_title()
    ]);
}

Shortcodes

Track events with shortcodes:

<!-- Track button click -->
[entrolytics_track event="download_brochure" data='{"format":"pdf"}']
  Download Brochure
[/entrolytics_track]

<!-- Conditional tracking -->
<?php if (is_user_logged_in()): ?>
[entrolytics_track event="member_only_view"]
  Member Content
[/entrolytics_track]
<?php endif; ?>

JavaScript API

Track events from JavaScript:

// Track event
if (window.entrolytics) {
  window.entrolytics.track('video_play', {
    video_id: 'intro-video',
    duration: 120
  })
}

// Identify user
if (window.entrolytics && wpData.userId) {
  window.entrolytics.identify(wpData.userId, {
    membershipLevel: 'premium'
  })
}

Hooks and Filters

Privacy & GDPR

The plugin is GDPR-compliant and includes:

  • Cookie less tracking by default
  • Option to respect Do Not Track
  • Option to anonymize IP addresses
  • No personal data stored locally
  • Easy integration with consent management plugins
<?php

// Only track after consent
add_filter('entrolytics_should_track', function($should_track) {
    // Check your consent plugin
    if (!function_exists('has_analytics_consent')) {
        return $should_track;
    }

    return has_analytics_consent();
});

Multisite Support

The plugin is multisite-compatible:

  • Network-wide activation supported
  • Per-site configuration
  • Centralized settings for network admin
  • Individual website IDs per site

Troubleshooting

Requirements

  • WordPress >= 5.8
  • PHP >= 8.1
  • WooCommerce >= 8.0 (optional, for eCommerce tracking)

Features

  • ✅ Automatic page view tracking
  • ✅ WooCommerce integration
  • ✅ Custom event tracking via PHP/JavaScript
  • ✅ Shortcode support
  • ✅ Hooks and filters for customization
  • ✅ GDPR-compliant
  • ✅ Multisite support
  • ✅ Zero configuration for basic setup

Support