cancel
Showing results for 
Search instead for 
Did you mean: 

Google API not working

Google API not working

I have configured my Google API section for Google Analytics and Google Adwords in magento 2.3.4 CE

 

According to chrome tag assist there are no tags or analytics found to be on my website.

 

I did try placing the gtm code into html header scripts and I received audience data.  So I removed it again and configured my google api again and still no information found.

 

I am also getting several console errors relating to google analytics etc.

Error: Script error for: Magento_GoogleAnalytics/js/google-analytics
http://requirejs.org/docs/errors.html#scripterror
at makeError (require.js:166)
at HTMLScriptElement.onScriptError (require.js:1681)

 

Can anyone please help.

4 REPLIES 4

Re: Google API not working

Hi @JadeArtistry,

 

Can you try running below command on your server

1. php bin/magento setup:upgrade

2. php bin/magento setup:di:compile

3. php bin/magento setup:static-content:deploy -f

4. php bin/magento c:f

5. php bin/magento c:c

6.chmod 777 -R var/* generated/* pub/static

 

Hope this helps you!

Problem Solved! Click Kudos & Accept as Solution!

 

Hope this helps you!

Re: Google API not working

everything went fine up until the chmod line.  Can I do this manually?  Which folders exactly should be set to 777 permissions?

 

Also I'm getting a Failed to load resource: net::ERR_BLOCKED_BY_CLIENT for the Magento_GoogleAnalytics/js/google-analytics.js 

 

Google API still not working, no tags detected.

Re: Google API not working

Hi @JadeArtistry ,

 

We need 777 permission for var/ generated/ pub/static folders.

 

And can you confirm do you face same issue in some other browser as well(firefox)

Sometime we might have installed some adblocker extension. Please confirm you dont have such extension in your browser.

https://stackoverflow.com/questions/9618818/google-analytics-failed-to-load-resource-http-www-google...

 

Hope this helps you!

Problem Solved! Click Kudos & Accept as Solution!

Re: Google API not working

Hello, I've got the same issue.

Here it is my backend screenshot: Link to screenshot 

I've 3 different language and store and i can't associate the right UA ID to each.