magento - 增强型电子商务 - Magento 产品点击
问题描述
您好,我在 GA 上启用了增强型电子商务,并使用 select_content 来跟踪产品点击。
select_content 是实时显示的,但是当我点击它时什么都没有显示。
这是我的代码
<?php
$sku ="";
$productname ="";
$productcategory ="";
$current_product = Mage::registry('current_product');
$_category_detail=Mage::registry('current_category');
if($current_product) {
$sku = $current_product->getSku();
$productname = $current_product->getName();
$productcategory = $_category_detail->getName();;
}
?>
<script>
gtag('event', 'select_content', {
"content_type": "product",
"items": [
{
"id": "<?php echo $sku; ?>",
"name": "<?php echo $productname; ?>",
"list_name": "Search Results",
"category": "<?php echo $productcategory; ?>"
}
]
});
</script>
事件类别显示为参与,事件操作显示为 select_content。当我点击参与时 - 操作是 select_content 并且事件标签是产品。没有产品列表。
有人可以帮忙吗?
解决方案
推荐阅读
- android - 用户消息平台:重置同意
- macos - Docker(compose v3)静态IP,不绑定到本地主机 - Mac
- python - 为什么 file.read() 在 python 中返回 ''
- python - 无法在 python 中加载 facenet_keras.h5 模型
- php - 我无法按我的意愿显示程序
- python - 从python中的日期转换的一天、一周和一个月的分数
- javascript - 如何制作 3D 光滑滑块
- apache - 如何使用 Telnet 发送 HTTP 请求?
- reactjs - 我收到此错误,我不知道该怎么办,“TypeError:render is not a function”
- angular - 如何使用 Angular 11 在 ngFor 中设置临时变量?