Add Logiwolf to WordPress: with a plugin or a child theme

The Logiwolf pixel is one line of code in the HTML head. In WordPress you add it with the WPCode plugin or through the functions.php of a child theme, for classic themes and block themes alike.

Updated on · Reading time: approx. 5 minutes

In short

The quickest way is the WPCode plugin: paste the snippet into the header field, save, clear the cache. If you do not want another plugin, add it to the functions.php of a child theme. Both work with block themes too, because WordPress still calls wp_head() there.

Before you start

You need a Logiwolf account, your website added in the dashboard and the pixel ID that Logiwolf then shows you. The snippet looks like this:

Logiwolf snippet
<!-- Pixel Code - Logiwolf -->
<script defer src="https://app.logiwolf.com/pixel/YOUR-PIXEL-ID"></script>
<!-- END Pixel Code -->

Replace YOUR-PIXEL-ID with your own ID. The general steps for every platform are in the installation guide.

Option 1: with the WPCode plugin

WPCode used to be called «Insert Headers and Footers» and prints code in the <head> of every page. According to the plugin directory it runs on more than three million websites.

  1. 1

    Install the plugin

    Search the plugin directory for WPCode, install the plugin and activate it.

  2. 2

    Open the header field

    Go to «Code Snippets», then «Header & Footer». The plugin page calls the top field «Scripts in Header».

  3. 3

    Paste the snippet

    Paste the whole snippet including the <script> tags into the «Header» field. According to WPCode, code without its tags shows up as plain text on your page.

  4. 4

    Save and clear the cache

    Click «Save Changes» at the top right. If you use a caching plugin, clear its cache afterwards.

If you only need the basic feature, you can switch WPCode to «Headers & Footers» mode in its settings. The header field works the same way there.

Option 2: through a child theme

Without a plugin, you extend the functions.php of a child theme. The wp_head hook prints code in the head of every page:

functions.php
// functions.php in a child theme
add_action('wp_head', function () {
  echo '<script defer src="https://app.logiwolf.com/pixel/YOUR-PIXEL-ID"></script>';
});

A child theme is its own folder in wp-content/themes. Its style.css needs a Template header that matches the folder name of the parent theme exactly. You activate it under «Appearance», then «Themes». The child theme's functions.php loads in addition to the parent's, so do not copy parent code into it.

Do not edit your theme files directly. WordPress points out that such edits are lost with the next theme update. If you prefer wp_enqueue_script(): since WordPress 6.3 the function takes an array with 'strategy' => 'defer' as its fifth parameter.

Block themes and Full Site Editing

Block themes such as the current default themes have no header.php. That is not a problem: WordPress renders them through template-canvas.php, which still calls wp_head(). WPCode and the child theme code therefore work exactly as on classic themes.

Clear the cache and check delayed JavaScript

Caching plugins serve stored copies of your pages. Until you clear the cache, those copies lack the new code.

  • WP Rocket: «Settings», then «WP Rocket», and on the dashboard «Clear and preload cache». The option is also in the WP Rocket toolbar menu.
  • LiteSpeed Cache: «LiteSpeed Cache», then «Toolbox», «Purge» and «Purge All».
  • WP Super Cache: «Settings», then «WP Super Cache», and delete the cache there.

With WP Rocket, watch the «Delay JavaScript execution» option in the «File Optimization» tab. It holds back every script until the visitor scrolls, clicks or taps. The pixel then starts too late, and visits without any interaction are missing from your statistics. Add app.logiwolf.com/pixel to «Excluded JavaScript Files».

Check the installation

  1. 1

    Open it logged out

    Open your website in a private window, so you see the page the way your visitors do.

  2. 2

    Search the source

    Search the page source for app.logiwolf.com/pixel. If it is missing, an old cache is usually still active.

  3. 3

    See yourself live

    You show up as a live visitor in the Logiwolf dashboard within seconds. If the request to app.logiwolf.com only appears in the developer tools after you scroll, a JavaScript delay feature is active.

Tracking that WordPress plugins bring along

While you install Logiwolf, check which other plugins already collect data. According to Jetpack, Jetpack Stats is activated by default and records, among other things, IP address, user agent, URLs, referrer, browser language and country. Automattic keeps the IP logs for 28 days. You can switch the module off under «Jetpack», then «My Jetpack», «Help» and «All Jetpack modules».

Site Kit by Google places the Google Analytics, Tag Manager and AdSense snippets. Google states that site owners are responsible for managing notice and consent themselves. If you want to drop Google Analytics completely, the guide Replace Google Analytics walks you through it.

Logiwolf sets no cookies. What belongs in your privacy policy depends on which tools run on your website. The legal framework for Switzerland and the EU is explained in the guide to privacy-friendly web analytics.

Other platforms: there are also guides for Shopify, Wix and Webflow.

Sources: WPCode, Global Header and Footer, WPCode in the plugin directory, WordPress Developer, wp_head, WordPress Developer, wp_enqueue_script, WordPress Developer, Child Themes, WordPress, template-canvas.php, WP Rocket, Clear cache, WP Rocket, Delay JavaScript execution, LiteSpeed Cache, Toolbox, WP Super Cache, Jetpack Stats, Site Kit, GDPR compliance and privacy. As of October 2026.

Frequently asked questions

WordPress: frequently asked questions

Do I need a plugin to add Logiwolf to WordPress?
No. A plugin like WPCode is the easiest way. Without a plugin, you add the code through the wp_head hook in the functions.php of a child theme.
Does Logiwolf work with block themes?
Yes. Block themes also call wp_head() through template-canvas.php, so WPCode and the child theme code work as usual.
Why do I see no visitors after installing it?
Usually the caching plugin still serves the old page. Clear the cache and open the website in a private window. Also check whether WP Rocket or another plugin delays JavaScript, and exclude the pixel from it.
Does the pixel slow down my WordPress site?
The pixel loads with defer, so it does not block rendering, and it is about 2 KB compressed.
Can I run Jetpack Stats and Logiwolf side by side?
Technically yes, they run independently. Two tools mean two data flows, though, and both belong in your privacy policy. Many people switch Jetpack Stats off once Logiwolf is running.
Free up to 2,000 pageviews · no credit card

Logiwolf on your WordPress site.

One snippet, no cookies, hosted in Switzerland. Heatmaps and replays in every plan.