Installation
Different ways to install Zero Trust Analytics on your website
Standard Installation
Add this script to your HTML, just before the closing </head> tag:
<script defer data-site-id="YOUR_SITE_ID" src="https://ztas.io/js/analytics.js"></script>
The defer attribute ensures the script doesn’t block page rendering.
WordPress
Option 1: Theme Header
Add the script to your theme’s header.php file, just before </head>:
<script defer data-site-id="YOUR_SITE_ID" src="https://ztas.io/js/analytics.js"></script>
</head>
Option 2: Plugin
Use a plugin like “Insert Headers and Footers” to add the script without editing theme files.
Shopify
- Go to Online Store > Themes > Edit Code
- Open
theme.liquid - Add the script just before
</head>
Squarespace
- Go to Settings > Advanced > Code Injection
- Paste the script in the Header section
Wix
- Go to Settings > Tracking & Analytics
- Click + New Tool > Custom
- Paste the script and set it to load in the Head
Next.js
// pages/_app.js or app/layout.js
import Script from 'next/script'
export default function App({ Component, pageProps }) {
return (
<>
<Script
defer
data-site-id="YOUR_SITE_ID"
src="https://ztas.io/js/analytics.js"
strategy="afterInteractive"
/>
<Component {...pageProps} />
</>
)
}
Gatsby
// gatsby-browser.js
export const onClientEntry = () => {
const script = document.createElement('script')
script.defer = true
script.dataset.siteId = 'YOUR_SITE_ID'
script.src = 'https://ztas.io/js/analytics.js'
document.head.appendChild(script)
}
Hugo
Add to your layouts/partials/head.html:
<script defer data-site-id="YOUR_SITE_ID" src="https://ztas.io/js/analytics.js"></script>
Verifying Installation
After adding the script:
- Open your website in a new browser tab
- Open your Zero Trust Analytics dashboard
- You should see your pageview within seconds
If you don’t see data, check:
- The Site ID matches your registered domain
- The script is loading (check browser Network tab)
- No ad blockers are interfering