Blog

SOFTLOFT / Blog  / How Ads JS Script can break your checkout page

How Ads JS Script can break your checkout page

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

NEXT POST arrow