VEXO /Documentation
Get Started

Web Integration

Quickstart

  1. Create a Vexo account here (skip if you already have one).

  2. Create a Web App:

    • On your dashboard click on + Add Application create a new app.
    • Enter a name (e.g. your website)
    • Add the domain of your website (e.g., example.com)
  3. Add the Vexo Script

To start collecting Web analytics data, paste the following script into your site’s <head> tag:

<script src="https://www.vexo.co/analytics.js" defer></script>

Next.js Integration

For Next.js applications, use the Script component with the afterInteractive strategy to ensure optimal loading performance. Add this to your _app.js or _app.tsx file:

import Script from 'next/script'

export default function MyApp({ Component, pageProps }) {
  return (
    <>
      <Script 
        src="https://www.vexo.co/analytics.js" 
        strategy="afterInteractive" 
      />
      <Component {...pageProps} />
    </>
  )
}

The afterInteractive strategy ensures that analytics scripts load after the page becomes interactive, which is the recommended approach for third-party analytics according to the Next.js Script Optimization documentation.

  1. Track custom events and identify devices (optional)

You can enhance your analytics by tracking custom events and identifying devices:

  • Custom Event
global?.vexo?.customEvent('purchased-completed', { amount: 24.99 });
  • Identify device
global?.vexo?.identifyDevice('user@example.com');

That’s it! Once the script is live on your site, Vexo will start capturing user sessions, session replays, custom events, and more — just like it does on mobile.

Previous
Introduction
Next
Features Overview