2014-11-02 44 views
0

我想在Facebook要求的<head>部分的結賬確認頁面上添加跟蹤像素。我用CS-Cart 3.0.6在CS-Cart中添加Facebook像素轉換代碼3

到目前爲止,與我在谷歌和論壇閱讀,我一定要添加腳本在

/skins/name_of_the_active_skin/customer/addons/my_changes/hooks/checkout/目錄。

因此,沒有我,與meta.post.tpl的namefile:

{hook name="checkout:order_confirmation"} 
    {literal} 
    <!-- Facebook Conversion Code for Paid --> 
    <script>(function() { 
    var _fbq = window._fbq || (window._fbq = []); 
    if (!_fbq.loaded) { 
    var fbds = document.createElement('script'); 
    fbds.async = true; 
    fbds.src = '//connect.facebook.net/en_US/fbds.js'; 
    var s = document.getElementsByTagName('script')[0]; 
    s.parentNode.insertBefore(fbds, s); 
    _fbq.loaded = true; 
    } 
    })(); 
    window._fbq = window._fbq || []; 
    window._fbq.push(['track', '928383727823', {'value':'{/literal}{$order_info.total}{literal}','currency':'USD'}]); 
    </script> 
    <noscript><img height="1" width="1" alt="" style="display:none" src="https://www.facebook.com/tr?ev=8283838383832&amp;cd[value]={/literal}{$order_info.total}{literal}&amp;cd[currency]=USD&amp;noscript=1" /></noscript> 
    {/literal} 
{/hook} 

它不工作。它是文件名嗎?你知道如何做到這一點?

回答

0

最後,因爲我無法找出如何使這項工作,我選擇不使用掛機系統(應該是不錯的,靈活的)和修改的文件skins/basic/customer/meta.tpl與JS snipet這個條件之間:

{if $smarty.request.dispatch=='checkout.complete'} 
...code... 
{/if} 

我想這會幫助一些CS-Cart用戶。