UNPKG

@caesar1030/react-analytics

Version:
26 lines (25 loc) 716 B
var u = Object.defineProperty; var r = Object.getOwnPropertySymbols; var p = Object.prototype.hasOwnProperty, s = Object.prototype.propertyIsEnumerable; var f = (o, e, t) => e in o ? u(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t, i = (o, e) => { for (var t in e || (e = {})) p.call(e, t) && f(o, t, e[t]); if (r) for (var t of r(e)) s.call(e, t) && f(o, t, e[t]); return o; }; import { useEffect as c } from "react"; import { useGA as g } from "./react-analytics.es13.js"; const A = ({ eventParams: o, enabled: e = !0 }) => { const { ga4Event: t } = g(); c(() => { e && t("page_view", i({}, o)); }, [e, o, t]); }; export { A as useGAPageView };