Integrations

WordPress

Add Logspot analytics to a WordPress site by inserting the tracking script in the page header.

Logspot installs on WordPress by adding one script to your site's <head>. You can do this with a header-scripts plugin (no code) or in your theme.

Option A — Header-Scripts Plugin (No Code)

Install a plugin such as WPCode or Insert Headers and Footers, then paste this into the Header section:

<script
  src="https://cdn.logspot.io/lg.js"
  data-logspot-pk="YOUR_PUBLIC_KEY"
></script>

Find your public key in Project settings. Save — pageviews are captured automatically across your whole site.

Option B — Theme (functions.php)

If you maintain a custom or child theme, enqueue the script via the wp_head hook:

// functions.php
add_action('wp_head', function () {
  ?>
  <script
    src="https://cdn.logspot.io/lg.js"
    data-logspot-pk="YOUR_PUBLIC_KEY"
  ></script>
  <?php
});

Use a child theme so a theme update doesn't overwrite your change.

Track Custom Events (Optional)

Once the script has loaded, window.Logspot is available. For example, track a click on a custom button:

<button onclick="window.Logspot && window.Logspot.track({ event: 'CtaClicked' })">
  Get started
</button>

Or add the lgspt- class convention and Logspot captures the click automatically:

<button class="lgspt-get-started">Get started</button>
<!-- fires a "Get Started" event -->

WooCommerce

WooCommerce purchase events fire on the order-received page. Add a tracking snippet there (via your header-scripts plugin's per-page rules or a WooCommerce hook) calling window.Logspot.track({ event: 'OrderCompleted', metadata: { ... } }). For accurate revenue, send the purchase server-side via the Track API with your secret key.

Verify It's Working

Visit your site, then open the Logspot dashboard — pageviews and events appear within seconds.