<?php
/** @var \Magento\Framework\View\Element\Template $block */
/** @var \Dotdigitalgroup\Email\Helper\Data $helper */
?>
<?php $helper = $this->helper(\Dotdigitalgroup\Email\Helper\Data::class); ?>

<?php if (! in_array('checkout_onepage_success', $block->getLayout()->getUpdate()->getHandles()) ||
    ! $helper->isRoiTrackingEnabled()) : ?>
    <script>
        require.config({
            paths: {
                'dmpt':  "<?= $block->escapeUrl($helper->getPageTrackingUrl()) ?>"
           }
       });
    </script>
    <script type="text/x-magento-init">
        {
            "*": {
                "dmpt": {}
            }
        }
    </script>
<?php endif; ?>