Installation guides
Carrd
Add ProductLense to a Carrd site with an Embed element set to Code and placed in the head; embeds need a Carrd Pro plan.
Carrd adds custom code through Embed elements. An embed placed in the head runs on the whole site. Embeds need a Carrd Pro plan.
Add the script
- In the Carrd editor, add an element and choose Embed.
- Set Type to Code and Style to Hidden, then set its placement to Head.
- Paste the two tags below into Code. Replace
SITE_IDwith the id from Settings → Sites in the ProductLense dashboard. - Publish the site.
<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>Carrd sections linked with # change only the hash, which ProductLense does not record as a new page, so a one-page Carrd site shows one pageview per visit. Add your domain, and the .carrd.co address if visitors use it, to the site's hostnames in the ProductLense dashboard.
Custom events
To count a button press, add a second hidden Code embed placed at the end of the body:
<script>
document.querySelector('#buttons01 a')?.addEventListener('click', () => {
window.productlense('event', 'Signup clicked');
});
</script>Use the element id Carrd shows in the element's settings. See custom events for naming rules.
Verify your installation
- Publish, then open the live 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.
Ad blockers in your own browser may block the request. If the visit does not appear, follow Verify your installation.