This repository has been archived by the owner on Jun 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adds possibility to access the vue-analytics library from outside the Vue scope
closes #151
- Loading branch information
1 parent
bad42a0
commit 1758db6
Showing
1 changed file
with
23 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,37 @@ | ||
import bootstrap from './bootstrap' | ||
import lib from './lib' | ||
import { update } from './config' | ||
import { onAnalyticsReady } from './helpers' | ||
import * as helpers from './helpers' | ||
import ga from 'directives/ga' | ||
import * as exception from 'lib/exception' | ||
import analyticsMiddleware from './vuex-middleware' | ||
import { autotracking as expectionAutotracking } from 'lib/exception' | ||
import vuexMiddleware from './vuex-middleware' | ||
|
||
export default function install (Vue, options = {}) { | ||
update({ ...options, $vue: Vue }) | ||
|
||
Vue.directive('ga', ga) | ||
|
||
Vue.prototype.$ga = Vue.$ga = lib | ||
|
||
exception.autotracking(Vue) | ||
|
||
expectionAutotracking(Vue) | ||
bootstrap() | ||
} | ||
|
||
export { | ||
onAnalyticsReady, | ||
analyticsMiddleware | ||
} | ||
// Vuex middleware | ||
export const analyticsMiddleware = vuexMiddleware | ||
|
||
// Helpers | ||
export const onAnalyticsReady = helpers.onAnalyticsReady | ||
|
||
// Event library | ||
export const event = lib.event | ||
export const ecommerce = lib.ecommerce | ||
export const set = lib.set | ||
export const page = lib.page | ||
export const query = lib.query | ||
export const screenview = lib.screenview | ||
export const time = lib.time | ||
export const require = lib.require | ||
export const exception = lib.exception | ||
export const social = lib.social | ||
|
||
|