1

I am trying to add Facebook conversion tracking but i cannot find the following file success.phtml

The right path it should be this one: app/design/frontent/default/default/template/checkout/success.phtml - I couldn’t find.

Any idea?

1

6 Answers 6

2

The easiest way to do this is in template\checkout\success.phtml, (pls note in your local package)

 
$order = Mage::getModel('sales/order')->loadByIncrementId($this->getOrderId()); 

(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', 'XXXXXXXXXX', {'value':'getBaseGrandTotal() ?>','currency':'GBP'}]);

or simply use any extensions like https://www.scommerce-mage.com/magento-facebook-conversion-audience-tracking.html

1

Please have a look at app/design/frontend/base/default/template/checkout/ as it is the 'new' directory where you find Magento's default template files. Nevertheless Magento would also look at your directory.

Have a look at http://www.magentocommerce.com/knowledge-base/entry/magentos-theme-hierarchy to get an understanding of the theme mechanism.

1
  • Thanks ... i found it .. i installed facebook tracking but take a look something went wrong store.sottile.tv Ho can install properly ?
    – Paololee
    Dec 23, 2014 at 17:54
1

Copy success.phtml from /frontend/base/default/template/checkout/ to /frontend/defaul/default/template/checkout/

Also have a look at the below post for putting facebook conversion code in the head section for effectiveness

https://stackoverflow.com/questions/23244945/facebook-conversion-tracking-in-magento

Hope the above information helps

Cheers S

1

Facebook has recommended to use new Facebook Pixel since second half year of 2016, it's better to use the new script and insert them into app/design/frontend[your theme folder]\template\page\html\head.phtml

as following js snippet code:

<script>
!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,
document,'script','https://connect.facebook.net/en_US/fbevents.js');

fbq('init', '590??????????');
fbq('track', "PageView");
fbq('track', 'ViewContent');
fbq('track', 'Search');
fbq('track', 'AddToCart');
fbq('track', 'AddToWishlist');
fbq('track', 'InitiateCheckout');
fbq('track', 'Purchase');
fbq('track', 'Lead');
fbq('track', 'CompleteRegistration');

</script>
<noscript><img height="1" width="1" style="display:none"
src="https://www.facebook.com/tr?id=590???????????&ev=PageView&noscript=1"
/></noscript>
<!-- End Facebook Pixel Code -->

If you hope to track particular page or event, you can create custom conversion by following this guide: https://www.facebook.com/business/help/780705975381000

0

You need to copy the file and the file structure from you base directory to your theme

From:

app / design / frontend / base / default / template / checkout / success.phtml

To:

app / design / frontend / default / yourtheme / template / checkout / success.phtml

Then modify your file with your facebook pixel.

0

Please refer free facebook pixel extensions with following settings.

https://www.pearlbells.co.uk/facebook-pixel-magento-extension/Facebook pixel settingadvanced facebook pixel settings

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.