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.

remove unused script

Steven Teyc69a77d9e839
diff --git a/apps/web/app/(ee)/partners.dub.co/(apply)/[programSlug]/(default)/apply/success/page.tsx b/apps/web/app/(ee)/partners.dub.co/(apply)/[programSlug]/(default)/apply/success/page.tsx
index 1ac68377de..b4d02a1886 100644
--- a/apps/web/app/(ee)/partners.dub.co/(apply)/[programSlug]/(default)/apply/success/page.tsx
+++ b/apps/web/app/(ee)/partners.dub.co/(apply)/[programSlug]/(default)/apply/success/page.tsx
@@ -9,7 +9,6 @@ import { notFound, redirect } from "next/navigation";
import { CSSProperties } from "react";
import { ApplyHeader } from "../../header";
import { CTAButtons } from "./cta-buttons";
-import { PixelConversion } from "./pixel-conversion";
import { Screenshot } from "./screenshot";
export const dynamic = "force-dynamic";
@@ -85,111 +84,101 @@ export default async function SuccessPage(props: {
const hasPartnerProfile = !!enrollmentId;
return (
- <>
- {program.slug === "perplexity" && <PixelConversion />}
- <div
- className="relative"
- style={
- {
- "--brand": program.group.brandColor || "#000000",
- "--brand-ring": "rgb(from var(--brand) r g b / 0.2)",
- } as CSSProperties
- }
- >
- <ApplyHeader
- group={program.group}
- showLogin={false}
- showApply={false}
- />
- <div className="p-6">
- <div className="grid grid-cols-1 gap-5 sm:pt-20">
- <span className="w-fit rounded-md bg-neutral-100 px-2 py-1 text-xs font-medium text-neutral-700">
- Step 2 of 2
- </span>
- <h1 className="text-4xl font-semibold">
- {hasPartnerProfile
- ? "Application submitted"
- : "Finish your application"}
- </h1>
- <div className="flex flex-col gap-4 text-base text-neutral-700">
- {hasPartnerProfile && (
- <p>
- Your application has been submitted for review.
- {application && (
- <>
- {" "}
- You'll receive an update at{" "}
- <strong className="font-semibold">
- {application.email}
- </strong>
- .
- </>
- )}
- </p>
- )}
- {!hasPartnerProfile && (
- <p>
- Your application to{" "}
- <strong className="font-semibold">{program.name}</strong> has
- been saved, but you still need to create your{" "}
- <strong className="font-semibold">Dub Partners</strong>{" "}
- account to complete your application.
- <br />
- <br />
- Once you create your account, your application will be
- submitted to <b>{program.name}</b> and you'll hear back from
- them{" "}
- <strong className="font-semibold">
- {application?.email
- ? `at ${application.email}`
- : "via email"}
- </strong>
- .
- </p>
- )}
- </div>
- </div>
-
- {/* Buttons */}
- <div className="mt-12 flex flex-col gap-3">
- <CTAButtons />
+ <div
+ className="relative"
+ style={
+ {
+ "--brand": program.group.brandColor || "#000000",
+ "--brand-ring": "rgb(from var(--brand) r g b / 0.2)",
+ } as CSSProperties
+ }
+ >
+ <ApplyHeader group={program.group} showLogin={false} showApply={false} />
+ <div className="p-6">
+ <div className="grid grid-cols-1 gap-5 sm:pt-20">
+ <span className="w-fit rounded-md bg-neutral-100 px-2 py-1 text-xs font-medium text-neutral-700">
+ Step 2 of 2
+ </span>
+ <h1 className="text-4xl font-semibold">
+ {hasPartnerProfile
+ ? "Application submitted"
+ : "Finish your application"}
+ </h1>
+ <div className="flex flex-col gap-4 text-base text-neutral-700">
+ {hasPartnerProfile && (
+ <p>
+ Your application has been submitted for review.
+ {application && (
+ <>
+ {" "}
+ You'll receive an update at{" "}
+ <strong className="font-semibold">
+ {application.email}
+ </strong>
+ .
+ </>
+ )}
+ </p>
+ )}
+ {!hasPartnerProfile && (
+ <p>
+ Your application to{" "}
+ <strong className="font-semibold">{program.name}</strong> has
+ been saved, but you still need to create your{" "}
+ <strong className="font-semibold">Dub Partners</strong> account
+ to complete your application.
+ <br />
+ <br />
+ Once you create your account, your application will be submitted
+ to <b>{program.name}</b> and you'll hear back from them{" "}
+ <strong className="font-semibold">
+ {application?.email ? `at ${application.email}` : "via email"}
+ </strong>
+ .
+ </p>
+ )}
</div>
+ </div>
- {/* Screenshot */}
- <div className="relative mt-16">
- <Screenshot
- program={{ name: program.name, logo: program.logo }}
- className="h-auto w-full [mask-image:linear-gradient(black_80%,transparent)]"
- />
- <div className="absolute bottom-0 left-1/2 -translate-x-1/2">
- <div className="absolute -inset-[50%] rounded-full bg-white blur-lg" />
-
- {programSlug !== "dub" && (
- <div className="relative flex items-center gap-2 rounded-full border border-neutral-100 bg-gradient-to-b from-white to-neutral-50 p-2 shadow-[0_8px_28px_0_#00000017]">
- <img
- className="size-10 shrink-0 rounded-full"
- src={program.logo || `${OG_AVATAR_URL}${program.name}`}
- alt={`${program.name} logo`}
- />
- <BoltFill className="shrink-0 text-[var(--brand)] opacity-30" />
- <Logo className="size-10 shrink-0" />
- </div>
- )}
- </div>
- </div>
+ {/* Buttons */}
+ <div className="mt-12 flex flex-col gap-3">
+ <CTAButtons />
+ </div>
- {/* Feature grid */}
- <div className="mt-16 grid grid-cols-1 gap-10 sm:grid-cols-2">
- {FEATURES.map(({ icon: Icon, title, description }) => (
- <div key={title} className="flex flex-col gap-2.5 text-sm">
- <Icon className="size-4 shrink-0 text-[var(--brand)]" />
- <h3 className="font-semibold text-neutral-900">{title}</h3>
- <p className="text-neutral-500">{description}</p>
+ {/* Screenshot */}
+ <div className="relative mt-16">
+ <Screenshot
+ program={{ name: program.name, logo: program.logo }}
+ className="h-auto w-full [mask-image:linear-gradient(black_80%,transparent)]"
+ />
+ <div className="absolute bottom-0 left-1/2 -translate-x-1/2">
+ <div className="absolute -inset-[50%] rounded-full bg-white blur-lg" />
+
+ {programSlug !== "dub" && (
+ <div className="relative flex items-center gap-2 rounded-full border border-neutral-100 bg-gradient-to-b from-white to-neutral-50 p-2 shadow-[0_8px_28px_0_#00000017]">
+ <img
+ className="size-10 shrink-0 rounded-full"
+ src={program.logo || `${OG_AVATAR_URL}${program.name}`}
+ alt={`${program.name} logo`}
+ />
+ <BoltFill className="shrink-0 text-[var(--brand)] opacity-30" />
+ <Logo className="size-10 shrink-0" />
</div>
- ))}
+ )}
</div>
</div>
+
+ {/* Feature grid */}
+ <div className="mt-16 grid grid-cols-1 gap-10 sm:grid-cols-2">
+ {FEATURES.map(({ icon: Icon, title, description }) => (
+ <div key={title} className="flex flex-col gap-2.5 text-sm">
+ <Icon className="size-4 shrink-0 text-[var(--brand)]" />
+ <h3 className="font-semibold text-neutral-900">{title}</h3>
+ <p className="text-neutral-500">{description}</p>
+ </div>
+ ))}
+ </div>
</div>
- </>
+ </div>
);
}
diff --git a/apps/web/app/(ee)/partners.dub.co/(apply)/[programSlug]/(default)/apply/success/pixel-conversion.tsx b/apps/web/app/(ee)/partners.dub.co/(apply)/[programSlug]/(default)/apply/success/pixel-conversion.tsx
deleted file mode 100644
index e794d7d787..0000000000
--- a/apps/web/app/(ee)/partners.dub.co/(apply)/[programSlug]/(default)/apply/success/pixel-conversion.tsx
+++ /dev/null
@@ -1,46 +0,0 @@
-"use client";
-
-import { ClientOnly } from "@dub/ui";
-import { useSearchParams } from "next/navigation";
-import { Suspense, useEffect } from "react";
-
-declare global {
- interface Window {
- fbq?: (action: string, event: string, params?: Record<string, any>) => void;
- lintrk?: (
- action: string,
- event: string | Record<string, any>,
- params?: Record<string, any>,
- ) => void;
- }
-}
-
-export function PixelConversion() {
- return (
- <ClientOnly>
- <Suspense>
- <PixelConversionHelper />
- </Suspense>
- </ClientOnly>
- );
-}
-
-function PixelConversionHelper() {
- const searchParams = useSearchParams();
- const applicationId = searchParams.get("applicationId");
-
- useEffect(() => {
- if (applicationId && typeof window !== "undefined") {
- // Meta conversion tracking
- if (window.fbq) {
- window.fbq("track", "application submitted");
- }
- // LinkedIn conversion tracking
- if (window.lintrk) {
- window.lintrk("track", { conversion_id: 24025098 });
- }
- }
- }, [applicationId]);
-
- return <></>;
-}
diff --git a/apps/web/app/(ee)/partners.dub.co/(apply)/[programSlug]/(default)/layout.tsx b/apps/web/app/(ee)/partners.dub.co/(apply)/[programSlug]/(default)/layout.tsx
index 5573301665..87f51c62cf 100644
--- a/apps/web/app/(ee)/partners.dub.co/(apply)/[programSlug]/(default)/layout.tsx
+++ b/apps/web/app/(ee)/partners.dub.co/(apply)/[programSlug]/(default)/layout.tsx
@@ -7,7 +7,6 @@ import { APP_DOMAIN, PARTNERS_DOMAIN } from "@dub/utils";
import { constructMetadata } from "@dub/utils/src/functions";
import Link from "next/link";
import { notFound } from "next/navigation";
-import Script from "next/script";
import { PropsWithChildren } from "react";
export async function generateMetadata(props: {
@@ -63,69 +62,49 @@ export default async function ApplyLayout(
}
return (
- <>
- {program.slug === "perplexity" && (
- <>
- {/* Meta script */}
- <Script
- strategy="beforeInteractive"
- dangerouslySetInnerHTML={{
- __html: `!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window, document,'script','https://connect.facebook.net/en_US/fbevents.js');fbq('init', '1340891577378510');fbq('track', 'PageView');`,
- }}
- />
- {/* LinkedIn script */}
- <Script
- strategy="beforeInteractive"
- dangerouslySetInnerHTML={{
- __html: `_linkedin_partner_id = "8071818";window._linkedin_data_partner_ids = window._linkedin_data_partner_ids || [];window._linkedin_data_partner_ids.push(_linkedin_partner_id);(function(l) {if (!l){window.lintrk = function(a,b){window.lintrk.q.push([a,b])};window.lintrk.q=[]}var s = document.getElementsByTagName("script")[0];var b = document.createElement("script");b.type = "text/javascript";b.async = true;b.src = "https://snap.licdn.com/li.lms-analytics/insight.min.js";s.parentNode.insertBefore(b, s);})(window.lintrk);`,
- }}
- />
- </>
- )}
- <div className="relative">
- <div className="relative z-10 mx-auto min-h-screen w-full max-w-screen-sm bg-white">
- <div className="pointer-events-none absolute left-0 top-0 h-screen w-full border-x border-neutral-200 [mask-image:linear-gradient(black,transparent)]" />
- {children}
- {/* Footer */}
- <footer className="mt-14 flex flex-col items-center gap-4 py-6 text-center text-xs text-neutral-500">
- <Link
- href="https://dub.co/partners"
+ <div className="relative">
+ <div className="relative z-10 mx-auto min-h-screen w-full max-w-screen-sm bg-white">
+ <div className="pointer-events-none absolute left-0 top-0 h-screen w-full border-x border-neutral-200 [mask-image:linear-gradient(black,transparent)]" />
+ {children}
+ {/* Footer */}
+ <footer className="mt-14 flex flex-col items-center gap-4 py-6 text-center text-xs text-neutral-500">
+ <Link
+ href="https://dub.co/partners"
+ target="_blank"
+ className="flex items-center gap-1.5 whitespace-nowrap"
+ >
+ Powered by <Wordmark className="h-4 p-0.5" />
+ </Link>
+ <span className="flex items-center gap-2">
+ <a
+ href="https://dub.co/legal/partners"
target="_blank"
- className="flex items-center gap-1.5 whitespace-nowrap"
+ className="transition-colors duration-75 hover:text-neutral-600"
>
- Powered by <Wordmark className="h-4 p-0.5" />
- </Link>
- <span className="flex items-center gap-2">
- <a
- href="https://dub.co/legal/partners"
- target="_blank"
- className="transition-colors duration-75 hover:text-neutral-600"
- >
- Terms of Service
- </a>
- <span className="text-base text-neutral-200">&bull;</span>
- <a
- href="https://dub.co/legal/privacy"
- target="_blank"
- className="transition-colors duration-75 hover:text-neutral-600"
- >
- Privacy Policy
- </a>
- </span>
- </footer>
- </div>
+ Terms of Service
+ </a>
+ <span className="text-base text-neutral-200">&bull;</span>
+ <a
+ href="https://dub.co/legal/privacy"
+ target="_blank"
+ className="transition-colors duration-75 hover:text-neutral-600"
+ >
+ Privacy Policy
+ </a>
+ </span>
+ </footer>
+ </div>
- {/* Background grid */}
- <div className="absolute inset-0 flex h-fit w-full items-center justify-center">
- <img
- src="https://assets.dub.co/misc/program-apply-grid.svg"
- alt=""
- width={1280}
- height={480}
- className="[mask-image:radial-gradient(70%_100%_at_50%_0%,black_30%,transparent)]"
- />
- </div>
+ {/* Background grid */}
+ <div className="absolute inset-0 flex h-fit w-full items-center justify-center">
+ <img
+ src="https://assets.dub.co/misc/program-apply-grid.svg"
+ alt=""
+ width={1280}
+ height={480}
+ className="[mask-image:radial-gradient(70%_100%_at_50%_0%,black_30%,transparent)]"
+ />
</div>
- </>
+ </div>
);
}