Google跟踪代码管理器:解析错误。 “,”预期

时间:2019-12-20 19:15:50

标签: javascript google-tag-manager facebook-pixel

我想将此Facebook像素代码保存在Google跟踪代码管理器中。但是,JavaScript编译器每次都会返回此错误:

  

第14行的错误,字符71:解析错误。 ','预期。

我花了很多时间试图解决这个问题,但我没有。我将非常感谢您为解决此问题提供的所有帮助。谢谢!

<!-- Facebook Pixel Code -->
<script>
!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,
document,'script','https://connect.facebook.net/en_US/fbevents.js');

fbq('init', '579694185890697');
fbq('set','agent','tmgoogletagmanager', '579694185890697');
fbq('track', "PageView");
fbq('track', 'ViewContent', { 
      content_type: 'vehicle', // REQUIRED: DO NOT change this, must be set to 'vehicle'
      content_ids: [$("[itemprop=vehicleIdentificationNumber]").text();],
      make: $("[itemprop=manufacturer]").text();, // RECOMMENDED 
      model: $("[itemprop=model]").text();, // RECOMMENDED 
      year: $("[itemprop=vehicleModelDate]").text();, // RECOMMENDED 
      state_of_vehicle: $("[itemprop=itemCondition]").text();, // RECOMMENDED 
      exterior_color: $("[itemprop=vehicleIdentificationNumbercolor]") 
      transmission:  $("[itemprop=vehicleTransmission]").text();, 
      price: $("[itemprop=price]").text();, // RECOMMENDED, up to 2 decimals optional 
      currency: 'USD' // REQUIRED: if price and preferred_price_range is used 
});  
</script>
<noscript><img height="1" width="1" style="display:none"
src="https://www.facebook.com/tr?id=579694185890697&ev=PageView&noscript=1"
/></noscript>
<!-- End Facebook Pixel Code -->

0 个答案:

没有答案