Documentation

Integration in WordPress & co.

Add the snippet in WordPress, Shopify, TYPO3, Next.js, Nuxt, Laravel and static sites.

The snippet

After creating a website under Live data, you receive an embed code:

<script src="https://turbometrics.io/tm.min.js" data-site-id="YOUR_SITE_KEY" async></script>

This script has to be in the <head> of every page that should be measured. The async attribute makes sure it does not affect load time.

WordPress

Install the turbometrics plugin straight from the WordPress directory. It embeds the tracking script automatically on all pages, optionally excludes administrators from tracking and shows Core Web Vitals as well as all 5 metrics in a WordPress dashboard widget.

  1. In WordPress, go to Plugins > Add new and search for turbometrics
  2. Click Install now, then Activate
  3. Enter your site key under Settings > turbometrics

Option 2: functions.php

Add the following code to the functions.php of your child theme:

add_action('wp_head', function () {
    echo '<script src="https://turbometrics.io/tm.min.js" data-site-id="YOUR_SITE_KEY" async></script>';
}, 1);

The 1 as the priority makes sure the script is loaded early in the <head>.

Option 3: the "Insert Headers and Footers" plugin

  1. Install the WPCode plugin (formerly "Insert Headers and Footers")
  2. Go to Code Snippets > Header & Footer
  3. Paste the script tag into the Header field
  4. Save

Option 4: theme settings

Many WordPress themes offer a field for header scripts under Appearance > Customizer > Additional CSS/JS or in the theme options. Add the snippet code there.

Option 5: the wp_head hook via a plugin

If you use a plugin of your own:

<?php
/**
 * Plugin Name: turbometrics Live-Daten
 */
add_action('wp_head', function () {
    echo '<script src="https://turbometrics.io/tm.min.js" data-site-id="YOUR_SITE_KEY" async></script>';
}, 1);

Save it as turbometrics.php in the wp-content/plugins/ directory and activate the plugin.

Shopify

  1. Go to Online Store > Themes > Actions > Edit code
  2. Open theme.liquid
  3. Add the script tag directly before </head>
  4. Save

TYPO3

Via TypoScript:

page.headerData.99 = TEXT
page.headerData.99.value = <script src="https://turbometrics.io/tm.min.js" data-site-id="YOUR_SITE_KEY" async></script>

Static websites / HTML

Add the script tag directly into the <head> of your HTML files:

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>My site</title>
    <script src="https://turbometrics.io/tm.min.js" data-site-id="YOUR_SITE_KEY" async></script>
</head>

Next.js / React

In _app.tsx or layout.tsx:

import Script from 'next/script'

export default function Layout({ children }) {
    return (
        <html>
            <head>
                <Script
                    src="https://turbometrics.io/tm.min.js"
                    data-site-id="YOUR_SITE_KEY"
                    strategy="afterInteractive"
                />
            </head>
            <body>{children}</body>
        </html>
    )
}

Nuxt / Vue

In nuxt.config.ts:

export default defineNuxtConfig({
    app: {
        head: {
            script: [
                { src: 'https://turbometrics.io/tm.min.js', 'data-site-id': 'YOUR_SITE_KEY', async: true }
            ]
        }
    }
})

Laravel

In your Blade layout (e.g. layouts/app.blade.php):

<head>
    ...
    <script src="https://turbometrics.io/tm.min.js" data-site-id="YOUR_SITE_KEY" async></script>
</head>

Google Tag Manager

  1. Create a new tag: Custom HTML
  2. Paste the HTML:
<script src="https://turbometrics.io/tm.min.js" data-site-id="YOUR_SITE_KEY" async></script>
  1. Trigger: All Pages (or specific pages)
  2. Publish

Note: integration via Tag Manager can lead to the script being executed only after the initial load. As a result, individual metrics (above all FCP and LCP) can be missing on some page views. Embedding directly in the <head> is therefore more accurate.

Checking that it works

After embedding:

  1. Open your website in a normal browser (not incognito with ad blockers)
  2. Navigate through a few pages
  3. Go to Live data in turbometrics — the first measurements should appear after 1–2 minutes

If no data arrives:

  • Check the browser console for errors
  • Make sure the data-site-id value is correct
  • Check whether ad blockers or content security policies are blocking the script

Further reading