@guivieiras/capacitor-app-analytics
TypeScript icon, indicating that this package has built-in type declarations

0.0.6 • Public • Published

npm version

capacitor-app-analytics

Capacitor plugin for UXCam and FullStory analytics. It uses UXCam for Android and iOS platforms and FullStory for Web/PWA.

Installation

npm i @clipboardhealth/capacitor-app-analytics

Android Configuration

In file android/app/src/main/java/**/**/MainActivity.java, add the plugin to the initialization list:

this.init(savedInstanceState, new ArrayList<Class<? extends Plugin>>() {{
  [...]
  add(health.clipboard.analytics.app.capacitor.CapacitorAppAnalytics.class);
  [...]
}});

In file android/app/src/main/AndroidManifest.xml, add the following XML elements under <manifest><application> :

<service android:name="com.uxcam.service.HttpPostService"/>

iOS Configuration

None

Web

Paste your FullStory snippet in the <head>.

More information can be found here: https://help.fullstory.com/hc/en-us/articles/360020623514-How-do-I-get-FullStory-up-and-running-on-my-site-

Methods

startWithKey(options: { UXCamKey: string })

Starts tracking the session

Plugins.CapacitorAppAnalytics.startWithKey({ UXCamKey: 'your_uxcam_api_key' })

setUserProperty(options: UserProperty)

Sets the user property of the session user

Plugins.CapacitorAppAnalytics.setUserProperty({
    userId: '$userId',
    name: 'name,
    userInfo: {
      ...extra properties of the user
    },
  })

tagScreenName(options: { screenName: string })

Track the name of the screen

Plugins.CapacitorAppAnalytics.tagScreenName({ screenName: 'LoginScreen' })

stopSession()

Stops the current session

Plugins.CapacitorAppAnalytics.stopSession()

Dependents (0)

Package Sidebar

Install

npm i @guivieiras/capacitor-app-analytics

Weekly Downloads

2

Version

0.0.6

License

MIT

Unpacked Size

540 kB

Total Files

41

Last publish

Collaborators

  • theguii