ga.phtml 1.0 KB

1234567891011121314151617181920212223242526
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. // @codingStandardsIgnoreFile
  7. ?>
  8. <?php /** @var $block \Magento\GoogleAnalytics\Block\Ga */ ?>
  9. <?php $accountId = $block->getConfig(\Magento\GoogleAnalytics\Helper\Data::XML_PATH_ACCOUNT) ?>
  10. <!-- BEGIN GOOGLE ANALYTICS CODE -->
  11. <script type="text/x-magento-init">
  12. {
  13. "*": {
  14. "Magento_GoogleAnalytics/js/google-analytics": {
  15. "isCookieRestrictionModeEnabled": <?= (int)$block->isCookieRestrictionModeEnabled() ?>,
  16. "currentWebsite": <?= (int)$block->getCurrentWebsiteId() ?>,
  17. "cookieName": "<?= /* @escapeNotVerified */ \Magento\Cookie\Helper\Cookie::IS_USER_ALLOWED_SAVE_COOKIE ?>",
  18. "ordersTrackingData": <?= /* @escapeNotVerified */ json_encode($block->getOrdersTrackingData()) ?>,
  19. "pageTrackingData": <?= /* @escapeNotVerified */ json_encode($block->getPageTrackingData($accountId)) ?>
  20. }
  21. }
  22. }
  23. </script>
  24. <!-- END GOOGLE ANALYTICS CODE -->