Skip to content
Richard Kent Gates edited this page Mar 6, 2026 · 1 revision

Usage

Admin Pages

Page Menu Path Purpose
Head Scripts Scriptomatic → Head Scripts Inline JS + external URLs injected in <head>; includes Activity Log
Footer Scripts Scriptomatic → Footer Scripts Inline JS + external URLs injected before </body>; includes Activity Log
JS Files (Pro) Scriptomatic → JS Files Create, edit, and delete managed .js files; each has Head/Footer toggle, load conditions, CodeMirror editor, and Activity Log panel
Preferences Scriptomatic → Preferences Activity log limit, save confirmation, uninstall retention, API controls, email opt-ins, Preferences Action History

Basic Setup

  1. Navigate to Scriptomatic → Head Scripts or Footer Scripts
  2. Enter your JavaScript in the CodeMirror editor — do not include <script> tags, they are added automatically
  3. Optionally add remote URLs in the External Script URLs section; they load before the inline block as <script src> tags
  4. Optionally configure Load Conditions (Pro) to restrict injection to specific pages, post types, URL patterns, login state, dates, or months
  5. Click Save Head Scripts (or Save Footer Scripts)
  6. Check your page source to confirm the script is injected in the correct location

CodeMirror Editor

The inline script editor and JS Files editor both use CodeMirror:

  • Line numbers and bracket matching
  • WordPress/jQuery-specific Ctrl-Space autocomplete hints
  • Falls back to a plain <textarea> when syntax highlighting is disabled in your WordPress profile (Users → Profile → Syntax Highlighting)

External Script URLs

Each location has an External Script URLs section:

  • Add remote <script src="..."> URLs (HTTP/HTTPS only)
  • Scripts load in the order listed, before the inline block
  • Each URL has its own independent Load Conditions (Pro)
  • The URL list has its own revision history and Restore button, independent of the inline script history

Important Notes

  • Do not include <script> tags — they are stripped automatically
  • Scripts inject on pages matching the configured Load Conditions (defaults to all pages)
  • Revision history is maintained per-location (head and footer independently)
  • The inline script history and the URL list history are separate — restoring one never touches the other
  • Use the Help tab (top-right of any Scriptomatic admin page) for contextual documentation

Examples

Google Analytics

// Google Analytics 4
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-XXXXXXXXXX');

Add https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX to External Script URLs (Head).

Facebook Pixel

!function(f,b,e,v,n,t,s)
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];
s.parentNode.insertBefore(t,s)}(window, document,'script',
'https://connect.facebook.net/en_US/fbevents.js');
fbq('init', 'YOUR_PIXEL_ID');
fbq('track', 'PageView');

Custom jQuery

jQuery(document).ready(function($) {
    // Your code here
    $('.my-element').on('click', function() {
        console.log('clicked');
    });
});

Home

Clone this wiki locally