Installation

99dev analytics can be installed via CDN with a specified version or without or via npm.

CDN Versioned

Most Secure

To maxinimize your visitors’ cybersecurity, utilize the versioned CDN and include the integrity hash.

index.html
<script
  src="https://cdn.99.dev/@2.0.0/analytics.js"
  data-site-uuid="<your-site-id>"
  integrity="sha384-NoU4DOKt3zmHPuuv7oLMR5oHuVTJH8NCjfwAdUIWJ0yXUd9CAMu0b2l+yAJoeU14"
  crossorigin="anonymous"
  async
></script>

CDN Latest

Alternatively, you can omit the version and integrity attriubute to ensure you’re always using the latest tracking snippet without needing to update your script.

index.html
<script
  src="https://cdn.99.dev/analytics.js"
  data-site-uuid="<your-site-id>"
  async
></script>

NPM Installation

Best Performance

For developers already utilizing npm, you can install 99dev analytics with the following command:

terminal
npm install --save @99devco/analytics

This package includes built JS for direct inclusion via <script> tag in CMS’s and traditional websites, as well as modules and Typescript for use in Javascript / Typescript apps.


ES Modules (ESM)
main.ts
import * as analytics from "@99devco/analytics"

analytics.init("your-site-id-goes-here")

CommonJS (CJS)
main.js
const analytics = require("@99devco/analytics")

analytics.init("your-site-id-goes-here")

The init(…) functions accepts a number of parameters, but requires only the Site ID and will automatically record a page view, though this behavior can be configured. To learn about SPA usages and more, continue reading here.