Blog
How Ads JS Script can break your checkout page
May 29, 2020
JS. Errors
Advertising and custom scripts that tracking and send data to an external service like Google Analytics and etc. For example, GMT may break the checkout page.
Causes
– incorrect data was transferred to the script (not an escaped character, incorrect encoding, there is no data, but the function must have 100%)
– function/script does not exist or deprecated
Decision
wrap functions in try/catch, display error information in the console or to use special error handling service, so, just add an if check (typeof ADT.Tag.doEvent === ‘function’) – the function exists
ADT.Tag.doEvent === 'function') { <script> try { var ADT = ADT || {}; ADT.Tag = ADT.Tag || {}; if (typeof ADT.Tag.doEvent === 'function') { ADT.Tag.doEvent(); } } catch (e) { } </script>
SOFT LOFT Services
Has been trouble happened with checkout? Magento Support
Need ecommerce developers' help?
Contact an expert