Closed ChrHartwig closed 4 years ago
@Neusta-Hartwig ... Could you try adding ''mage/cookies','
define([
'Magento_Customer/js/customer-data',
'jquery',
'mage/cookies',
'underscore'
],
MagePal/GoogleTagManager/view/frontend/web/js/datalayer.js
@srenon
thx for your fix. The order of the params is important, so the final fix is:
define([ 'Magento_Customer/js/customer-data', 'jquery', 'underscore', 'mage/cookies' ]
Thank you
@Neusta-Hartwig ... Yea, I realize that I params was in the wrong order and already fixed it. This fix will be included in the next release.
Thanks for letting us know!
Magento version #:
2.2.9
Edition (EE, CE, OS, etc):
CE
Expected behavior:
No JS-Errors on Pageload
Actual behavior:
Get following JS Error: datalayer.js:69 Uncaught TypeError: Cannot read property 'get' of undefined at isTrackingAllowed (datalayer.js:69) at datalayer.js:107 at main.js:31 at Object.execCb (require.js:1650) at Module.check (require.js:866) at Module. (require.js:1113)
at require.js:132
at require.js:1156
at each (require.js:57)
at Module.emit (require.js:1155)
-> $.mage.cookies.get is undefined in this case
Preconditions
Steps to reproduce:
Important: This only happens with Varnish. This does not happens with Magento's built in cache.