1.0.3 • Published 4 years ago

wezeo-analytics v1.0.3

Weekly downloads
-
License
-
Repository
-
Last release
4 years ago

Supported services

  • Google Firebase Analytics

Installation

  1. Install wezeo-analytics package npm install wezeo-analytics
  2. Add package to vue

    import WAnalytics from 'wezeo-analytics'
    const app = createApp(App).use(WAnalytics, options)

Google Analytics

  1. Create Firebase account
  2. (Web) Send your Firebase app creadentials in options (more on this later)
  3. (iOS) Add GoogleService-Info.plist (... just google it)
  4. (Android) Add google-services.json (... just google it)

Initialize options

const options = {
    // Track page_view events
    trackRouter: true, // default true
    
    // Only for web
    firebase: {
        apiKey: "...",
        authDomain: "...",
        databaseURL: "...",
        projectId: "...",
        storageBucket: "...",
        messagingSenderId: "...",
        appId: "...",
        measurementId: "..."
    }
}

Firebase methods

  • this.$wAnalytics.firebase.logEvent(eventName: string, params: {})
  • this.$wAnalytics.firebase.setUserId(userId: string)
  • this.$wAnalytics.firebase.setUserProperty(key: string, key: value)