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.

settings/analytics → settings/tracking

Steven Tey4809ba682612
diff --git a/apps/web/app/(ee)/api/track/click/route.ts b/apps/web/app/(ee)/api/track/click/route.ts
index 466dcde5ea..e71a8f9b1d 100644
--- a/apps/web/app/(ee)/api/track/click/route.ts
+++ b/apps/web/app/(ee)/api/track/click/route.ts
@@ -135,7 +135,7 @@ export const POST = withAxiom(async (req) => {
if (!allowRequest) {
throw new DubApiError({
code: "forbidden",
- message: `Request origin '${getHostnameFromRequest(req)}' is not included in the allowed hostnames for this workspace. Update your allowed hostnames here: https://app.dub.co/settings/analytics`,
+ message: `Request origin '${getHostnameFromRequest(req)}' is not included in the allowed hostnames for this workspace. Update your allowed hostnames here: https://app.dub.co/settings/tracking`,
});
}
diff --git a/apps/web/app/(ee)/api/track/lead/client/route.ts b/apps/web/app/(ee)/api/track/lead/client/route.ts
index 03ad1093c6..c22810fcb1 100644
--- a/apps/web/app/(ee)/api/track/lead/client/route.ts
+++ b/apps/web/app/(ee)/api/track/lead/client/route.ts
@@ -23,7 +23,7 @@ export const POST = withPublishableKey(
if (!allowRequest) {
throw new DubApiError({
code: "forbidden",
- message: `Request origin '${getHostnameFromRequest(req)}' is not included in the allowed hostnames for this workspace. Update your allowed hostnames here: https://app.dub.co/settings/analytics`,
+ message: `Request origin '${getHostnameFromRequest(req)}' is not included in the allowed hostnames for this workspace. Update your allowed hostnames here: https://app.dub.co/settings/tracking`,
});
}
diff --git a/apps/web/app/(ee)/api/track/sale/client/route.ts b/apps/web/app/(ee)/api/track/sale/client/route.ts
index 82f0ea0c84..1cdcd82316 100644
--- a/apps/web/app/(ee)/api/track/sale/client/route.ts
+++ b/apps/web/app/(ee)/api/track/sale/client/route.ts
@@ -23,7 +23,7 @@ export const POST = withPublishableKey(
if (!allowRequest) {
throw new DubApiError({
code: "forbidden",
- message: `Request origin '${getHostnameFromRequest(req)}' is not included in the allowed hostnames for this workspace. Update your allowed hostnames here: https://app.dub.co/settings/analytics`,
+ message: `Request origin '${getHostnameFromRequest(req)}' is not included in the allowed hostnames for this workspace. Update your allowed hostnames here: https://app.dub.co/settings/tracking`,
});
}
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/page-client.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/page-client.tsx
index d25dd7bc34..16cedbe058 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/page-client.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/page-client.tsx
@@ -150,7 +150,7 @@ function FinishSetupWrapper({
attribute sales, and measure partner performance.
</p>
<Link
- href={`/${slug}/settings/analytics`}
+ href={`/${slug}/settings/tracking`}
className={cn(
buttonVariants({ variant: "primary" }),
"mt-6 flex h-9 items-center justify-center whitespace-nowrap rounded-lg border px-3 text-sm",
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/add-hostname-modal.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/add-hostname-modal.tsx
similarity index 100%
rename from apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/add-hostname-modal.tsx
rename to apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/add-hostname-modal.tsx
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/base-script-section.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/base-script-section.tsx
similarity index 100%
rename from apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/base-script-section.tsx
rename to apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/base-script-section.tsx
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/complete-step-button.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/complete-step-button.tsx
similarity index 100%
rename from apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/complete-step-button.tsx
rename to apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/complete-step-button.tsx
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/connection-instructions.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/connection-instructions.tsx
similarity index 100%
rename from apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/connection-instructions.tsx
rename to apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/connection-instructions.tsx
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/conversion-tracking-section.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/conversion-tracking-section.tsx
similarity index 100%
rename from apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/conversion-tracking-section.tsx
rename to apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/conversion-tracking-section.tsx
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/conversion-tracking-toggle.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/conversion-tracking-toggle.tsx
similarity index 100%
rename from apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/conversion-tracking-toggle.tsx
rename to apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/conversion-tracking-toggle.tsx
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/guide.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/guide.tsx
similarity index 100%
rename from apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/guide.tsx
rename to apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/guide.tsx
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/hostname-menu.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/hostname-menu.tsx
similarity index 100%
rename from apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/hostname-menu.tsx
rename to apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/hostname-menu.tsx
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/hostname-section.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/hostname-section.tsx
similarity index 100%
rename from apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/hostname-section.tsx
rename to apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/hostname-section.tsx
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/outbound-domain-tracking-section.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/outbound-domain-tracking-section.tsx
similarity index 100%
rename from apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/outbound-domain-tracking-section.tsx
rename to apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/outbound-domain-tracking-section.tsx
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/page-client.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/page-client.tsx
similarity index 98%
rename from apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/page-client.tsx
rename to apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/page-client.tsx
index 0905976de4..553db96dae 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/page-client.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/page-client.tsx
@@ -141,7 +141,7 @@ const SaleEventsStep = ({
);
};
-export default function WorkspaceAnalyticsPageClient() {
+export function WorkspaceTrackingSettingsPageClient() {
const { searchParams, queryParams } = useRouterStuff();
const expandedStep = (searchParams.get("step") as StepType) || "connect";
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/page.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/page.tsx
similarity index 56%
rename from apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/page.tsx
rename to apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/page.tsx
index 01f14d57c8..e0673e6909 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/page.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/page.tsx
@@ -2,22 +2,22 @@ import { PageContent } from "@/ui/layout/page-content";
import { PageWidthWrapper } from "@/ui/layout/page-width-wrapper";
import { Suspense } from "react";
import { ConversionTrackingToggle } from "./conversion-tracking-toggle";
-import WorkspaceAnalyticsPageClient from "./page-client";
+import { WorkspaceTrackingSettingsPageClient } from "./page-client";
-export default function WorkspaceAnalyticsPage() {
+export default function WorkspaceTrackingSettingsPage() {
return (
<PageContent
- title="Analytics"
+ title="Tracking"
titleInfo={{
title:
- "Configure analytics and conversion tracking settings for your workspace.",
- href: "https://dub.co/docs/conversions/quickstart",
+ "Configure and install Dub's tracking scripts and start tracking conversions on your website and web applications.",
+ href: "https://dub.co/docs/concepts/attribution",
}}
controls={<ConversionTrackingToggle />}
>
<PageWidthWrapper className="max-w-[800px] pb-20">
<Suspense>
- <WorkspaceAnalyticsPageClient />
+ <WorkspaceTrackingSettingsPageClient />
</Suspense>
</PageWidthWrapper>
</PageContent>
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/publishable-key-form.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/publishable-key-form.tsx
similarity index 100%
rename from apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/publishable-key-form.tsx
rename to apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/publishable-key-form.tsx
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/publishable-key-menu.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/publishable-key-menu.tsx
similarity index 100%
rename from apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/publishable-key-menu.tsx
rename to apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/publishable-key-menu.tsx
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/site-visit-tracking-section.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/site-visit-tracking-section.tsx
similarity index 100%
rename from apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/site-visit-tracking-section.tsx
rename to apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/site-visit-tracking-section.tsx
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/step.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/step.tsx
similarity index 100%
rename from apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/step.tsx
rename to apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/step.tsx
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/track-lead-guides-section.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/track-lead-guides-section.tsx
similarity index 100%
rename from apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/track-lead-guides-section.tsx
rename to apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/track-lead-guides-section.tsx
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/track-sales-guides-section.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/track-sales-guides-section.tsx
similarity index 100%
rename from apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/track-sales-guides-section.tsx
rename to apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/track-sales-guides-section.tsx
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/use-dynamic-guide.ts b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/use-dynamic-guide.ts
similarity index 100%
rename from apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/use-dynamic-guide.ts
rename to apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/use-dynamic-guide.ts
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/use-selected-guide.ts b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/use-selected-guide.ts
similarity index 100%
rename from apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/use-selected-guide.ts
rename to apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/use-selected-guide.ts
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/verify-install.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/verify-install.tsx
similarity index 100%
rename from apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/verify-install.tsx
rename to apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/verify-install.tsx
diff --git a/apps/web/app/app.dub.co/(onboarding)/onboarding/(steps)/success/page-client.tsx b/apps/web/app/app.dub.co/(onboarding)/onboarding/(steps)/success/page-client.tsx
index 95a2d7734c..ec185d9940 100644
--- a/apps/web/app/app.dub.co/(onboarding)/onboarding/(steps)/success/page-client.tsx
+++ b/apps/web/app/app.dub.co/(onboarding)/onboarding/(steps)/success/page-client.tsx
@@ -127,7 +127,7 @@ export function SuccessPageClient({
icon: Plug2,
title: "Set up conversion tracking",
description: "Install the Dub tracking script",
- href: `/${workspace.slug}/settings/analytics`,
+ href: `/${workspace.slug}/settings/tracking`,
cta: "Install",
loading: isLoadingWorkspace,
complete: connectedAnalytics,
diff --git a/apps/web/lib/middleware/utils/app-redirect.ts b/apps/web/lib/middleware/utils/app-redirect.ts
index eeabd4c24a..9a579086a3 100644
--- a/apps/web/lib/middleware/utils/app-redirect.ts
+++ b/apps/web/lib/middleware/utils/app-redirect.ts
@@ -41,10 +41,10 @@ export const appRedirect = async (path: string) => {
if (upgradeRegex.test(path))
return path.replace(upgradeRegex, "/$1/settings/billing/upgrade");
- // Redirect "/[slug]/guides" and all child paths to "/[slug]/settings/analytics"
+ // Redirect "/[slug]/guides" and all child paths to "/[slug]/settings/tracking"
const guidesRegex = /^\/([^\/]+)\/guides(?:\/(.*))?$/;
if (guidesRegex.test(path))
- return path.replace(guidesRegex, "/$1/settings/analytics");
+ return path.replace(guidesRegex, "/$1/settings/tracking");
// Redirect "/[slug]/settings/library/:path*" to "/[slug]/links/:path*"
const libraryRegex = /^\/([^\/]+)\/settings\/library\/(.*)$/;
@@ -56,6 +56,11 @@ export const appRedirect = async (path: string) => {
if (peopleRegex.test(path))
return path.replace(peopleRegex, "/$1/settings/members");
+ // Redirect "/[slug]/settings/analytics" to "/[slug]/settings/tracking"
+ const settingsAnalyticsRegex = /^\/([^\/]+)\/settings\/analytics$/;
+ if (settingsAnalyticsRegex.test(path))
+ return path.replace(settingsAnalyticsRegex, "/$1/settings/tracking");
+
// Redirect "/[slug]/programs/prog_[id]/:path*" to "/[slug]/program/:path*"
const oldProgramPagesRegex = /^\/([^\/]+)\/programs\/prog_[^\/]+\/(.*)$/;
if (oldProgramPagesRegex.test(path))
diff --git a/apps/web/scripts/find-link.ts b/apps/web/scripts/find-link.ts
index 1f0e46b230..67918b3a22 100644
--- a/apps/web/scripts/find-link.ts
+++ b/apps/web/scripts/find-link.ts
@@ -1,20 +1,174 @@
import { prisma } from "@dub/prisma";
+import { currencyFormatter } from "@dub/utils";
import "dotenv-flow/config";
+const PROGRAM_ID = "prog_1K0A6SX71Q3ZRC1HYFMXQGWJ8";
+
+// Table data: Invoice ID -> expected commission amount (USD cents)
+const EXPECTED_COMMISSION_BY_INVOICE_ID: Record<string, number> = {
+ "508542": 11880, // $118.80
+ "506161": 2346, // $23.46
+ "508363": 1100, // $11.00
+ "508294": 106, // $1.06
+ "507722": 936, // $9.36
+ "507692": 6000, // $60.00
+ "507596": 16200, // $162.00
+ "507579": 6565, // $65.65
+ "507452": 180, // $1.80
+ "507444": 870, // $8.70
+ "507254": 540, // $5.40
+ "507236": 8280, // $82.80
+ "507185": 3105, // $31.05
+ "507180": 530, // $5.30
+ "506974": 463, // $4.63
+ "506925": 180, // $1.80
+ "506853": 195, // $1.95
+ "506814": 1080, // $10.80
+ "506715": 7615, // $76.15
+ "506694": 31680, // $316.80
+ "506601": 2760, // $27.60
+ "506570": 412, // $4.12
+ "506539": 463, // $4.63
+ "506377": 1080, // $10.80
+ "506367": 2070, // $20.70
+ "506348": 23760, // $237.60
+ "506235": 360, // $3.60
+ "506208": 435, // $4.35
+ "506197": 6030, // $60.30
+ "506072": 2760, // $27.60
+ "506036": 14683, // $146.83
+ "506021": 11880, // $118.80
+ "505685": 4508, // $45.08
+ "505634": 3240, // $32.40
+ "505609": 1927, // $19.27
+ "505401": 900, // $9.00
+ "505215": 10560, // $105.60
+ "504939": 32400, // $324.00
+ "504837": 79380, // $793.80
+ "504640": 3304, // $33.04
+ "504627": 435, // $4.35
+ "504621": 49725, // $497.25
+ "504510": 2760, // $27.60
+ "504508": 1080, // $10.80
+ "504415": 295, // $2.95
+ "504412": 7080, // $70.80
+ "504375": 5175, // $51.75
+ "504182": 1035, // $10.35
+ "503995": 5520, // $55.20
+ "503994": 14160, // $141.60
+ "503972": 435, // $4.35
+ "503922": 255, // $2.55
+ "503799": 5443, // $54.43
+ "503762": 2199, // $21.99
+ "503691": 3240, // $32.40
+ "503518": 1035, // $10.35
+ "503188": 2937, // $29.37
+ "502940": 21812, // $218.12
+ "502810": 2070, // $20.70
+ "502726": 4595, // $45.95
+ "502330": 1080, // $10.80
+};
+
+const INVOICE_IDS = Object.keys(EXPECTED_COMMISSION_BY_INVOICE_ID);
+
async function main() {
- const links = await prisma.link.findMany({
+ const commissions = await prisma.commission.findMany({
where: {
- projectId: "xxx",
- url: "https://example.com",
+ programId: PROGRAM_ID,
+ invoiceId: { in: INVOICE_IDS },
},
select: {
id: true,
- shortLink: true,
- url: true,
+ invoiceId: true,
+ amount: true,
+ earnings: true,
+ type: true,
+ status: true,
+ createdAt: true,
},
+ orderBy: { createdAt: "desc" },
});
- console.table(links);
+ console.log(
+ `Expected commissions from table: ${INVOICE_IDS.length} invoice(s)\n`,
+ );
+ console.log(
+ `Found ${commissions.length} commission(s) in DB for program ${PROGRAM_ID} (filtered by invoiceId)\n`,
+ );
+
+ const mismatches: Array<{
+ id: string;
+ invoiceId: string | null;
+ earnings: number;
+ expectedCents: number;
+ diff: number;
+ }> = [];
+
+ const matchedInvoiceIds = new Set<string>();
+
+ for (const c of commissions) {
+ if (!c.invoiceId) continue;
+ const expectedCents = EXPECTED_COMMISSION_BY_INVOICE_ID[c.invoiceId];
+ if (expectedCents === undefined) continue;
+
+ matchedInvoiceIds.add(c.invoiceId);
+
+ if (c.earnings !== expectedCents) {
+ mismatches.push({
+ id: c.id,
+ invoiceId: c.invoiceId,
+ earnings: c.earnings,
+ expectedCents,
+ diff: c.earnings - expectedCents,
+ });
+ }
+ }
+
+ const missingInDb = INVOICE_IDS.filter((id) => !matchedInvoiceIds.has(id));
+
+ if (mismatches.length > 0) {
+ console.log("Mismatches (DB earnings ≠ table commission amount):");
+ console.table(
+ mismatches.map((m) => ({
+ id: m.id,
+ invoiceId: m.invoiceId,
+ earnings: currencyFormatter(m.earnings),
+ expected: currencyFormatter(m.expectedCents),
+ diff: currencyFormatter(m.diff),
+ })),
+ );
+ console.log(`\nTotal mismatches: ${mismatches.length}`);
+ } else {
+ console.log(
+ "All commissions match the table (earnings = expected commission amount).",
+ );
+ }
+
+ if (missingInDb.length > 0) {
+ console.log("\nInvoice IDs in table but not found in DB:");
+ console.log(missingInDb.join(", "));
+ console.log(`Count: ${missingInDb.length}`);
+ }
+
+ console.log("\nAll filtered commissions:");
+ console.table(
+ commissions.map((c) => ({
+ id: c.id,
+ invoiceId: c.invoiceId,
+ amount: currencyFormatter(c.amount),
+ earnings: currencyFormatter(c.earnings),
+ expected: c.invoiceId
+ ? currencyFormatter(EXPECTED_COMMISSION_BY_INVOICE_ID[c.invoiceId] ?? 0)
+ : "-",
+ match: c.invoiceId
+ ? c.earnings === (EXPECTED_COMMISSION_BY_INVOICE_ID[c.invoiceId] ?? -1)
+ ? "✓"
+ : "✗"
+ : "-",
+ status: c.status,
+ createdAt: c.createdAt.toISOString().slice(0, 10),
+ })),
+ );
}
main();
diff --git a/apps/web/tests/tracks/track-click.test.ts b/apps/web/tests/tracks/track-click.test.ts
index 5f7a4f6a85..cd376cd279 100644
--- a/apps/web/tests/tracks/track-click.test.ts
+++ b/apps/web/tests/tracks/track-click.test.ts
@@ -185,7 +185,7 @@ describe("POST /track/click", async () => {
// expect(response.data).toStrictEqual({
// error: {
// code: "forbidden",
- // message: `Request origin 'not-allowed.com' is not included in the allowed hostnames for this workspace (${E2E_LINK.domain}). Update your allowed hostnames here: https://app.dub.co/settings/analytics`,
+ // message: `Request origin 'not-allowed.com' is not included in the allowed hostnames for this workspace (${E2E_LINK.domain}). Update your allowed hostnames here: https://app.dub.co/settings/tracking`,
// doc_url: "https://dub.co/docs/api-reference/errors#forbidden",
// },
// });
diff --git a/apps/web/ui/customers/customers-table/customers-table.tsx b/apps/web/ui/customers/customers-table/customers-table.tsx
index b45270ae33..9ee70f2dbf 100644
--- a/apps/web/ui/customers/customers-table/customers-table.tsx
+++ b/apps/web/ui/customers/customers-table/customers-table.tsx
@@ -508,7 +508,7 @@ export function CustomersTable({
: "No customers have been recorded for your workspace yet. Learn how to track your first customer."
}
{...(!isFiltered && {
- learnMoreHref: `/${workspaceSlug}/settings/analytics`,
+ learnMoreHref: `/${workspaceSlug}/settings/tracking`,
learnMoreTarget: "_self",
learnMoreText: "Read the guides",
})}
diff --git a/apps/web/ui/layout/sidebar/app-sidebar-nav.tsx b/apps/web/ui/layout/sidebar/app-sidebar-nav.tsx
index e8fa57de7a..772a299765 100644
--- a/apps/web/ui/layout/sidebar/app-sidebar-nav.tsx
+++ b/apps/web/ui/layout/sidebar/app-sidebar-nav.tsx
@@ -29,6 +29,7 @@ import {
Key,
LifeRing,
LinesY as LinesYStatic,
+ MarketingTarget,
MoneyBills2,
Msgs,
PaperPlane,
@@ -404,26 +405,26 @@ const NAV_AREAS: SidebarNavAreas<SidebarNavData> = {
{
name: "Developer",
items: [
- {
- name: "Analytics",
- icon: LinesY,
- href: `/${slug}/settings/analytics`,
- },
{
name: "API Keys",
icon: Key,
href: `/${slug}/settings/tokens`,
},
{
- name: "OAuth Apps",
- icon: CubeSettings,
- href: `/${slug}/settings/oauth-apps`,
+ name: "Tracking",
+ icon: MarketingTarget,
+ href: `/${slug}/settings/tracking`,
},
{
name: "Webhooks",
icon: Webhook,
href: `/${slug}/settings/webhooks`,
},
+ {
+ name: "OAuth Apps",
+ icon: CubeSettings,
+ href: `/${slug}/settings/oauth-apps`,
+ },
],
},
{
diff --git a/apps/web/ui/layout/sidebar/dub-partners-popup.tsx b/apps/web/ui/layout/sidebar/dub-partners-popup.tsx
index 7c65241789..dbe4640c54 100644
--- a/apps/web/ui/layout/sidebar/dub-partners-popup.tsx
+++ b/apps/web/ui/layout/sidebar/dub-partners-popup.tsx
@@ -138,7 +138,7 @@ function DubPartnersPopupInner({
</p>
<div className="mt-4 grid w-full grid-cols-2 gap-2">
<Link
- href={`/${slug}/settings/analytics`}
+ href={`/${slug}/settings/tracking`}
className="flex h-7 items-center justify-center whitespace-nowrap rounded-md bg-white/10 px-2.5 text-xs text-white transition-colors duration-150 hover:bg-white/15"
>
Quickstart guides
diff --git a/apps/web/ui/layout/sidebar/sidebar-nav.tsx b/apps/web/ui/layout/sidebar/sidebar-nav.tsx
index abc1d6d4c3..8d17bf5b2f 100644
--- a/apps/web/ui/layout/sidebar/sidebar-nav.tsx
+++ b/apps/web/ui/layout/sidebar/sidebar-nav.tsx
@@ -270,7 +270,7 @@ function SidebarAreasPanel<T extends Record<any, any>>({
{data.showConversionGuides && (
<div className="px-3 pb-2">
<Link
- href={`/${data.slug}/settings/analytics`}
+ href={`/${data.slug}/settings/tracking`}
className="flex items-center gap-2 rounded-lg bg-neutral-200/75 px-2.5 py-2 text-xs text-neutral-700 transition-colors hover:bg-neutral-200"
>
<BookOpen className="size-4" />
diff --git a/apps/web/ui/layout/toolbar/onboarding/onboarding-button.tsx b/apps/web/ui/layout/toolbar/onboarding/onboarding-button.tsx
index efadaa857d..b9e3caf118 100644
--- a/apps/web/ui/layout/toolbar/onboarding/onboarding-button.tsx
+++ b/apps/web/ui/layout/toolbar/onboarding/onboarding-button.tsx
@@ -85,7 +85,7 @@ function OnboardingButtonInner({
},
{
display: "Set up conversion tracking",
- cta: `/${slug}/settings/analytics`,
+ cta: `/${slug}/settings/tracking`,
checked:
connectedAnalytics || (customersCount && customersCount > 0),
recommended: true,
diff --git a/packages/email/src/templates/program-welcome.tsx b/packages/email/src/templates/program-welcome.tsx
index 84efdaf092..92cd5df24e 100644
--- a/packages/email/src/templates/program-welcome.tsx
+++ b/packages/email/src/templates/program-welcome.tsx
@@ -128,7 +128,7 @@ export default function ProgramWelcome({
3. <span className="font-medium">Set up conversion tracking</span>
:{" "}
<Link
- href={`${workspaceUrlPrefix}/settings/analytics`}
+ href={`${workspaceUrlPrefix}/settings/tracking`}
className="font-semibold text-neutral-800 underline underline-offset-2"
>
Follow our quickstart guide
diff --git a/packages/email/src/templates/welcome-email.tsx b/packages/email/src/templates/welcome-email.tsx
index 911168a782..1d2d006179 100644
--- a/packages/email/src/templates/welcome-email.tsx
+++ b/packages/email/src/templates/welcome-email.tsx
@@ -230,7 +230,7 @@ export default function WelcomeEmail({
<Text className="mb-4 text-sm leading-6 text-neutral-600">
2. Track conversions:{" "}
<Link
- href="https://app.dub.co/settings/analytics"
+ href="https://app.dub.co/settings/tracking"
className="text-neutral-600 underline underline-offset-2"
>
Install the Dub tracking script