From 8a615c11f84e1e66db347c2496f27287bb0c03a4 Mon Sep 17 00:00:00 2001 From: "[dyad]" Date: Wed, 21 Jan 2026 08:24:10 +0100 Subject: [PATCH] [dyad] Add tracking detection tab - wrote 4 file(s) --- src/app/actions.ts | 48 ++++++++----- src/components/meta-form.tsx | 18 +++++ src/components/tracking-display.tsx | 100 ++++++++++++++++++++++++++++ src/lib/types.ts | 2 + 4 files changed, 150 insertions(+), 18 deletions(-) create mode 100644 src/components/tracking-display.tsx diff --git a/src/app/actions.ts b/src/app/actions.ts index 2738f9c..b097c85 100644 --- a/src/app/actions.ts +++ b/src/app/actions.ts @@ -32,6 +32,11 @@ export interface DetectedSystem { name: string; } +export interface TrackingTool { + name: string; + id: string | null; +} + export async function extractMetaData(url: string, keyword?: string) { if (!url) { return { error: "URL is required." }; @@ -229,11 +234,10 @@ export async function extractMetaData(url: string, keyword?: string) { links.push({ href: absoluteUrl, text, type, rel }); }); - const detectedSystems: DetectedSystem[] = []; const htmlContent = $.html(); const uniqueSystems = new Set(); - // WordPress + // System Detection if ( $('meta[name="generator"][content*="WordPress"]').length > 0 || htmlContent.includes("/wp-content/") || @@ -241,47 +245,54 @@ export async function extractMetaData(url: string, keyword?: string) { ) { uniqueSystems.add("WordPress"); } - - // Shopify if ( htmlContent.includes("cdn.shopify.com") || htmlContent.includes("Shopify.theme") ) { uniqueSystems.add("Shopify"); } - - // Next.js if ($("#__next").length > 0) { uniqueSystems.add("Next.js"); - uniqueSystems.add("React"); // Next.js uses React + uniqueSystems.add("React"); } - - // React (generic) if ($("#root").length > 0) { uniqueSystems.add("React"); } - - // Webflow if ( $('meta[name="generator"][content="Webflow"]').length > 0 || htmlContent.includes("