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

Commit 8121bf7

Browse files
fix: window.ga undefined
closes #217
1 parent 42e8b7e commit 8121bf7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/create-trackers.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ import config, { getId } from './config'
44
import { getTracker } from './helpers'
55

66
export default function createTrackers () {
7+
if (!window.ga && config.debug.enabled) {
8+
throw new Error('[vue-analytics] Google Analytics has probably been blocked.')
9+
}
10+
11+
if (!window.ga) {
12+
return
13+
}
14+
715
const ids = getId()
816

917
if (config.debug.enabled) {

0 commit comments

Comments
 (0)