Troubleshooting issues with your Field Testing installation
- Script not inserted correctly
- Script altered or removed
- Content Security Policy (CSP)
- Low sample rate
- Ad blockers
1. Script not inserted correctly
- The script was added after the closing
</head>tag, causing it not to load properly.
- The script was added in the wrong file, such as a template file or a footer file.
<head> section of the site's main HTML file, such as
index.html. Refer to the Field testing installation guide for specific instructions.
2. Script altered or removed
- The script code was accidentally modified or deleted while editing other parts of the site.
- An update to the site's theme or CMS replaced the file containing the script.
3. Content Security Policy (CSP)
Content Security Policy (CSP) is a security feature that helps prevent cross-site scripting (XSS) and other code injection attacks by specifying which sources of content are allowed to be loaded by the browser.
- Your website's current CSP does not allow the script to be loaded or executed.
- Your CSP does not allow the script to send data back to the PageVitals platforms.
Review and update your website's Content Security Policy to include
connect-src. Here's an example of how to add the correct CSP headers to your website:
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' cdn.pgvt.io; connect-src 'self' in.pgvt.io">
4. Low sample rate
5. Ad blockers
- The PageVitals Field Testing script is flagged as tracking by ad blockers.
- Certain privacy extensions prevent user data collection.
While it's difficult to bypass ad blockers and privacy extensions, you can monitor the impact of these blockers on your field data by comparing it with other metrics, such as server-side monitoring data or analytics data from different providers.