🎥 Make videos programmatically with React
Elements: Track requests sent to Studio (#10597)
Igor Samokhovetsa163951b91ff
diff --git a/packages/docs/src/components/Elements/ElementPage.tsx b/packages/docs/src/components/Elements/ElementPage.tsxindex de1dafcc94..4d1175868f 100644--- a/packages/docs/src/components/Elements/ElementPage.tsx+++ b/packages/docs/src/components/Elements/ElementPage.tsx@@ -78,7 +78,13 @@ export const ElementPage: React.FC<ElementPageProps> = ({type: 'success',message: `Sent to ${target.projectName ?? 'Remotion Studio'} / ${target.compositionId}. Confirm the installation in Studio.`,});- }, [elementPayload]);++ if (window.location.origin === 'https://www.remotion.dev') {+ navigator.sendBeacon(+ `https://www.remotion.pro/api/track/element-install-request?slug=${encodeURIComponent(definition.slug)}`,+ );+ }+ }, [definition.slug, elementPayload]);const PreviewComponent = useMemo(() => {return () => <ElementPreviewComposition definition={definition} />;