@sergiodxa/analytics
v1.1.0
Published
Use my own analytics service to track events
Downloads
19
Maintainers
Readme
@sergiodxa/analytics
Usage
Install it
yarn add @sergiodxa/analytics
import { track } from "@sergiodxa/analytics";
track({
type: "event",
action: "Page view",
description: "User accessed /"
}, process.env.NODE_ENV === "production")
With Next.js
import withAnalytics from "@sergiodxa/analytics/lib/react";
function Page() {
return <h1>Next.js Page</h1>;
}
export default withAnalytics(Page);