Skip to content
This repository has been archived by the owner on Feb 11, 2022. It is now read-only.

Using with Middleware in Nuxt #5

Open
codasana opened this issue May 22, 2019 · 1 comment
Open

Using with Middleware in Nuxt #5

codasana opened this issue May 22, 2019 · 1 comment

Comments

@codasana
Copy link

codasana commented May 22, 2019

hello, I am using Nuxt and I want to track event in router middleware.

However this.$keen is not available in the middleware. What can I do?

Here is an example of the router middleware:

https://nuxtjs.org/examples/middleware/

I want to use it like this:

const user = store.state.auth.user

    console.log('user', user)
    if (user) {
      console.log('keen tracker')
      this.$keen.extendEvents({
        user
      })
      this.$keen.recordEvent("pageviews", {

      })

But this.$keen is not available.

@maxpaj
Copy link
Owner

maxpaj commented May 23, 2019

@msahajwani I'll take a look at this!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants