nuxt-community / google-gtag-module

Enable google gtagjs for NuxtJs
MIT License
147 stars 27 forks source link

Gtag logs events in Console, but nothing gets fired in Network #51

Open adhamfarrag opened 2 years ago

adhamfarrag commented 2 years ago

Hi. Using this module, events get fired and logged but zero calls in Network. Am I doing something wrong ?

   // Method
    google() {
      this.$gtag("config", "UA-XXXXXXX", {
        user_id: this.userAnalyticsID,
      });

      this.$gtag("event", "your_event", {
        event_category: "welcome_video",
        event_label: "[play icon]",
      });
    },
// Nuxt Config
  "google-gtag": {
    id: "UA-XXXXXXX"
    config: {
      anonymize_ip: true,
      send_page_view: true,
      linker: {
        domains: ["baseUrl"],
      },
    },
    debug: true,
    disableAutoPageTrack: false,
  },

These are logs after I fired events

Screen Shot 2022-02-22 at 11 07 47 PM
riddla commented 1 year ago

You are probably on localhost respectively on your dev environment via npm run dev? This module does not track in dev mode by default. You need to explicitly set the debug option, see per default..

In dev mode the module falls back to console logging, as seen in your screenshot above.