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.

add sample guides

Kiran K2c1af6274deb
diff --git a/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/guide-list.tsx b/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/guide-list.tsx
index dd32c55a66..6134f9a992 100644
--- a/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/guide-list.tsx
+++ b/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/guide-list.tsx
@@ -8,7 +8,7 @@ import Link from "next/link";
import { useRouter } from "next/navigation";
import { useState } from "react";
import { toast } from "sonner";
-import { guides } from "./constants";
+import { guides } from "./integration-guides";
import { IntegrationType } from "./types";
export function GuideList() {
diff --git a/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/constants.ts b/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/integration-guides.ts
similarity index 79%
rename from apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/constants.ts
rename to apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/integration-guides.ts
index cae23a6bc7..9ab6b36561 100644
--- a/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/constants.ts
+++ b/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/integration-guides.ts
@@ -1,16 +1,24 @@
import { Shopify } from "@/ui/layout/sidebar/conversions/icons/shopify";
import { Code, Framer, Globe } from "lucide-react";
+
import { IntegrationGuide } from "./types";
export const guides: IntegrationGuide[] = [
+ {
+ type: "no-code",
+ key: "webflow",
+ title: "Webflow",
+ description: "How to add @dub/analytics to your Webflow site",
+ shortDescription: "Dub Analytics",
+ icon: Globe,
+ },
{
type: "no-code",
key: "framer",
title: "Framer",
- description: "How to add @dub/analytics to your Webflow site",
+ description: "How to add @dub/analytics to your Framer site",
shortDescription: "Dub Analytics",
icon: Framer,
- recommended: true,
},
{
type: "no-code",
@@ -21,17 +29,17 @@ export const guides: IntegrationGuide[] = [
icon: Shopify,
},
{
- type: "no-code",
- key: "webflow",
- title: "Webflow",
- description: "How to add @dub/analytics to your Webflow site",
+ type: "code",
+ key: "wordpress",
+ title: "WordPress",
+ description: "Dub Analytics",
shortDescription: "Dub Analytics",
- icon: Globe,
+ icon: Code,
},
{
type: "code",
- key: "wordpress",
- title: "WordPress",
+ key: "react",
+ title: "React",
description: "Dub Analytics",
shortDescription: "Dub Analytics",
icon: Code,
diff --git a/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/page-client.tsx b/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/page-client.tsx
index 2e7da11d79..e3ae0fad53 100644
--- a/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/page-client.tsx
+++ b/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/page-client.tsx
@@ -2,7 +2,7 @@
import { useSearchParams } from "next/navigation";
import { useEffect, useState } from "react";
-import { guides } from "./constants";
+import { guides } from "./integration-guides";
import { Guide } from "./guide";
import { GuideList } from "./guide-list";
import { IntegrationGuide } from "./types";
diff --git a/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/page.tsx b/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/page.tsx
index da9e65b846..3148612ffb 100644
--- a/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/page.tsx
+++ b/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/page.tsx
@@ -2,7 +2,7 @@ import { readFileSync } from "fs";
import { notFound } from "next/navigation";
import { join } from "path";
import { StepPage } from "../step-page";
-import { guides } from "./constants";
+import { guides } from "./integration-guides";
import { PageClient } from "./page-client";
import { IntegrationGuide } from "./types";
diff --git a/apps/web/markdown/framer.md b/apps/web/markdown/framer.md
new file mode 100644
index 0000000000..31284f822e
--- /dev/null
+++ b/apps/web/markdown/framer.md
@@ -0,0 +1,16 @@
+Follow these steps to add `@dub/analytics` script to your Framer site:
+
+- Go to your Framer project and open the **Project Settings** menu.
+- Open the **General** tab and scroll down to the **Custom Code** section.
+- Paste the Dub analytics script in the **Start of head tag** section.
+- Click on the **Save** button to save the changes.
+
+```html
+<script
+ src="https://www.dubcdn.com/analytics/script.js"
+ defer
+ data-domains='{"refer":"yourcompany.link"}'
+></script>
+```
+
+Read the [client-side click-tracking guide](https://dub.co/docs/sdks/client-side/features/client-side-click-tracking) for more information.
diff --git a/apps/web/markdown/react.md b/apps/web/markdown/react.md
new file mode 100644
index 0000000000..0cfceda753
--- /dev/null
+++ b/apps/web/markdown/react.md
@@ -0,0 +1,53 @@
+This quick start guide will show you how to get started with Dub Analytics on your website.
+
+## Step 1: Install package
+
+```bash
+npm install @dub/analytics
+```
+
+## 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
+
+```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 domainsConfig={{
+ refer: "yourcompany.link"
+ }} />
+ </html>
+ );
+}
+```
+
+Read the [client-side click-tracking guide](https://dub.co/docs/sdks/client-side/features/client-side-click-tracking) for more information.
diff --git a/apps/web/markdown/webflow.md b/apps/web/markdown/webflow.md
index e5378044b2..8bd3248492 100644
--- a/apps/web/markdown/webflow.md
+++ b/apps/web/markdown/webflow.md
@@ -1,9 +1,7 @@
Follow these steps to add `@dub/analytics` script to your Webflow site:
- On your project's page, click on the **Webflow logo** in the left-hand side menu and choose **Project Settings**.
-
- Choose **[Custom Code](https://university.webflow.com/lesson/custom-code-in-the-head-and-body-tags?topics=site-settings)** from the menu and paste the Dub analytics script in the **Head Code** section.
-
- Click on the **Save Changes** button and then **Publish** your changes.
```html