Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Update react.md

Kiran K1219e4532b38
diff --git a/apps/web/integration-guides/react.md b/apps/web/integration-guides/react.md
index 0cfceda753..9b0807d148 100644
--- a/apps/web/integration-guides/react.md
+++ b/apps/web/integration-guides/react.md
@@ -1,35 +1,20 @@
This quick start guide will show you how to get started with Dub Analytics on your website.
-## Step 1: Install package
+### Step 1: Install package
+
+Using the package manager of your choice, add the `@dub/analytics` to your project.
```bash
npm install @dub/analytics
```
-## Step 2: Initialize package in your code
+### Step 2: Initialize package in your code
If you are using a React framework, you can use the `<Analytics />` component to track conversions on your website.
E.g. if you're using Next.js, you can add the `<Analytics />` component to your root layout component or any other pages where you want to track conversions.
-```jsx
-import { Analytics as DubAnalytics } from '@dub/analytics/react';
-
-export default function RootLayout({
- children,
-}: Readonly<{
- children: React.ReactNode;
-}>) {
- return (
- <html lang="en">
- <body>{children}</body>
- <DubAnalytics />
- </html>
- );
-}
-```
-
-## Step 3: Set up client-side click tracking
+You will also need to set up the `domainsConfig.refer` property to enable client-side click-tracking.
```jsx
import { Analytics as DubAnalytics } from '@dub/analytics/react';