[Skip to main content](#vessel-content)

#   Facebook Tracking Code

##

- **[rafael\_josem](/forum/user/33123-rafael-josem "View rafael&#95;josem's Profile")**
- [![rafael&#95;josem's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/33123-rafael-josem "View rafael&#95;josem's Profile") Topic Author
- [ Offline](/forum/user/33123-rafael-josem)

Less More

- Posts: 4
- Thank you received: 0
-
-

12 years 4 months ago -  12 years 4 months ago [\#162183](#162183) by [rafael\_josem](/forum/user/33123-rafael-josem "View rafael&#95;josem's Profile")  *[Facebook Tracking Code](/forum/27-checkout/869346-facebook-tracking-code#162183 "-- url of the page with the problem -- :   epensare.com/  -- HikaShop version -- : 2.3.1 -- Joomla version -- : 3.3.1 -- PHP version -- : 5.4.28 -- Browser(s) name and version -- : Chrome 35.0 -- Error-message(debug-mod must be tuned on) -- :N/A  Hello  I would like to know how to add this facebook tracking code at the end of check out:  In the line: window.&#95;fbq.push(); the &quot;value&quot; must be the price of the item that was purchased by the user. Also, this code must be placed between the head tags of the site.  I'm using bank transfer and Paypal as payment methods.  Thanks,  RJ")* was created by *[rafael\_josem](/forum/user/33123-rafael-josem "View rafael&#95;josem's Profile")*

-- url of the page with the problem -- : [ epensare.com/](http://epensare.com/)
-- HikaShop version -- : 2.3.1
-- Joomla version -- : 3.3.1
-- PHP version -- : 5.4.28
-- Browser(s) name and version -- : Chrome 35.0
-- Error-message(debug-mod must be tuned on) -- :N/A

Hello

I would like to know how to add this facebook tracking code at the end of check out:
Code:

&lt;!-- Facebook Conversion Code for Compras Pensare --&gt; &lt;script&gt;(function() { var _fbq = window._fbq &#124;&#124; (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 &#124;&#124; []; window._fbq.push(['track', '123456789', {'value':'0.00','currency':'USD'}]); &lt;/script&gt; &lt;noscript&gt;&lt;img height="1" width="1" alt="" style="display:none" src="https://www.facebook.com/tr?ev=123456789&amp;amp;cd[value]=0.00&amp;amp;cd[currency]=USD&amp;amp;noscript=1" /&gt;&lt;/noscript&gt;

In the line: **window.\_fbq.push();** the "value" must be the price of the item that was purchased by the user. Also, this code must be placed between the head tags of the site.

I'm using bank transfer and Paypal as payment methods.

Thanks,

RJ

Last edit: 12 years 4 months ago by [rafael\_josem](/forum/user/33123-rafael-josem "View rafael&#95;josem's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg2OTM0Ni1mYWNlYm9vay10cmFja2luZy1jb2RlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86290
- Thank you received: 14268
-
-

12 years 3 months ago [\#162188](#162188) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Facebook Tracking Code](/forum/27-checkout/869346-facebook-tracking-code#162188 "-- url of the page with the problem -- :   epensare.com/  -- HikaShop version -- : 2.3.1 -- Joomla version -- : 3.3.1 -- PHP version -- : 5.4.28 -- Browser(s) name and version -- : Chrome 35.0 -- Error-message(debug-mod must be tuned on) -- :N/A  Hello  I would like to know how to add this facebook tracking code at the end of check out:  In the line: window.&#95;fbq.push(); the &quot;value&quot; must be the price of the item that was purchased by the user. Also, this code must be placed between the head tags of the site.  I'm using bank transfer and Paypal as payment methods.  Thanks,  RJ")*

Hi,

You want to add such code in the "end" file of the view "checkout" via the menu Display&gt;Views: Code:

$app = JFactory::getApplication(); $order_id = $app-&gt;getUserState('com_hikashop.order_id'); $orderClass = hikashop_get('class.order'); $order = $orderClass-&gt;loadFullOrder($order_id,false,false); $js ="(function() { var _fbq = window._fbq &#124;&#124; (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 &#124;&#124; []; window._fbq.push(['track', '123456789', {'value':'".round($order-&gt;order_full_price,2)."','currency':'USD'}]);"; $doc = JFactory::getDocument(); $doc-&gt;addScriptDeclaration($js);

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg2OTM0Ni1mYWNlYm9vay10cmFja2luZy1jb2RlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[rafael\_josem](/forum/user/33123-rafael-josem "View rafael&#95;josem's Profile")**
- [![rafael&#95;josem's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/33123-rafael-josem "View rafael&#95;josem's Profile") Topic Author
- [ Offline](/forum/user/33123-rafael-josem)

Less More

- Posts: 4
- Thank you received: 0
-
-

12 years 3 months ago [\#162259](#162259) by [rafael\_josem](/forum/user/33123-rafael-josem "View rafael&#95;josem's Profile")  Replied by *[rafael\_josem](/forum/user/33123-rafael-josem "View rafael&#95;josem's Profile")* on topic *[Facebook Tracking Code](/forum/27-checkout/869346-facebook-tracking-code#162259 "-- url of the page with the problem -- :   epensare.com/  -- HikaShop version -- : 2.3.1 -- Joomla version -- : 3.3.1 -- PHP version -- : 5.4.28 -- Browser(s) name and version -- : Chrome 35.0 -- Error-message(debug-mod must be tuned on) -- :N/A  Hello  I would like to know how to add this facebook tracking code at the end of check out:  In the line: window.&#95;fbq.push(); the &quot;value&quot; must be the price of the item that was purchased by the user. Also, this code must be placed between the head tags of the site.  I'm using bank transfer and Paypal as payment methods.  Thanks,  RJ")*

Hello,

it didnt work in the "end" file but it did work in the "after end"

Thanks.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg2OTM0Ni1mYWNlYm9vay10cmFja2luZy1jb2RlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop- Install &amp; Update- Product &amp; Category Display- Content Creation- Sales and Orders- - Orders management- - Reports &amp; Statistics- Customers- Checkout- Payment Methods- Shipping Methods- Import &amp; Export (CSV, XLS…)- Specific Features- - Affilation- - Taxes- - Wishlist- - Vote- - Carousel &amp; Slider- - Mass Actions- - Filters &amp; Search- - Discount &amp; Coupon- - Feature Request- Integrations- Showcase- General Talk about HikaShop- Development- - HikaShop 3.0 Beta- Translation- Commercial Jobs HikaShop Components- HikaMarket- - Market: Feature requests- - Market: How to?- - Market: Bug Report- HikaSerial- - General talk about HikaSerial- - Serial: Bug Report- - Serial: How to?- - Support en Français de HikaSerial (French Support)- - HikaSubscription- HikaAuction- - Auction: Feature requests- - Auction: How to?- - Auction: Bug report Hikashop around the world- Support en Français (French Support)- Russian- - FAQ. Курс выживания с Hikashop. Частые вопросы и о- - Расширения Hikashop- - Наши сайты на Hikashop- 日本語版サポート(Japanese Support)- Thai- German Archives- Bug Report- How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.224 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)

[](#top)
