Uncaught SyntaxError: Invalid or unexpected token magento 2 phtml

95 Views Asked by At

I am getting this error on the some pages, on the all pages this is working fine this is file.

<script>
  fbq('set', 'agent', '<?php echo $this->getFacebookAgentVersion() ?>', '<?php echo $this->getFacebookPixelID() ?>');
  fbq('track', 'ViewContent', {
    source: "<?php echo $this->getSource() ?>",
    version: "<?php echo $this->getMagentoVersion() ?>",
    pluginVersion: "<?php echo $this->getPluginVersion() ?>",
    content_type: "<?php echo $this->getContentType() ?>",
    content_ids: [<?php echo $this->getContentIDs() ?>]
    <?php if ($this->getContentName()) { ?>
      , content_name: "<?php echo $this->getContentName() ?>"
    <?php } ?>
    <?php if ($this->getContentCategory()) { ?>
      , content_category: "<?php echo $this->getContentCategory() ?>"
    <?php } ?>
    <?php if ($this->getValue() && $this->getCurrency()) { ?>
      , value: <?php echo $this->getValue() ?>
      , currency: "<?php echo $this->getCurrency() ?>"
    <?php } ?>
    }
    ,{
      eventID:  "<?php echo $eventId ?>"
    }
  );
</script>

These are the images of the error:

enter image description here

enter image description here

0

There are 0 best solutions below