Overview
The Pierview tracking script records visits to your website so Traffic Analysis can show where they come from, including visits sent by ChatGPT, Perplexity, Claude and other AI assistants. It is a single line of JavaScript added to every page.Install the script
1
Create a tracking script
In Pierview, open Traffic Analysis. If you have no script yet, click Create your first script. Otherwise, click the settings (gear) icon to open Traffic Settings and click New script.You can limit the script to one domain, or leave the domain empty to allow any domain. Click Create script or press Enter.
2
Copy the code
The dialog shows your script. It looks like this, with your own tracking ID:You can show the code again at any time from Traffic Settings by clicking Show code next to the script.
3
Add it to your site
Paste the code into the
<head> section of every page, or just before the closing </body> tag. On WordPress, use your theme’s header settings or a header and footer code plugin. On other platforms, use the custom code or tracking code setting.Caching and optimization plugins
The script reads your tracking ID from its own address, the?id=pv_... part. Some caching and optimization plugins copy outside scripts to your own server to minify or combine them, and change the address to something like:
pierview-analytics.js from your plugin’s JavaScript optimizations, then clear its cache.
WP Rocket
WP Rocket
WP Rocket hosts outside scripts on your domain when Minify JavaScript files is on, which removes the tracking ID.
- In WordPress, go to Settings > WP Rocket > File Optimization.
- If Minify JavaScript files is on, add
pierview-analytics.jsto its Excluded JavaScript Files box. Use the file name, not thepierview.aidomain: once the file is minified it is served from your domain, so the domain no longer matches. - If Delay JavaScript execution is on, add
pierview-analytics.jsto its Excluded JavaScript Files box as well. - Click Save Changes, then clear the cache from the Dashboard tab.
LiteSpeed Cache
LiteSpeed Cache
- In WordPress, go to LiteSpeed Cache > Page Optimization > Tuning.
- Add
pierview-analytics.jsto JS Excludes and to JS Deferred / Delayed Excludes. - Save changes, then go to LiteSpeed Cache > Toolbox > Purge and click Purge All.
W3 Total Cache
W3 Total Cache
W3 Total Cache only minifies outside scripts that are listed under Include external files/libraries.
- In WordPress, go to Performance > Minify.
- If
pierview-analytics.jsis listed under Include external files/libraries, remove it. - Save settings, then click Purge All Caches.
Perfmatters
Perfmatters
- In WordPress, go to Settings > Perfmatters > JavaScript.
- If Delay JavaScript is on with Delay all scripts selected, add
pierview-analytics.jsto Excluded from Delay. If it delays only the scripts you list, make surepierview-analytics.jsis not in that list. - Click Save Changes and clear your page cache.
Other plugins
Other plugins
SiteGround Speed Optimizer, NitroPack, FlyingPress, WP-Optimize, Hummingbird and similar plugins have JavaScript or file optimization settings.
- Look for options to minify, combine, delay or defer JavaScript.
- Add
pierview-analytics.jsto the exclusion list of each one that is on. - Save changes and clear the plugin’s cache.
Autoptimize does not optimize scripts hosted on other domains, so it leaves the Pierview script alone and needs no changes.
Check that it works
1
Open your site as a visitor
Open a page on your site in a private or incognito window, so you are not logged in and you get the cached page your visitors see.
2
Find the script
View the page source and search for
pierview-analytics.js.3
Compare the address
The address should match the code from Pierview exactly, starting with
https://www.pierview.ai/ and ending with ?id= and your tracking ID. If it points to a file on your own domain, or the ?id= part is missing, a plugin is still rewriting the script. Recheck its exclusions and clear its cache again.Why Pierview and Google Analytics numbers differ
The two tools count differently, so their figures will not match even when both are working:- Pierview records a visit on every page load, and again each time a visitor returns to a tab they left open. Google Analytics groups a visitor’s activity into sessions.
- Pierview flags likely bots and shows them separately.
- Ad blockers and privacy settings can block either script.