Woocommerce: When i post this script in the functions.php file it points to error, can you see whats wrong?

When i post this script in the functions.php file it points to error, can you see whats wrong?

<?php if(is_product()) {?>
<script>
analytics.track('Product Viewed', {
  'ecommerce': {
    'detail': {
      'products': [{
        'name': '<?php echo the_title(); ?>',
        'id': '<?php echo the_ID(); ?>',
        'brand': 'test',
      'category':'test'
       }]
     }
   }
});
</script>
<?php }?>

Read more here: Woocommerce: When i post this script in the functions.php file it points to error, can you see whats wrong?

Leave a Reply

Your email address will not be published. Required fields are marked *