Jump to content

Add the dynamic remarketing tag into prestashop


Recommended Posts

Hi to all!

google has update new remarketing tag script and I'm tring to integrate it with prestashop.

the prestashop version currently I'm using is 1.4

 

after some tests and I disabled the ccc compression and I insert the code above (that work fine)

  {literal}
  <script type="text/javascript">
var google_tag_params = {
ecomm_prodid: '{/literal}{$product->id|intval}{literal}',
ecomm_pagetype: 'product',
ecomm_totalvalue: '{/literal}{$product->getPrice(true, $smarty.const.NULL, 2)}{literal}',
};
</script>
{/literal}
    
     <script type="text/javascript">
     {literal} 
/* <![CDATA[ */
var google_conversion_id = 995392743;
var google_custom_params = window.google_tag_params;
var google_remarketing_only = true;
google_conversion_format = 3;
/* ]]> */
{/literal}
</script>

{literal}<script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">
</script>{/literal}
{literal}
<noscript>{/literal}
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="//googleads.g.doubleclick.net/pagead/viewthroughconversion/995392743/?value=0&guid=ON&script=0"/>
</div>{literal}
</noscript>
{/literal}

the code have to be insert before the </body> in the footer.tpl

 

you can see an example in this page

 

there is only one problem: ecomm_pagetype is static because I can't find the way to understand using smarty what kind of page the user are visiting.

 

If some one know how to find it, we can improve my solution (in the db there is the table ps_page_type)

 

Matteo

  • Like 2
Link to comment
Share on other sites

  • 4 months later...
  • 1 year later...
×
×
  • Create New...