<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

/**
 * @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer
 */
?>

<?= /* @noEscape */ $secureRenderer->renderTag(
    'script',
    [
        'src' => $block->getTrackingUrl(),
        'async' => true,
    ],
    '&nbsp;',
    false
) ?>

<?php
/** @var \Magento\AdminAnalytics\ViewModel\Metadata $metadata */
$metadata = $block->getMetadata();
$scriptString = '
    var adminAnalyticsMetadata = {
        "secure_base_url": "' . $block->escapeJs($metadata->getSecureBaseUrlForScope()) . '",
        "version": "' . $block->escapeJs($metadata->getMagentoVersion()) . '",
        "product_edition": "' . $block->escapeJs($metadata->getProductEdition()) . '",
        "user": "' . $block->escapeJs($metadata->getCurrentUser()) . '",
        "mode": "' . $block->escapeJs($metadata->getMode()) . '",
        "store_name_default": "' . $block->escapeJs($metadata->getStoreNameForScope()) . '",
        "admin_user_created": "' . $block->escapeJs($metadata->getCurrentUserCreatedDate()) . '",
        "admin_user_logdate": "' . $block->escapeJs($metadata->getCurrentUserLogDate()) . '",
        "admin_user_role_name": "' . $block->escapeJs($metadata->getCurrentUserRoleName()) . '"
    };
';
?>
<?= /* @noEscape */ $secureRenderer->renderTag('script', [], $scriptString, false); ?>
