@adhawk/react-tracked-link
TypeScript icon, indicating that this package has built-in type declarations

1.2.9 • Public • Published

@adhawk/react-tracked-link

This package is a wrapper <a> tags that is compatible Segment.io. Under the hood, it ensures analytics.track is called before the browser navigates away. Similar to analytics.trackLink, but for React.

Setup

yarn add @adhawk/react-tracked-link

Usage

import { TrackedLink } from "@adhawk/react-tracked-link";

ReactDOM.render(
  <TrackedLink
    href="/foo/bar"
    eventName="Clicked Foo Link"
    eventProperties={{ experiment: "v2" }}
  />,
  document.querySelector("root"),
);

Readme

Keywords

none

Package Sidebar

Install

npm i @adhawk/react-tracked-link

Weekly Downloads

91

Version

1.2.9

License

MIT

Unpacked Size

33.9 kB

Total Files

10

Last publish

Collaborators

  • stephengrable1
  • adhawk
  • janeosaur