<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
?>
<?php
/**
 * @var $block \Magento\GoogleAdwords\Block\Code
 * @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer
 */
?>
<!-- Google Code for Sale Conversion Page -->
<?php
/** @var \Magento\GoogleAdwords\Helper\Data $helper */
$helper = $block->getHelper();
$scriptString = <<<script
    /* <![CDATA[ */
    var google_conversion_id = {$block->escapeJs($helper->getConversionId())};
    var google_conversion_language = "{$block->escapeJs($helper->getConversionLanguage())}";
    var google_conversion_format = "{$block->escapeJs($helper->getConversionFormat())}";
    var google_conversion_color = "{$block->escapeJs($helper->getConversionColor())}";
    var google_conversion_label = "{$block->escapeJs($helper->getConversionLabel())}";
    var google_conversion_value = {$block->escapeJs($helper->getConversionValue())};
script;
if ($helper->hasSendConversionValueCurrency() && $helper->getConversionValueCurrency()):
        $scriptString .= <<<script
    var google_conversion_currency = "{$block->escapeJs($helper->getConversionValueCurrency())}";
script;
endif;
$scriptString .= <<<script
    /* ]]> */
script;
?>
<?= /* @noEscape */ $secureRenderer->renderTag('script', [], $scriptString, false) ?>
<script src="<?= $block->escapeHtmlAttr($helper->getConversionJsSrc()) ?>"></script>
<noscript>
    <div style="display:inline;">
        <img height="1" width="1" style="border-style:none;" alt=""
             src="<?= $block->escapeHtmlAttr($helper->getConversionImgSrc()) ?>"/>
    </div>
</noscript>
<!-- END Google Code for Sale Conversion Page -->
