Im trying to add Facebook custom audience pixel on magento. Directions state to add to head file. Oiginally I added to /isolatorfitness.eu/html/app/design/frontend/base/default/template/page/html BUT it applying to all stores. Does any one know what file I need to add each code to, to apply to all stores with seperate domains. Right now we have our main Europe store that has the tracking pixel but Germany and Uk stores need there own code under there own domain.

Thank you

2 Answers 2


You can input your script in the backend in System->Configuration->Design->HTML Head->Miscellaneous Scripts.
This way you can add different scripts for different websites or store views only by changing the scope from the top left selector.

  • This didnt work when we tried. Any other suggestions?
    – ISOFIT
    May 15, 2015 at 14:36
  • define "didn't work". I've used this approach in the past, not for tracking pixels, but for other javascritpts and it worked nicely.
    – Marius
    May 15, 2015 at 14:39
  • The code was not on the "view source" and the connection to facebook was not activated.
    – ISOFIT
    May 15, 2015 at 14:56
  • Have you refreshed your caches after adding the script?
    – Louis B.
    Jul 29, 2015 at 12:37

I'd suggest Marius answer as the best way of doing this, but if you want to do this on the template, I suggest you fetch the store code:

$storeCode = Mage::app()->getStore()->getCode();

Then, lets say your store codes are: uk, de and eu, you could do a switch to set your domain specific code:

switch ($storeCode) {
    case "uk":
        // your uk specific code here...
    case "de":
        // your code
    case "eu":
        //your code

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.