Wan*_*Van 8 facebook pixel schema.org
我创建了 Facebook Pixel,连接良好。当我运行调试工具时,它会选择示例项目并列出它们,但是一旦我尝试将目录连接到像素,它就会显示像素尚未准备好。下面是代码:
<?php
$current_url = base64_encode($url="http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
$results = $mysqli->query("SELECT products.id,products.image,products.name,products.description, product_variant.discounted_price, product_variant.price FROM products LEFT JOIN product_variant ON products.id = product_variant.product_id where subcategory_id = 41 ORDER BY id ASC LIMIT 12");
if ($results) {
//fetch results set as object and output HTML
while($obj = $results->fetch_object()) {
$a = $obj->price;
$b = $obj->discounted_price;
$epsilon = 0;
if(!$b == $epsilon) {
$price = number_format($b,0);
} else {
$price = number_format($a,0);
}
//Microdata Tags
echo '<div itemscope itemtype="http://schema.org/Product">
<meta itemprop="brand" content="'.$obj->made_in.'">
<meta itemprop="name" content="'.$obj->name.'">
<meta itemprop="description" content="'.$obj->description.'">
<meta itemprop="productID" content="'.$obj->id.'">
<meta itemprop="url" content="https://mgcmax.com/single.php?id='.$obj->id.'">
<meta itemprop="image" content="https://www.vendor.mgcmax.com/'.$obj->image.'">
<div itemprop="value" itemscope itemtype="http://schema.org/PropertyValue">
<span itemprop="propertyID" content="item_group_id"></span>
<meta itemprop="value" content="Electroics"></meta>
</div>
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<link itemprop="availability" href="http://schema.org/InStock">
<link itemprop="itemCondition" href="http://schema.org/NewCondition">
<meta itemprop="product:category" content="888">
<meta itemprop="price" content="'.$price.'">
<meta itemprop="priceCurrency" content="UGX">
</div>
</div>';
}
}
?>
Run Code Online (Sandbox Code Playgroud)
尽管调试正常,但像素无法连接可能会缺少什么?
小智 0
这里有同样的问题,像素帮助工具和微数据调试器都显示一切正常,FB 业务套件中的几个诊断工具也是如此。
但是,由于某种原因,目录无法连接,并给出“未就绪”错误。
我还可以确认它与 google_product_category 警告无关。
您可以通过添加以下内容来消除该警告:
<meta itemprop="category" content="xxxx" />
Run Code Online (Sandbox Code Playgroud)
正如您已经清楚知道的那样,带有“item_group_id”的项目是 facebook 类别。
归档时间: |
|
查看次数: |
1199 次 |
最近记录: |