@m13v/seo-components 0.31.1 → 0.31.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { useEffect, useState } from "react";
|
|
4
4
|
import { motion, AnimatePresence } from "framer-motion";
|
|
5
5
|
import { trackGetStartedClick } from "../lib/track";
|
|
6
|
+
import { useCapture } from "../lib/analytics-context";
|
|
6
7
|
|
|
7
8
|
const DEFAULT_STORAGE_KEY = "install_email_captured";
|
|
8
9
|
|
|
@@ -92,6 +93,7 @@ export function InstallEmailGate({
|
|
|
92
93
|
newsletterPath = "/api/newsletter",
|
|
93
94
|
renderTrigger,
|
|
94
95
|
}: InstallEmailGateProps) {
|
|
96
|
+
const capture = useCapture();
|
|
95
97
|
const [stage, setStage] = useState<Stage>("closed");
|
|
96
98
|
const [email, setEmail] = useState("");
|
|
97
99
|
const [submitting, setSubmitting] = useState(false);
|
|
@@ -154,6 +156,14 @@ export function InstallEmailGate({
|
|
|
154
156
|
console.warn("[InstallEmailGate] newsletter POST failed", res.status);
|
|
155
157
|
}
|
|
156
158
|
if (remember) markInstallEmailCaptured(trimmed, storageKey);
|
|
159
|
+
capture("newsletter_subscribed", {
|
|
160
|
+
component: "InstallEmailGate",
|
|
161
|
+
email: trimmed,
|
|
162
|
+
page: typeof window !== "undefined" ? window.location.pathname : undefined,
|
|
163
|
+
site,
|
|
164
|
+
section,
|
|
165
|
+
source: "install_gate",
|
|
166
|
+
});
|
|
157
167
|
trackGetStartedClick({
|
|
158
168
|
destination: "modal:command",
|
|
159
169
|
site,
|