Installation
The Icodrip tracking SDK is lightweight (under 2KB gzipped) and loads asynchronously. It won't block page rendering.
Script Tag
The simplest way to install the SDK is to add the script tag directly to your HTML. Place it anywhere on the page — it loads asynchronously and won't block rendering.
<script src="https://icodrip.com/v1/ak.js" data-org="your-org-slug" async ></script>
npm Package
For bundler-based projects, install the npm package instead:
npm install @icodrip/js
Next.js
In a Next.js App Router project, use the next/script component with the afterInteractive strategy in your root layout:
import Script from "next/script";
export default function RootLayout({ children }) {
return (
<html>
<body>
{children}
<Script
src="https://icodrip.com/v1/ak.js"
data-org="your-org-slug"
strategy="afterInteractive"
/>
</body>
</html>
);
}React
In a React or Vite project, inject the script tag dynamically using a useEffect hook in your root component:
import { useEffect } from "react";
function App() {
useEffect(() => {
const script = document.createElement("script");
script.src = "https://icodrip.com/v1/ak.js";
script.dataset.key = "pk_live_xxxxxxxxxxxxx";
script.async = true;
document.body.appendChild(script);
}, []);
return <div>...</div>;
}Plain HTML
For a plain HTML site, add the script tag before the closing </body> tag:
<!DOCTYPE html>
<html>
<head>
<title>My SaaS</title>
</head>
<body>
<!-- Your content -->
<script
src="https://icodrip.com/v1/ak.js"
data-org="your-org-slug"
async
></script>
</body>
</html>