-你好,
我正试图在我的Magento网站上设置这个该死的Google可信商店脚本。Google似乎希望我在每个页面中添加以下的javascript,并且每个页面只调用一个产品。这对于产品页面来说是可以的,但是我在其他页面上遇到了一些麻烦,比如分类页面。我想我可以以某种方式将脚本添加到template/catalog/product/list.phtml中,因此,我想知道是否可以将每个类别页面上的第一个产品列表添加到中?
有没有人知道如何像Google想要加入Magento那样添加脚本,或者是否有关于它的教程?
以下是:
<!-- BEGIN: Google Trusted Stores -->
<script type="text/javascript">
var gts = gts || [];
gts.push(["id", "xxxxxx"]);
gts.push(["google_base_offer_id", "<?php echo $this->htmlEscape($_product->getSku()) ?>"]);
gts.push(["google_base_subaccount_id", "xxxxxxxx"]);
gts.push(["google_base_country", "US"]);
gts.push(["google_base_language", "EN"]);
(function() {
var scheme = (("https:" == document.location.protocol) ? "https://" : "http://");
var gts = document.createElement("script");
gts.type = "text/javascript";
gts.async = true;
gts.src = scheme + "www.googlecommerce.com/trustedstores/gtmp_compiled.js";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(gts, s);
})();
</script>
<!-- END: Google Trusted Stores -->谢谢
发布于 2013-05-03 05:33:40
我真是个傻瓜,代码已经在谷歌可信商店模块中了。:)
https://stackoverflow.com/questions/16350742
复制相似问题