Add PerchLens to any WordPress site via theme functions or a header plugin.
Search the plugin directory for 'Insert Headers and Footers' (by WPBeginner) or 'WPCode'. Both let you add scripts without touching theme files.
In the plugin's settings, find the 'Scripts in Header' field and paste the tracking script.
<script defer src="https://perchlens.com/cv.js" data-site="{SITE_ID}"></script>If you prefer not to install a plugin, hook into wp_head from your child theme.
<?php
add_action('wp_head', function() {
echo '<script defer src="https://perchlens.com/cv.js" data-site="{SITE_ID}"></script>';
});Visit your site once, then check the PerchLens dashboard. Realtime visitors should update within a few seconds.
{SITE_ID} in the snippets above with your actual tracking ID. You'll find it in Settings → Tracking after creating a site.Use a child theme — never edit the parent theme's functions.php directly. If you're locked out, edit via FTP/SSH and revert.
Exclude the PerchLens script from minification in your caching plugin's settings. Pageviews still track correctly — it's only the page that's cached.
Create a free account to get your tracking ID — takes about 30 seconds.
“Set it up in 30 seconds. Replaced two paid tools.”
— Indie maker on X
“Finally, analytics I actually look at every day.”
— SaaS founder
“My users appreciate no cookie banner. I appreciate the simplicity.”
— Agency developer
Join thousands of makers who track their sites with clarity, not complexity. Free forever for up to 3 sites.