1.0.3 • Published 4 years ago
wezeo-analytics v1.0.3
Supported services
- Google Firebase Analytics
Installation
- Install wezeo-analytics package
npm install wezeo-analytics
Add package to vue
import WAnalytics from 'wezeo-analytics' const app = createApp(App).use(WAnalytics, options)
Google Analytics
- Create Firebase account
- (Web) Send your Firebase app creadentials in options (more on this later)
- (iOS) Add GoogleService-Info.plist (... just google it)
- (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)