MatteoGabriele / vue-gtag

Global Site Tag plugin for Vue (gtag.js)
https://matteo-gabriele.gitbook.io/vue-gtag/
MIT License
870 stars 67 forks source link

Something happened and gtag.js couldn't be loaded #54

Closed yooouuri closed 4 years ago

yooouuri commented 4 years ago

Description

"gtag.js couldn't be loaded"

image

Expected behavior

Is should load the gtag.js library.

Actual behavior

"gtag.js couldn't be loaded"

Environment

Using vue-gtag version 1.1.2.

  1. Operating system: Mac OS 10.15.2 (19C57)
  2. Browser and version: Google Chrome 79.0.3945.130

Reproducible Demo

Created empty vue project with vue create, added vue-gtag by using yarn add vue-gtag

main.ts

Vue.use(VueGtag, {
  config: { id: 'GTM-XXXXXX' },
});
MatteoGabriele commented 4 years ago

you are most likely using a browser with ad blockers or an extension to block ads.

yooouuri commented 4 years ago

image

Do not have any adblockers...

Can I use this library with a https://tagmanager.google.com/ account?

MatteoGabriele commented 4 years ago

@yooouuri can you try on a private window?

yooouuri commented 4 years ago

@MatteoGabriele private window (Chrome and Safari) same error...

I am using a https://tagmanager.google.com/ account, is it possible to use it?

MatteoGabriele commented 4 years ago

now that I see your http request, I think you are passing the wrong ID. you can use Google Analytics, Google Ads, and Google Marketing Platform.

yooouuri commented 4 years ago

Ah I need to use the https://tagmanager.google.com/ account.

Thanks for helping.

MatteoGabriele commented 4 years ago

@yooouuri no worries! cheers

ryexley commented 4 years ago

So what was the solution here? Does this lib not work with GTM-XXXXXXX accounts? @yooouuri did you have to use something other than vue-gtag?

MatteoGabriele commented 4 years ago

@ryexley I don't think that was made to accept GTM ids

ryexley commented 4 years ago

I was actually able to get it to load. My issue, having encountered the same error, was that I had not "published" the tag manager workspace related to the GTM ID that I was using. Once I published it, it started loading fine.

MatteoGabriele commented 4 years ago

ah! good to know :)

all-i-do-is-wynn2 commented 4 years ago

@ryexley - did you have to make any changes to the code? Our container is published and I am getting this error. image

ryexley commented 4 years ago

@all-i-do-is-wynn2 yes and no. We ultimately ended up moving away from using vue-gtag and just went with a custom implementation as we didn't really need the full integration with Vue. I'm sure that doesn't help you much though, sorry.

all-i-do-is-wynn2 commented 4 years ago

@ryexley - thank you for the insight and the quick response!

all-i-do-is-wynn2 commented 4 years ago

@MatteoGabriele - GTM ID does work. As a data analyst, if you have the "Preview" panel open at the bottom of the screen, it will throw the error in the console. Tell others to make sure that they close the Preview panel.

MatteoGabriele commented 4 years ago

Thanks a lot! Your comment here will help other people struggling with this one

tv-munchkinlabs commented 3 years ago

@MatteoGabriele Hello, my Google Optimize and GTag are both blocked by ad blocker. I do see you mentioned ad blocker, is there anyway to work around ad blockers?

MatteoGabriele commented 3 years ago

@MatteoGabriele Hello, my Google Optimize and GTag are both blocked by ad blocker. I do see you mentioned ad blocker, is there anyway to work around ad blockers?

I hope not 🤣