Install guides
The snippets do not change from platform to platform. Only where you paste them does.
The snippets themselves live on the Analytics install and Lead forms pages. Each guide below says where they go on that platform.
WordPress
Any theme, no code edits to the theme itself.
- Analytics: install a header-and-footer code plugin (for example WPCode), paste the Analytics line into the site-wide header area, and save. It loads on every page.
- Form: add a Custom HTML block where the form should appear and paste the Forms example. It posts straight to Second Shift, no form plugin needed.
- If your form plugin will not let you change where it posts, use the Custom HTML block version, or the one-line embed from your dashboard under Settings, Developer tools.
- Optional: paste the captcha snippet right after your form to add Turnstile spam protection.
Elementor
Works in the free version too.
- Analytics with Elementor Pro: go to Custom Code, add the Analytics line once, and set it to run on the entire site. Without Pro, a free header-and-footer plugin does the same job.
- Form: add an HTML widget where the form belongs and paste the Forms example. It is plain HTML and JavaScript, so the free version handles it as-is.
- Optional: add the captcha snippet in an HTML widget right after the form for Turnstile spam protection.
Next.js
App Router, the way this site is built. Add the tracker with next/script in your root layout. For forms, post the same JSON as the Forms example from your submit handler, on the server or the client: CORS is open, so a browser fetch works as-is.
app/layout.tsx
import Script from "next/script";
<Script
src="https://forms.secondshift.site/t.js"
data-client="YOUR_CLIENT_ID"
strategy="afterInteractive"
/>Plain HTML
Static sites and everything else.
- Paste the Analytics line right before the closing body tag on every page, or once in your shared header or footer include.
- The Forms example is complete as-is. Keep your own styling; the field names are what matter.
- Optional: the captcha snippet goes right after the form, same page.