Get started

Check out the demo version

Step 1 - Log In to Your Account and Add the Website Domain

Step 2 - Set Up Analytics

Install via Package Manager
npm
yarn
pnpm
bun
npm i onedollarstats

Once installed, initialize analytics in your app entry file:

import { configure } from "onedollarstats";

configure({
  // track events on localhost for local development
  trackLocalhostAs: "mydomain.com",
});

See integration examples:

Or Include via CDN

Insert snippet inside your site’s <head> … </head> tags:

<script
  defer
  src="https://assets.onedollarstats.com/stonks.js"
  data-debug="mydomain.com" 
></script>

Analytics automatically tracks page views. If you want to send them manually or track custom events, see how to send page views manually and how to send events.

Step 3 – Verify Analytics Integration

Depending on your integration method, you can use the trackLocalhostAs property (for the npm package) or the data-debug attribute (for the script) to send events locally.

1. Set up your domain: Make sure to specify your website domain correctly and double-check for typos.

2. Open your site locally: Launch your site in a local environment. Open the browser’s developer tools and switch to the Console tab.

3. Check for the installation message: If the script is connected properly, you’ll see a confirmation message in the console. From this point on, all events sent locally will also appear in the console. Note that logs are visible only during local development and when dev mode is enabled (trackLocalHostAs in the NPM package configuration or data-debug for the CDN script).

4. Verify events on the dashboard: Go to onedollarstats.com/analytics and select your site. To see events sent locally, enable Dev Mode using the toggle in the top-right corner. You can read more about how Dev Mode works here.

5. Understand event propagation: After sending an event locally, it may take 5-10 seconds for the event to appear on the dashboard.

6. Deploy confidently: If you see the events appearing on your dashboard, your analytics integration is working correctly. You can now deploy your site with analytics and disable Dev Mode.

Tip: Dev Mode is a safe way to test your analytics before going live. It ensures all your local events are tracked without affecting your production data.

Visit Installation & Setup guide for more configuration options.

Feel free to reach out if you have any questions or need help!

We’re here to help you get your analytics running smoothly. Don’t hesitate to contact us — whether it’s a small question or a tricky issue, we’ve got your back.