Skip to content

Instantly share code, notes, and snippets.

View voltane's full-sized avatar

zhadrian voltane

  • Unity Group
  • Wrocław
View GitHub Profile
@voltane
voltane / gist:d1ca4efadef7f7c7bfd65e3f18039a66
Created April 14, 2020 13:58
GTM for Nuxt - PageView problem proposal
const createMixin = (): VueConstructor | ComponentOptions<Vue> => ({
beforeRouteEnter: (to: Route, from: Route, next: Function) => {
next((vm: Vue) => {
setTimeout(() => {
// Enter Your code which send event to GTM
// @ts-ignore
window[this.options.layer].push(to.gtm || {
event: this.options.pageViewEventName,
pageType: 'PageView',
pageUrl: to.fullPath,