WilliamDASILVA / nuxt-facebook-pixel-module

Inject Facebook pixel code
MIT License
89 stars 39 forks source link

this.fbq is not a function #37

Open rutcreate opened 3 years ago

rutcreate commented 3 years ago

This is my code.

mounted () {
  this.$fb.track('PageView')
}

I use Nuxt and got error this.fbq is not a function when deploy as a production. Not happen to development.

Any ideas?

jerome-offeo commented 3 years ago

@rutcreate did you manage to solve this? I'm currently facing the issue on production. Feels like the script didn't get loaded fast enough. :thinking:

jerome-offeo commented 3 years ago

@rutcreate did you manage to solve this? I'm currently facing the issue on production. Feels like the script didn't get loaded fast enough.

I just discovered for my case it was due to a duplication of FB Pixels injected. :facepalm:

karolkrupa commented 2 years ago

This https://github.com/WilliamDASILVA/nuxt-facebook-pixel-module/pull/41 should resolve the problem. This module sometimes tries to track event before facebook sdk (fbq function) is loaded