🚀. Socket Launch Week Day 2:Introducing Manifest Alerts.Learn more
Sign In

era6-capacitor-analytics

Package Overview
Dependencies
Maintainers
5
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

era6-capacitor-analytics

A capacitor plug-in that has enabled some features of Firebase Analytics

latest
npmnpm
Version
0.0.5
Version published
Maintainers
5
Created
Source

Era6 Capacitor Analytics

A capacitor plug-in that has enabled some features of Firebase Analytics

Android

  • npm install --save era6-capacitor-analytics
  • npx cap sync android
  • npx cap open android
  • Add the Firebase service configuration file to the app's root folder (android/app) - doc
  • In your MainActivity.java file add the lines:
    import br.com.era6.capacitor.analytics.CapacitorAnalyticsPlugin;

    ...

    add(CapacitorAnalyticsPlugin.class);

iOS

  • npm install --save era6-capacitor-analytics
  • npx cap sync ios
  • npx cap open ios
  • Add the Firebase service configuration file to the app's root folder (ios/App/App) - doc

API

  • reset(): Promise<void>
  • enable(): Promise<void>
  • disable(): Promise<void>
  • logEvent({ name: string; params?: object }): Promise<void>
  • setUserProp({ key: string; value: string }): Promise<void>

Usage

import { CapacitorAnalyticsPlugin } from 'era6-capacitor-analytics';

// Get a instance
const analytics = new CapacitorAnalyticsPlugin();

// User properties
analytics.setUserProp({
    key: 'gender',
    value: 'female'
});

// logEvent
analytics.logEvent({
    name: 'page_view',
    params: {
        page_path: './test/'
    }
});

// Reset firebase values
analytics.reset();

// Enable firebase analytics
analytics.enable();

// Disable firebase analytics
analytics.disable();

Debug

Validate your Google Analytics configuration with DebugView

License

MIT

Keywords

capacitor

FAQs

Package last updated on 19 Mar 2020

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