Installation guides
Webflow
Paste the ProductLense script into the site-wide Head code in Webflow site settings, then publish to your domain.
In Webflow, site-wide custom code goes in Site settings → Custom code → Head code. It is added to every published page. Custom code requires a Webflow site plan that allows it, and it runs only on the published site, not in the Designer.
Add the script
- Copy your site id from Settings → Sites in the ProductLense dashboard.
- In Webflow, open Site settings → Custom code.
- Paste the snippet into Head code, replacing
SITE_ID, and save. - Publish to your domain.
<script>window.productlense=window.productlense||function(){(window.productlense.q=window.productlense.q||[]).push(arguments)}</script>
<script defer data-site="SITE_ID" src="https://api.productlense.app/a.js"></script>Add both your custom domain and the webflow.io staging domain to the site's hostnames in ProductLense if you want to see traffic from both; events from a hostname that is not listed are rejected.
Custom events
Count form submissions as events from the page's custom code (Page settings → Before </body> tag):
<script>
document.addEventListener('submit', (e) => {
if (e.target.matches('form')) {
window.productlense('event', 'Signup', { form: e.target.getAttribute('data-name') || 'form' });
}
}, true);
</script>Then add Signup as a goal in the dashboard. See custom events and goals and funnels.
If your product's signup happens in your own app after a Webflow marketing site, call identify there, not on Webflow; see identify users.
Verify your installation
- Publish, then open the published site in a normal browser window.
- Open the Live page in the ProductLense dashboard. Your visit appears within a few seconds.
- In the browser's developer tools, the Network tab shows a
POSTtohttps://api.productlense.app/api/ewith status204.
The Designer preview does not run custom code. Ad blockers in your own browser may block the request. If the visit does not appear, follow Verify your installation.