Skip to content
This repository was archived by the owner on Mar 21, 2025. It is now read-only.

Commit bdc3db4

Browse files
author
Matteo Gabriele
committed
Merge branch 'develop'
2 parents e22933f + fb9b8ff commit bdc3db4

File tree

4 files changed

+26
-31
lines changed

4 files changed

+26
-31
lines changed

src/bootstrap.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,12 @@ export default function bootstrap () {
3232
return resolve()
3333
})
3434
})
35+
.then(() => onAnalyticsReady())
3536
.then(() => {
36-
return onAnalyticsReady()
37-
})
38-
.then(() => {
39-
// we first need to add trackers to be able to track
40-
// every other aspect of the application
4137
createTrackers()
42-
// trigger the plugin `ready` callback right after the trackers
4338
ready()
44-
// add exceptions auto tracking
4539
exceptionAutoTracking()
46-
// add page auto tracking
4740
pageAutoTracking()
48-
// track every untracked events before analytics was ready
4941
untracked()
5042
})
5143
.catch(error => {

src/index.js

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,30 @@
11
import bootstrap from './bootstrap'
2-
import * as config from './config'
2+
import { update } from './config'
33
import { onAnalyticsReady } from './helpers'
4+
import event from 'lib/event'
5+
import exception from 'lib/exception'
6+
import page from 'lib/page'
7+
import query from 'lib/query'
8+
import require from 'lib/require'
9+
import set from 'lib/set'
10+
import social from 'lib/social'
11+
import time from 'lib/time'
12+
import untracked from 'lib/untracked'
413

514
export default function install (Vue, options = {}) {
6-
Vue.prototype.$ga = Vue.$ga = [
7-
'event',
8-
'exception',
9-
'page',
10-
'query',
11-
'require',
12-
'set',
13-
'social',
14-
'time',
15-
'untracked'
16-
].reduce((features, feature) => {
17-
return {
18-
...features,
19-
[feature]: require(`./lib/${feature}`).default
20-
}
21-
}, {})
22-
23-
config.update(options)
15+
Vue.prototype.$ga = Vue.$ga = {
16+
event,
17+
exception,
18+
page,
19+
query,
20+
require,
21+
set,
22+
social,
23+
time,
24+
untracked
25+
}
2426

27+
update(options)
2528
bootstrap()
2629
}
2730

src/lib/require.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import query from 'lib/query'
22

3-
export default function require (...args) {
3+
export default function (...args) {
44
if (args.length == 2) {
55
query('require', args[0], args[1])
66
return

yarn.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4929,8 +4929,8 @@ webpack-sources@^1.0.1:
49294929
source-map "~0.5.3"
49304930

49314931
webpack@^3.4.1:
4932-
version "3.4.1"
4933-
resolved "https://registry.yarnpkg.com/webpack/-/webpack-3.4.1.tgz#4c3f4f3fb318155a4db0cb6a36ff05c5697418f4"
4932+
version "3.6.0"
4933+
resolved "https://registry.yarnpkg.com/webpack/-/webpack-3.6.0.tgz#a89a929fbee205d35a4fa2cc487be9cbec8898bc"
49344934
dependencies:
49354935
acorn "^5.0.0"
49364936
acorn-dynamic-import "^2.0.0"

0 commit comments

Comments
 (0)