mib200 / vue-gtm

Simple implementation of Google Tag Manager in Vue.js 2.0
Apache License 2.0
242 stars 85 forks source link

loadScript method throws error when enabling the plugin #90

Closed lajoskvcs closed 4 years ago

lajoskvcs commented 4 years ago

Hi!

When the GTMPlugin starts with enabled: false and you call this.$gtm.enable(true), then it will throw an error!

The error:

Cannot read property 'defer' of undefined

The solution:

In the enable method the loadScript does not get a config Object.

lajoskvcs commented 4 years ago

Hi! I made a PR for a resolution: https://github.com/mib200/vue-gtm/pull/91