javascript - Firebase Analytics Googletagmanager Error - Stack Overflow

I'm getting this error from Firebase, I added Analytics to my project today, and now the landing p

I'm getting this error from Firebase, I added Analytics to my project today, and now the landing page shows this error in the console.

helpers.ts:72 GET  net::ERR_BLOCKED_BY_CLIENT

I'm not importing GTAG in my index.html (i'm using React) this thing

<script async src=";></script>

Because I'm not using it.

and my config file for Firebase looks like this

import firebase from "firebase/app";
import "firebase/firestore";
import "firebase/auth";
import "firebase/analytics";

// Your web app's Firebase configuration
var firebaseConfig = {
  //the usual
  measurementId: "G-something",
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
export const auth = firebase.auth();
export const db = firebase.firestore();
export const firestore = firebase.firestore;
export const analytics = firebase.analytics;

Landing page

import { analytics } from "../configs/fbConfig";`
  useEffect(() => {
    analytics().setCurrentScreen(window.location.pathname); // sets `screen_name` parameter
    analytics().logEvent("screen_view"); // log event with `screen_name` parameter attached
    analytics().logEvent("landing_page_view", { landing_at: Date.now() });
  });

That's all i have, i want to log when the user see the landing page, so I can use a Funnel ( I believe ) to track the process from Landing to Login page.

Do I have to create something in the Firebase Console to make this work ? documentation for web analytics is kind of messy..

I'm getting this error from Firebase, I added Analytics to my project today, and now the landing page shows this error in the console.

helpers.ts:72 GET https://www.googletagmanager./gtag/js?l=dataLayer net::ERR_BLOCKED_BY_CLIENT

I'm not importing GTAG in my index.html (i'm using React) this thing

<script async src="https://www.googletagmanager./gtag/js"></script>

Because I'm not using it.

and my config file for Firebase looks like this

import firebase from "firebase/app";
import "firebase/firestore";
import "firebase/auth";
import "firebase/analytics";

// Your web app's Firebase configuration
var firebaseConfig = {
  //the usual
  measurementId: "G-something",
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
export const auth = firebase.auth();
export const db = firebase.firestore();
export const firestore = firebase.firestore;
export const analytics = firebase.analytics;

Landing page

import { analytics } from "../configs/fbConfig";`
  useEffect(() => {
    analytics().setCurrentScreen(window.location.pathname); // sets `screen_name` parameter
    analytics().logEvent("screen_view"); // log event with `screen_name` parameter attached
    analytics().logEvent("landing_page_view", { landing_at: Date.now() });
  });

That's all i have, i want to log when the user see the landing page, so I can use a Funnel ( I believe ) to track the process from Landing to Login page.

Do I have to create something in the Firebase Console to make this work ? documentation for web analytics is kind of messy..

Share Improve this question asked Aug 25, 2020 at 23:36 Unmy_Unmy_ 4851 gold badge6 silver badges17 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 14

In vast majority of cases the net::ERR_BLOCKED_BY_CLIENT means your adblocker blocks tracking. Here how it looks on the console:

Always disable adblockers when you do GTM/GA/Launch/AA/Tealium/Ensighten/Piwik/Matomo debugging/implementation.

This is how it typically looks on the Network tab: (blocked:other)

Note that (blocked:devtools) is not caused by an adblocker, but rather by the request blocking feature of devtools.

Also you say web analytics, and yet you use Firebase. Firebase is only viable as an SDK for use in native apps. I suggest using Google Analytics to track web hits even if it's mobile web.

Finally, since you're using React, I assume it's an SPA. In case of an SPA, you have to have a separate pageview tag in GTM that would be triggered by, say, a custom dataLayer event fired from your React app router on page change (Or in case of GA4, you have an option to make GTM GA4 tag listen to history changes). Then you can start building funnels.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1743704883a4493198.html

相关推荐

  • javascript - Firebase Analytics Googletagmanager Error - Stack Overflow

    I'm getting this error from Firebase, I added Analytics to my project today, and now the landing p

    6天前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信