Viso.li

Embedding Reference

Track visitors on your website by embedding a simple script. You can gather analytics about your audience, even if they don't click the shortened link.

How it works

The embed script runs on your website and sends a ping to viso.li servers. This ping is associated with a specific link slug and your account via a public key. This allows viso.li to record visits to your page as if they were clicks on the shortened link, providing you with unified analytics.

Usage

You can include the script simply in your HTML or depending on your framework, use the appropriate component for example Next.js Script component.

1<script
2 async
3 src="https://viso.li/embed/ping.v1.js"
4 data-target="https://viso.li"
5 data-slug="YOUR_SLUG"
6 data-public-key="pk_embed_..."
7></script>

Configuration

The script requires the following data attributes:

  • data-slug: The slug of the shortened link you want to associate with this page.
  • data-public-key: Your public embed key. This starts with pk_embed_. You can find this in your dashboard when generating an embed code.
  • data-target: The base URL of the service (e.g., https://viso.li).

Security & Constraints

To prevent abuse and ensure accurate analytics, the embed script includes security checks.

Privacy Considerations

When using the embed script, you are collecting data about your visitors. Depending on your jurisdiction (e.g., GDPR in Europe, CCPA in California), you may be required to disclose this in your privacy policy.

We recommend informing your users that you use third-party analytics to improve their experience.