Installation
Ready to start tracking? This guide shows you how to add Tiny Metricsto your website in just a few minutes.
Prerequisites
Before you begin, make sure you have:
- A Tiny Metrics account (you can create one here)
- Access to your website's source code
- Basic knowledge of HTML and JavaScript
Vanilla HTML
The easiest way to get started is by adding our script directly to your HTML. Just copy this code and paste it in your website's <head> section.
Installation Snippet
Example Implementation
Next.js Integration
For Next.js, use the built-in Script component for best performance. Add this code to your layout file to load the script before your page becomes interactive:
layout.tsx (or .jsx) depending on your needs and the version of Next.js you are using.WordPress Installation
For WordPress, it's the same basic idea as plain HTML. Edit your theme's header.php file and add our script in the header section:
If you are unsure how to edit your theme, check out this tutorial.
Verification
After adding the script, test it out:
- Go to your website
- Click around to a few different pages
- Check your Tiny Metrics dashboard
You should see data show up right away.
Troubleshooting
Running into trouble? Here are some common issues and how to fix them:
No Data Showing Up
If your dashboard is empty:
- Check your browser console for error messages
- Make sure the script is in the
<head>section - Check if your site blocks the script (Content Security Policy)
- Clear your browser cache and refresh
- If using Cloudflare, make sure it's not serving a cached version
Script Won't Load
If the script isn't working:
- Check if your browser, network, or firewall blocks the script
- Double-check for typos in your code
Still Stuck?
Need more help? Email usand we'll sort it out.