Platform Integrations
Step-by-step guides for adding Invoker Analytics to popular CMS platforms, website builders and static site generators.
Looking for Framework Guides?
Your tracking snippet
Every integration below uses the same one-line snippet. Replace YOUR_SITE_ID with the 8-character Site ID shown in your dashboard under Site → Settings → Tracking code. The Site ID identifies the site in your account — it is not your domain name.
<script defer src="https://cdn.invoker.app/script.js" data-site="YOUR_SITE_ID"></script>
Optional attributes (such as data-spa, data-honor-dnt or data-included-domains) are listed in the Tracking Script reference.
WordPress
Method 1: Using a header plugin (recommended)
- Install and activate a header-code plugin such as "WPCode" or "Insert Headers and Footers"
- Open the plugin's header settings
- Paste the tracking snippet into the "Header" section and save
Method 2: Add it from your (child) theme's functions.php
<?php
// functions.php (child theme) or a small custom plugin
define('INVOKER_SITE_ID', 'YOUR_SITE_ID');
add_action('wp_head', function () {
// Skip logged-in admins/editors if you don't want to track yourself
if (is_user_logged_in() && current_user_can('edit_posts')) {
return;
}
printf(
'<script defer src="https://cdn.invoker.app/script.js" data-site="%s"></script>' . "\n",
esc_attr(INVOKER_SITE_ID)
);
});Shopify
- In your Shopify admin go to Online Store → Themes
- Click … → Edit code on your live theme
- Open
layout/theme.liquid - Paste the snippet just before
</head>and save:
{%- comment -%} layout/theme.liquid {%- endcomment -%}
<script defer src="https://cdn.invoker.app/script.js" data-site="YOUR_SITE_ID"></script>
</head>The checkout pages are controlled by Shopify and do not load theme code. To record purchases, use revenue tracking on your order-status page if your plan allows custom scripts there.
Webflow
- Open your Webflow project
- Go to Site settings → Custom code
- Paste the snippet in the Head code field
- Save and publish your site
Squarespace
- Go to Settings → Advanced → Code Injection (on newer dashboards: Website → Website Tools → Code Injection)
- Paste the snippet in the Header field
- Save your changes
Wix
- In your Wix dashboard open Settings → Custom Code (under "Advanced")
- Click + Add Custom Code and paste the snippet
- Set Add Code to Pages to All pages (load once) and placement to Head
- Apply and publish
Wix sites navigate without full page reloads, so add data-spa="history" to the snippet to record every page change.
Ghost
- In Ghost admin go to Settings → Code injection
- Paste the snippet in Site Header
- Save
Framer
- Open Site Settings → General → Custom Code
- Paste the snippet in the End of <head> tag field
- Add
data-spa="history"— Framer sites use client-side navigation - Publish your site
Carrd
- Edit your Carrd site (custom code requires a Pro plan)
- Add an Embed element, type Code, placement Head
- Paste the snippet and publish
Hugo
Store the Site ID in your site config:
# hugo.toml [params] invokerSiteId = "YOUR_SITE_ID"
Then add this to layouts/partials/head.html (or layouts/_default/baseof.html) before </head>:
{{ if hugo.IsProduction }}
<script defer src="https://cdn.invoker.app/script.js" data-site="{{ site.Params.invokerSiteId }}"></script>
{{ end }}The condition keeps the script out of local hugo server previews.
Jekyll
# _config.yml invoker_site_id: YOUR_SITE_ID
<!-- _includes/head.html -->
{% if jekyll.environment == "production" %}
<script defer src="https://cdn.invoker.app/script.js" data-site="{{ site.invoker_site_id }}"></script>
{% endif %}Build with JEKYLL_ENV=production bundle exec jekyll build to include it.
Astro
---
// src/components/Analytics.astro
const siteId = import.meta.env.PUBLIC_INVOKER_SITE_ID
---
{import.meta.env.PROD && siteId && (
<script is:inline defer src="https://cdn.invoker.app/script.js" data-site={siteId}></script>
)}Use is:inline so Astro doesn't bundle the external script. Include <Analytics /> in the <head> of your base layout. If you use Astro View Transitions, add data-spa="history".
Laravel (Blade)
// config/services.php
'invoker' => [
'site_id' => env('INVOKER_SITE_ID'),
],{{-- resources/views/layouts/app.blade.php, inside <head> --}}
@production
@if (config('services.invoker.site_id'))
<script defer src="https://cdn.invoker.app/script.js" data-site="{{ config('services.invoker.site_id') }}"></script>
@endif
@endproductionUsing Livewire wire:navigate or Inertia? Add data-spa="history".
Google Tag Manager
- In your GTM container create a new tag of type Custom HTML
- Paste the snippet
- Set the trigger to Initialization – All Pages (or All Pages)
- Save, then Submit and publish the container
<head>.Other platforms
The installation is the same for any website:
- Find where your platform lets you add custom HTML to the
<head> - Paste the snippet with your Site ID
- If the site navigates without full page reloads, add
data-spa="history"(or"hash"for hash-based routing) - Publish and check the Realtime view in your dashboard