Add Яндекс.Метрика funnel goals: signup_free + gate_view (env-driven counter)
- window.ym reachGoal 'signup_free' on registration success - GateViewTracker client component fires 'gate_view' on tripwire gate mount - counter id via NEXT_PUBLIC_METRIKA_COUNTER_ID (build-time) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -5,6 +5,7 @@ import Link from "next/link";
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
ym?: (counterId: number, action: string, goal: string) => void;
|
||||
turnstile?: {
|
||||
render: (
|
||||
container: HTMLElement,
|
||||
@@ -161,6 +162,11 @@ export function RegisterForm({ showTermsCheckbox, privacyPolicyUrl, termsUrl, of
|
||||
return;
|
||||
}
|
||||
|
||||
// Яндекс.Метрика: цель «бесплатная регистрация»
|
||||
const mc = Number(process.env.NEXT_PUBLIC_METRIKA_COUNTER_ID);
|
||||
if (mc && typeof window !== "undefined" && typeof window.ym === "function") {
|
||||
window.ym(mc, "reachGoal", "signup_free");
|
||||
}
|
||||
setSuccess(true);
|
||||
setLoading(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user