magepal / magento2-google-tag-manager

Google Tag Manager is a user-friendly, yet powerful and cost-effective solution that is a must-have integration for every Magento store. It simplifies the process of adding and managing third-party JavaScript tags. With dozens of custom events and hundreds of data points our extensions the #1 GTM solution for Magento.

Home Page:https://www.magepal.com/google-tag-manager.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

On checkout page i am also getting the 404 error for js - magepalGtmDatalayer.js

RavindraGharge opened this issue · comments

Please Help I enable got processed the checkout after installing this module. Please revert Thanks

See Header :

Request URL:http://local.unicorn.com/pub/static/frontend/Custom/goshop/en_US/magepalGtmDatalayer.js
Request Method:GET
Status Code:404 Not Found
Remote Address:127.0.0.1:80
Referrer Policy:no-referrer-when-downgrade
Response Headers

im getting this message everywhere. that file does not exist

actually its on product and category pages, cms pages seem to be ok

@tomdollarmpd ... I'm sure why but the path is not correct it should be

pub/static/version1502363716/frontend/Custom/goshop/en_US/MagePal_GoogleTagManager/js/datalayer.js

What mode is your store in Default, Developer, or Production?

it's in production mode. I can see the file has been created correctly as you say;

/pub/static/frontend/[name space]/[theme]/en_GB/MagePal_GoogleTagManager/js/datalayer.js

But for some reason it is trying to load;

/pub/static/frontend/[name space]/[theme]/en_GB/magepalGtmDatalayer.js

The requirejs-config.js looks good;

magepalGtmDatalayer: 'MagePal_GoogleTagManager/js/datalayer'

So not sure why its trying to get the wrong file

ok this is weird. That error is only present in chrome developer tools. Firebug in Firefox resolves to the correct file. But it's making chrome hang for nearly 5 seconds while it tries to resolve it

Hello,
Just found your comments trying so resolve mine. I got a 404 error page when trying to place an order. I did not installed any kind of module.., its fresh new install magento 2.1.8 and theme..and get the error on any browser! I just do not have any clue what is happening! Any ideeas?:(

@qwqwqalexalex237 ... Did you try placing an order with this module disabled?

I did not installed any module for checkout! That is why is very strange for me this issue...

@qwqwqalexalex237 srenon says that disable Magepal module and then try to place an order. Do you still get a 404 error?

I have the same issue.
going to the checkout i get these errors in the console:

GET https://store.nl/pub/static/frontend/Alothemes/default/en_US/magepalGtmDatalayer.min.js 
req.load @ b29045b891b5069030d7bc7790140722.min.js:120
require.load @ b29045b891b5069030d7bc7790140722.min.js:185
load @ b29045b891b5069030d7bc7790140722.min.js:112
require.s.contexts._.load @ b29045b891b5069030d7bc7790140722.min.js:134
load @ b29045b891b5069030d7bc7790140722.min.js:55
fetch @ b29045b891b5069030d7bc7790140722.min.js:55
check @ b29045b891b5069030d7bc7790140722.min.js:56
enable @ b29045b891b5069030d7bc7790140722.min.js:73
enable @ b29045b891b5069030d7bc7790140722.min.js:101
(anonymous) @ b29045b891b5069030d7bc7790140722.min.js:73
(anonymous) @ b29045b891b5069030d7bc7790140722.min.js:11
each @ b29045b891b5069030d7bc7790140722.min.js:3
enable @ b29045b891b5069030d7bc7790140722.min.js:71
init @ b29045b891b5069030d7bc7790140722.min.js:54
(anonymous) @ b29045b891b5069030d7bc7790140722.min.js:97
setTimeout (async)
(anonymous) @ b29045b891b5069030d7bc7790140722.min.js:117
localRequire @ b29045b891b5069030d7bc7790140722.min.js:97
window.require @ b29045b891b5069030d7bc7790140722.min.js:200
init @ VM9751:2
(anonymous) @ VM9751:6
_.each._.forEach @ VM9753:8
(anonymous) @ VM9751:5
apply @ VM9751:5
fire @ VM9741:213
add @ VM9741:216
jQuery.fn.ready @ VM9741:224
jQuery.fn.init @ VM9741:201
jQuery.fn.init @ VM9783:28
jQuery @ VM9741:17
(anonymous) @ VM9768:2
execCb @ b29045b891b5069030d7bc7790140722.min.js:112
check @ b29045b891b5069030d7bc7790140722.min.js:56
(anonymous) @ b29045b891b5069030d7bc7790140722.min.js:72
(anonymous) @ b29045b891b5069030d7bc7790140722.min.js:11
(anonymous) @ b29045b891b5069030d7bc7790140722.min.js:74
each @ b29045b891b5069030d7bc7790140722.min.js:3
emit @ b29045b891b5069030d7bc7790140722.min.js:74
check @ b29045b891b5069030d7bc7790140722.min.js:61
(anonymous) @ b29045b891b5069030d7bc7790140722.min.js:72
(anonymous) @ b29045b891b5069030d7bc7790140722.min.js:11
(anonymous) @ b29045b891b5069030d7bc7790140722.min.js:74
each @ b29045b891b5069030d7bc7790140722.min.js:3
emit @ b29045b891b5069030d7bc7790140722.min.js:74
check @ b29045b891b5069030d7bc7790140722.min.js:61
enable @ b29045b891b5069030d7bc7790140722.min.js:73
init @ b29045b891b5069030d7bc7790140722.min.js:54
(anonymous) @ b29045b891b5069030d7bc7790140722.min.js:66
(anonymous) @ b29045b891b5069030d7bc7790140722.min.js:11
(anonymous) @ b29045b891b5069030d7bc7790140722.min.js:193
execCb @ b29045b891b5069030d7bc7790140722.min.js:112
check @ b29045b891b5069030d7bc7790140722.min.js:56
(anonymous) @ b29045b891b5069030d7bc7790140722.min.js:72
(anonymous) @ b29045b891b5069030d7bc7790140722.min.js:11
(anonymous) @ b29045b891b5069030d7bc7790140722.min.js:74
each @ b29045b891b5069030d7bc7790140722.min.js:3
emit @ b29045b891b5069030d7bc7790140722.min.js:74
check @ b29045b891b5069030d7bc7790140722.min.js:61
(anonymous) @ b29045b891b5069030d7bc7790140722.min.js:72
(anonymous) @ b29045b891b5069030d7bc7790140722.min.js:11
(anonymous) @ b29045b891b5069030d7bc7790140722.min.js:74
each @ b29045b891b5069030d7bc7790140722.min.js:3
emit @ b29045b891b5069030d7bc7790140722.min.js:74
check @ b29045b891b5069030d7bc7790140722.min.js:61
enable @ b29045b891b5069030d7bc7790140722.min.js:73
init @ b29045b891b5069030d7bc7790140722.min.js:54
(anonymous) @ b29045b891b5069030d7bc7790140722.min.js:66
(anonymous) @ b29045b891b5069030d7bc7790140722.min.js:11
(anonymous) @ b29045b891b5069030d7bc7790140722.min.js:193
execCb @ b29045b891b5069030d7bc7790140722.min.js:112
check @ b29045b891b5069030d7bc7790140722.min.js:56
(anonymous) @ b29045b891b5069030d7bc7790140722.min.js:72
(anonymous) @ b29045b891b5069030d7bc7790140722.min.js:11
(anonymous) @ b29045b891b5069030d7bc7790140722.min.js:74
each @ b29045b891b5069030d7bc7790140722.min.js:3
emit @ b29045b891b5069030d7bc7790140722.min.js:74
check @ b29045b891b5069030d7bc7790140722.min.js:61
(anonymous) @ b29045b891b5069030d7bc7790140722.min.js:72
(anonymous) @ b29045b891b5069030d7bc7790140722.min.js:11
(anonymous) @ b29045b891b5069030d7bc7790140722.min.js:74
each @ b29045b891b5069030d7bc7790140722.min.js:3
emit @ b29045b891b5069030d7bc7790140722.min.js:74
check @ b29045b891b5069030d7bc7790140722.min.js:61
enable @ b29045b891b5069030d7bc7790140722.min.js:73
init @ b29045b891b5069030d7bc7790140722.min.js:54
(anonymous) @ b29045b891b5069030d7bc7790140722.min.js:62
(anonymous) @ b29045b891b5069030d7bc7790140722.min.js:11
(anonymous) @ b29045b891b5069030d7bc7790140722.min.js:74
each @ b29045b891b5069030d7bc7790140722.min.js:3
emit @ b29045b891b5069030d7bc7790140722.min.js:74
check @ b29045b891b5069030d7bc7790140722.min.js:61
enable @ b29045b891b5069030d7bc7790140722.min.js:73
init @ b29045b891b5069030d7bc7790140722.min.js:54
(anonymous) @ b29045b891b5069030d7bc7790140722.min.js:66
(anonymous) @ b29045b891b5069030d7bc7790140722.min.js:11
text.load @ b29045b891b5069030d7bc7790140722.min.js:186
(anonymous) @ b29045b891b5069030d7bc7790140722.min.js:71
(anonymous) @ b29045b891b5069030d7bc7790140722.min.js:11
on @ b29045b891b5069030d7bc7790140722.min.js:40
callPlugin @ b29045b891b5069030d7bc7790140722.min.js:61
fetch @ b29045b891b5069030d7bc7790140722.min.js:55
check @ b29045b891b5069030d7bc7790140722.min.js:56
enable @ b29045b891b5069030d7bc7790140722.min.js:73
(anonymous) @ b29045b891b5069030d7bc7790140722.min.js:63
(anonymous) @ b29045b891b5069030d7bc7790140722.min.js:11
(anonymous) @ b29045b891b5069030d7bc7790140722.min.js:74
each @ b29045b891b5069030d7bc7790140722.min.js:3
emit @ b29045b891b5069030d7bc7790140722.min.js:74
check @ b29045b891b5069030d7bc7790140722.min.js:61
(anonymous) @ b29045b891b5069030d7bc7790140722.min.js:72
(anonymous) @ b29045b891b5069030d7bc7790140722.min.js:11
(anonymous) @ b29045b891b5069030d7bc7790140722.min.js:74
each @ b29045b891b5069030d7bc7790140722.min.js:3
emit @ b29045b891b5069030d7bc7790140722.min.js:74
check @ b29045b891b5069030d7bc7790140722.min.js:61
enable @ b29045b891b5069030d7bc7790140722.min.js:73
init @ b29045b891b5069030d7bc7790140722.min.js:54
callGetModule @ b29045b891b5069030d7bc7790140722.min.js:74
completeLoad @ b29045b891b5069030d7bc7790140722.min.js:103
onScriptLoad @ b29045b891b5069030d7bc7790140722.min.js:112
b29045b891b5069030d7bc7790140722.min.js:16
 Uncaught Error: Script error for: magepalGtmDatalayer
http://requirejs.org/docs/errors.html#scripterror
    at makeError (b29045b891b5069030d7bc7790140722.min.js:16)
    at HTMLScriptElement.onScriptError (b29045b891b5069030d7bc7790140722.min.js:112)
makeError @ b29045b891b5069030d7bc7790140722.min.js:16
onScriptError @ b29045b891b5069030d7bc7790140722.min.js:112

And then the checkout goes into an endless loading loop.
If I turn the plugin off the checkout works like normal.

@erik921 ... are you using a third party to minify js since it is adding ...min.js (pub/static/frontend/Alothemes/default/en_US/magepalGtmDatalayer.min.js?

@sreonon We minify js through magento itself.

I had the same issue today. And this was causing my checkout page to freeze/load forever due to a javascript crash.

Turns out that my CDN was still serving an old merged .js file from before my installation of this module. I noticed that by deactivating the "Merge JS" or "Bundle JS" options in the configuration, which was fixing the issue.
It is confusing to derive because in this situation (production with JS merging) this file magepalGtmDatalayer.min.js is not supposed to exist , but also not supposed to be requested.

In the end I simply invalidated my CDN's data and it started working right away:
The file magepalGtmDatalayer.min.js is not requested anymore since I assume it is already merged, but the module is still clearly working.