@1d/analytics

1D プロダクトの Analytics を行うラッパーです。

Usage no npm install needed!

<script type="module">
  import 1dAnalytics from 'https://cdn.skypack.dev/@1d/analytics';
</script>

README

1D-Analytics

1D プロダクトの Analytics を行うラッパーです。

Install

yarn add @1d/analytics

Usage

import { Analytics } from "@1d/analytics";
import { amplitudeApiKey } from "../config/consts";

const analytics = new Analytics(amplitudeApiKey);

export const { identify, track, trackScreenView } = analytics;

identify("dummyUserHash", {
  // Any properties you want
  occupation: dummyOccupation,
  email: dummyEmail,
  os: Platform.OS,
})

track("yourEvent", {
  // Any properties you want
  isLikeTea: true,
  isLikeCoffee: true
})

trackScreenView("prevScreen", "currentScreen", {
  // Any properties you want
  postHash: "dummyPostHash"
})

How to release

This package is automatically released via GitHub Actions after PR is merged into master.

All you need is just to modify the version property in package.json when you submit PR.