Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@smartpay/mixpanel

Package Overview
Dependencies
Maintainers
3
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@smartpay/mixpanel

Mixpanel

  • 1.0.9
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created
Source

Mixpanel

This module is an in-house minimalism for easily integrating Mixpanel across Consumer and Merchant projects

Usage

Initialization

  • Pass a token and super properties to Mixpanel.initialize in your App.tsx
Mixpanel.initialize({
  token: process.env.REACT_APP_MIXPANEL_TOKEN || '',
  superProps: {
    Product: 'Checkout',
    Platform: 'Web',
  },
});
  • urlToScreen prop is optional to easily define tracking screen name based on current url path

Track page view and duration

  • Add useTrackPageView in your screen render method. By default, it will also track a duration the consumer stays on that screen.
const LoginScreen: FC<RouteComponentProps> = () => {
  useTrackPageView();

  return (
    ...
  )
};

Track actions

  • Call trackAction with an item name of that element
Mixpanel.trackAction({
  action: 'Click',
  itemName: 'Submit',
});

Track user idenfifer

  • Call setUserID after initalization with a unique identifier from the Backend

Register super properties

  • Call registerSuperProperties to have certain properties that you want to include with each event you send

Set user properties

  • Call setUserProperties to explore and segment users by who they are

Keywords

FAQs

Package last updated on 21 Jul 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc