Не получается настроить сабж (параметры dynx_itemid или ecomm_prodid). По сети гуляет рабочий код для opencart 1.5:
<!-- Google Remarketing -->
<?php
if (! isset ($this->request->get['route'])) {
$ecomm_prodid=0;
$ecomm_pagetype = "home";
$ecomm_totalvalue=0;
}
else {
if ($this->request->get['route'] == 'product/category') {
$ecomm_pagetype = "category";
}
elseif ($this->request->get['route'] == 'product/product'){
$ecomm_pagetype = "product";
}
elseif ($this->request->get['route'] == 'checkout/cart'){
$ecomm_pagetype = "cart";
}
elseif ($this->request->get['route'] == 'checkout/success'){
$ecomm_pagetype = "purchase";
}
elseif ($this->request->get['route'] == ''){
$ecomm_pagetype = "home";
}
elseif ($this->request->get['route'] == 'common/home'){
$ecomm_pagetype = "home";
}
else {
$ecomm_pagetype = "siteview";
}
?>
<?php
if (isset($this->request->get['product_id'])) {
$Id=$this->request->get['product_id'];
$product_info = $this->model_catalog_product->getProduct($Id);
$product_id = $Id;
If ($product_info['special'] > 0)
$price = $product_info['special'];
else
$price = $product_info['price'];
} else {
$product_id = 0;
}
if ($this->request->get['route'] == 'product/product') {
$ecomm_prodid = $this->request->get['product_id'];
}
else{
$ecomm_prodid = "";
}
$ecomm_totalvalue=0;
if ($this->request->get['route'] == 'product/product') {
$ecomm_prodid = $product_id;
$ecomm_totalvalue = $price;
}
elseif ($this->request->get['route'] == 'checkout/cart'){
$ecomm_totalvalue = round($this->cart->getTotal(),2);
}
}
?>
<!--
Dynamic Remarketing Tag --
//-->
<script type="text/javascript">
var google_tag_params = {
ecomm_prodid: '<?php echo $ecomm_prodid; ?>',
ecomm_pagetype: '<?php echo $ecomm_pagetype; ?>',
ecomm_totalvalue: '<?php echo $ecomm_totalvalue; ?>',
};
</script>
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = xxxxxxxxx;
var google_custom_params = window.google_tag_params;
var google_remarketing_only = true;
/* ]]> */
</script>
<script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="//googleads.g.doubleclick.net/pagead/viewthroughconversion/xxxxxxxxx/?value=0&guid=ON&script=0"/>
</div>
</noscript>
<!-- End Google Remarketing -->
Настроил его на двух своих сайтах (OC 1,5) - все ок. Но на сайте с OpenCart 2.0 не фурычит. Подскажите, что нужно переделать, чтобы заработало?